Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Parse StyleSetter from CSS #944

Open
theaino opened this issue Mar 16, 2025 · 1 comment
Open

[Feature Request] Parse StyleSetter from CSS #944

theaino opened this issue Mar 16, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@theaino
Copy link
Contributor

theaino commented Mar 16, 2025

Related problem

No response

Your request

Instead of parsing the CSS globally, I think it would be sensible to parse it into a StyleSetter. In combination with #943, this would allow for the same behavior as before, being more flexible at the same time.

Alternative solution

No response

Additional context

No response

@theaino theaino added the enhancement New feature or request label Mar 16, 2025
@gucio321
Copy link
Collaborator

Sounds reasonable now. In fact, ParseCSS already does it, so returning parsed StyleSetter in the meantime is ok.
However this new mechanism should not interfere with the current CSS mechanism (I mean CSS tags e.t.c.)

I'm thinking laud here:
For now there is something called Context.cssStylesheet. In general this is string:StyleSetter map. I'd make it a separated structure and give it some methods to make it e.g. mergable with other stylesheets (btw, StyleSetter itself could have func (s *StyleSetter) Merge(other *StyleSetter))
Now, naother CSS method could be added. firs one will automatically setup CSS stylesheet (set main tag as default theme and rest of the sheet in Context) and another one to just parse and return sheet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants