proposal: State declarations #2698
Labels
core
Processing and transforming logic
discussion
Ongoing conversation
feature
New syntax feature or behavior
Proposal Description
Today when we declare custom state for a part, we use
-st-states
followed by one or more a state declarations.This approach is very simple and straight forward but it limits the reusability of states only to inheritance.
Also today all the states share the namespace of the stylesheet and you cannot cerate an internal part with it's own states.
e.g
.btn:loading
vs.root:loading
The proposal
-st-states
For example we can use the
@st-state
at-rule to declare a states (This syntax open for change and is for the demonstration purposes only).styles.st.css
app.st.css
In regard to our existing
-st-states
, this feature is not going to replace them. Because of that we can have declaration collision that we need to report on.Example for collision:
We can think about the declaration inside
-st-states
as a syntax sugar for declaring states with@st-state
.This way we can resolve the collision like any other symbol collision. This will also hint the way for the exports of the states to stylesheets and
js
modules.Additional Context
No response
The text was updated successfully, but these errors were encountered: