Closed kof closed 7 years ago
One idea I have to solve this is a class name template: .my-button-{id}
, where {id}
can be replaced by the runtime. If a class name has no id, it automatically makes it "global".
Another idea which is based on #13
[
[ SELECTOR_OPEN ],
[ SELECTOR, '.foo', SCOPED ],
[ PROPERTY, 'prop' ],
[ VALUE, 'value' ],
[ SELECTOR_OPEN ],
[ SELECTOR, '&:psuedo' ],
[ PROPERTY, 'foo' ],
[ VALUE, 'bar' ],
[ SELECTOR_CLOSE ],
[ SELECTOR_CLOSE ],
]
.foo-123456 {
prop: value;
&:pseudo {
foo: bar;
}
}
Instead of [ SELECTOR, '.foo', SCOPED ],
it could be also [ SCOPED_SELECTOR, '.foo'],
I think we got this in #17
As we def. need to support both scoped (generated) and regular class names, there is a question how to do that in a way that doesn't introduces much troubles to the runtimes.
I think class name generation algorithm should be out of scope for the standard, instead runtime should decide. There are too many hashing algorithms and counter based solutions. If we would try to generate the class name within the standard, we would need to make sure it will work across the entire world. If we let runtimes decide on the algorithm, it just has to work within a specific project.