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

Allow inheriting class #15

Open
nparashar150 opened this issue Oct 6, 2024 · 0 comments
Open

Allow inheriting class #15

nparashar150 opened this issue Oct 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@nparashar150
Copy link
Owner

Describe the issue
Elements do not have the option to inherit classes from their sibling element above. Users should be able to specify when a element should inherit the class (e.g., using ["~ text-red-500"] to inherit and override only the specified classes).

To Reproduce
Steps to reproduce the behavior:

  1. Apply a class to element, such as:
    ["text-xs font-bold text-muted-foreground"] This is class applied to paragraph
  2. In another line add class to new element with the "~" symbol to inherit the class.
    ["~ text-red-500"] This is class inherited from above paragraph
  3. Compile to HTML.
  4. The child element does not inherit the class or apply the overridden styles.

Expected behavior
When a child element uses the ["~"] syntax, it should inherit the parent’s classes while allowing the user to override specific classes as needed.

Additional context
This feature will provide flexibility for users to reuse parent classes efficiently, reducing redundancy in styling across nested elements.

@nparashar150 nparashar150 added the enhancement New feature or request label Oct 6, 2024
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

1 participant