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

Themes: Scope custom CSS props to component selectors #8868

Closed
simeonoff opened this issue Jan 29, 2021 · 0 comments · Fixed by #8865 or #8835
Closed

Themes: Scope custom CSS props to component selectors #8868

simeonoff opened this issue Jan 29, 2021 · 0 comments · Fixed by #8865 or #8835
Assignees
Labels
program: igniteui project management ✨ themes 🧰 feature-request ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.

Comments

@simeonoff
Copy link
Collaborator

simeonoff commented Jan 29, 2021

Is your feature request related to a problem? Please describe.

Right now all component theme-related custom CSS props are scoped to the :root selector. This works, but to avoid name collision we have to prefix all props with --igx-{component-name} and it results in some very long prop names and pollutes the :root scope.

Describe the solution you'd like

To simplify the names and ensure consistency between Sass theme prop names and custom CSS props, CSS props should be scoped to the component selector.

In this way we will go from this:

:root {
  --igx-avatar-background: gray;
  --igx-avatar-color: white;
}

to this:

igx-avatar {
  --background: gray;
  --color: white;
}

This should not introduce any breaking changes.

@simeonoff simeonoff self-assigned this Jan 29, 2021
@radomirchev radomirchev added 🛠️ status: in-development Issues and PRs with active development on them and removed 🆕 status: new labels Feb 2, 2021
@simeonoff simeonoff linked a pull request Feb 8, 2021 that will close this issue
14 tasks
@simeonoff simeonoff added ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. and removed 🛠️ status: in-development Issues and PRs with active development on them labels Feb 16, 2021
@radomirchev radomirchev added the program: igniteui project management label Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
program: igniteui project management ✨ themes 🧰 feature-request ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Projects
None yet
2 participants