Hey,
I have done a build of my canvas applications and i wanna mix it with my html/scripts
So for the html and scripts it works i have what i want on my page.
But for the css i don’t understans how to change it. When i put some !important i can change width/height of the Canvas, but there is some width and height on the element that are generated automatically.
For exemple if i want to do a simple display flex and align-items: center , to center the Canvas , i can’t , that don’t work.
If u have some clue to delete the css who are generated automatically would be awsome
I think those properties are set later in JS, so any overriding you do in your CSS files it’s being later on overriden by JavaScript.
One way to work around that if you are self hosting is to step in the __start__.js file included in the build and update the JavaScript code that handles styling for the canvas:
Well i just delete the css part but yeah it didn’t work the way i wanted, well thanks for you answer i will try to understand the script and change what i need.
Hey, sorry i open again the thread but now i have a problem with the html aha…
I’m trying to align my items like two button and the Canvas, but it looks like i cant with my regular html , i can’t put my html element + the html who are generated by the script in a div for exemple.
Should i put all my html elements in the scripts Start.js ?
Hey !
I see but in my case it doesn’t seem relevant to me because I have a whole interface around it and a web page with a lot of content.
But I have to keep the PlayCanvas build because I interact with the materials via scripts/button in my web page
It sounds like you have a PlayCanvas page as part of a larger page? If thats the case, you are probably best to create to your own publishing pipeline that adds the PlayCanvas build to your own HTML boilerplate using the REST API and some custom processing scripts.
Hey yaustar, sorry for the late response i was in week-end.
Yep it’s that , i have a Html Page with some buttons who interact with my PlayCanvas (to change material with some pdf who went through a script to get png). But the problem it’s the PlayCanvas is generated by a script with some body.append.Canvas.
And when i try to create a div and append on this one , the PlayCanvas stop working so i don’t know why.
But yeah maybe i should juste use some script to take off the html tags and put the PlayCanvas where i want to
In cases like this, I use the REST API to download the build via script and use the same script to do the changes needed for the use case. Eg replace the __start.js__ file