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

Improve the way React component can extend Vanilla %placeholders #5030

Open
bartaz opened this issue Mar 18, 2024 · 0 comments
Open

Improve the way React component can extend Vanilla %placeholders #5030

bartaz opened this issue Mar 18, 2024 · 0 comments
Labels
Feature 🎁 New feature or request

Comments

@bartaz
Copy link
Contributor

bartaz commented Mar 18, 2024

React components should not include duplicates of Vanilla styling, especially Vanilla base, as it may cause conflicts when base styles override existing component styles (bug such as canonical/react-components#1041).

To avoid this we need to allow including SCSS placeholders without including any actual Vanilla styling.
This is possible with base placeholders via @include vf-b-placeholders, but is not possible with other more specific placeholders, such as included in vf-b-forms or other components.

We should extract the placeholders outside of regular Vanilla styles, so they can be included in React components without including the base/component styles themselves.

So for example any placeholders needed by forms, could be separated into vf-b-forms-placeholders (or be included in vf-b-placeholders).

Current workaround requires any Vanilla includes that are not just placeholders to be scoped within a component class name, as

.my-component {
  @include vf-b-forms; // Vanilla form styles scoped within the component
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature 🎁 New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant