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

Should the themed function rely on global SCSS variables for validation? #15

Open
Carnageous opened this issue Feb 3, 2025 · 0 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@Carnageous
Copy link
Contributor

Currently, the themed function uses global SCSS variables to

  1. Check if the given value name exists in the themes
  2. Add the pre-defined prefix to get the right CSS variables.

This is nice, but requires the global SCSS variables to be defined in the current scope, meaning that each SCSS file needs to re-define themes by calling the themes mixin. This can easily be done with a global.scss file, but it adds complexity.


Question 1: Should this be the default behavior?

Question 2: Is the $verify argument of the themed function elegant enough to bypass this requirement, or should we rather add a second themed-like function that doesn't do validation?

Question 3: Should we remove the option to add custom prefixes, as this is also using a global SCSS variable?

Question 4: An alternative to this would be to return the themed function from a themes function (like a factory pattern). Would this be a nice alternative?

@Carnageous Carnageous added help wanted Extra attention is needed question Further information is requested labels Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant