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

feat: strict custom property #2929

Merged
merged 7 commits into from
Dec 3, 2023
Merged

feat: strict custom property #2929

merged 7 commits into from
Dec 3, 2023

Conversation

idoros
Copy link
Collaborator

@idoros idoros commented Dec 3, 2023

This pr introduces a new feature: the strictCustomProperty flag, which ensures that custom property usage always relays on a defined property and does not define a property by itself.

Previously, the behavior was more lenient, allowing custom property definition via get/set methods within a stylesheet. However, with the strictCustomProperty flag activated, any reference to an undeclared property (e.g. --undeclared: red or color: var(--undeclared)) will result in a diagnostic error being reported.

It's important to note that this behavior applies only to st.css stylesheets and not native CSS stylesheets..

Additionally, this pr introduces a new flags option in the Stylable configuration, allowing for the activation of the strictCustomProperty flag.

@idoros idoros self-assigned this Dec 3, 2023
@idoros idoros added feature New syntax feature or behavior core Processing and transforming logic labels Dec 3, 2023
@idoros idoros requested a review from barak007 December 3, 2023 12:14
- wait till someone complains and improve the general ignore configuration
- instead of piping them everywhere
@idoros idoros merged commit a87597c into master Dec 3, 2023
12 checks passed
@idoros idoros deleted the ido/strict-custom-prop branch December 3, 2023 14:54
idoros added a commit that referenced this pull request Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Processing and transforming logic feature New syntax feature or behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants