In compose-web can we edit the styles.css file by ...
# compose-web
s
In compose-web can we edit the styles.css file by changing the default properties? I would like to use @media (max-width: 768px) and assign h4 { font-size: 1.5rem} ... thanks
r
compose-web doesn't render html and doesn't use css, perhaps you mean compose-html?
a
@Stefano Milani tldr yes but not because of compose web but because of kotlin/js (#C0B8L3U69) if you can do it w javascript you can do it from kotlin running on your browser. you can ask chatgpt for the code. it knows js pretty well and gets the kotlin counter part mostly right.
on an other note, you might not really want to do this it would help if you told us what you are trying to achieve, because compose web and css doesnt really match as @Robert Jaros said
s
@Robert Jaros @Alex Styl Thank you for your reply, so my question now is: "Why the multiplatform project for compose web has styles.css in the wasmJsMain resources?" what is the purpouse of this if we cannot use? I don't use css for my project but I tried to solve and investigate some ways to have font resized at runtime and one of these was by css.
a
@Stefano Milani It is probably* because a compose web app is hosted in an html file. There is probably an index.html there that uses the said styles. If the index.html was not there to host your app, you would have no way to see your app in the browser So the styles are for that index.html (the host of your app) not for the compose app itself probably* = I dont know how u set up your project, so hard to know how your project is structured
s
@Alex Styl Yes you are right, I also thought it was only for the index, but some misleading advice led me to believe that it also affected the rest of the structure in compose-web. I was looking for a way to manage fontsize, thanks. Now I solved it by using MaterialTheme.typography directly
a
@Stefano Milani that's the way to go if u use material 👍