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

css rules not applying on different theme class #317

Open
ItsHaysus opened this issue Jun 17, 2022 · 4 comments
Open

css rules not applying on different theme class #317

ItsHaysus opened this issue Jun 17, 2022 · 4 comments

Comments

@ItsHaysus
Copy link

So i have a set of css rules to handle light mode ( or default)

example:

.featured[min-width = 451px]{
font-size; 14px;
}

this works fine for the default theme, but then i have a css rule to handle dark mode, ex:

.darktheme .featured[min-width = 451px]{
font-size; 20px;
}

and now my styling doesnt work, i talked to some peers and apparently the JS logic to apply the rules might not work when there are non standard classes in front of the parent class. Is there any previous issues about this? can someone guide me on a way to fix it, i assume the issue lies in ElementQueries.JS under the "ApplyRules" function. I'd appreciate any help on fixing this issue.

@marcj
Copy link
Owner

marcj commented Jun 17, 2022

It might be that "darktheme" is added after styles were already applied. In this case you have to call "ElementQueries.init();" again.

@ItsHaysus
Copy link
Author

It might be that "darktheme" is added after styles were already applied. In this case you have to call "ElementQueries.init();" again.

Not sure about that. Both default and dark mode have similar class structure, default theme has theme-default, and dark them has theme-dark on the parent div class.

The only difference is that when we call the styling we dont specify .theme-default since theyre the default one, its only when we want different styling for .theme-dark that they stop being applied. Not sure if im explaining correctly but basically both theme-default and theme-dark are loaded identically.

@marcj
Copy link
Owner

marcj commented Jun 20, 2022

is darktheme added via JavaScript (React/Vue/Angular/jQuery) ?

@ItsHaysus
Copy link
Author

is darktheme added via JavaScript (React/Vue/Angular/jQuery) ?

Its added in the markup via server side

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

No branches or pull requests

2 participants