-
Notifications
You must be signed in to change notification settings - Fork 153
Open
Labels
@css-blocks/coreIssue with the core CSS Blocks libraryIssue with the core CSS Blocks libraryunder considerationA decision is pending.A decision is pending.
Description
The current code for global attributes lets individual values be marked global, but has no syntax for marking an entire attribute with all its values as global.
It's a little tricky because global attributes are often a forward declaration.
I think we should consider the following:
- For states, the entire attribute should be marked as global with the syntax
@global [state|foo];and doing so should not create any attribute values (including the universal value). - For states, disallow marking individual values as global.
- If block B inherits from block A, marking an attribute as global, makes all inherited values global, but only when accessed through block B, those values from block A, would remain local.
- If block B inherits a global attribute from block A, all values it adds to the global attribute should be global.
In other words:
class Attribute {
private _isGlobal: boolean;
get isGlobal(): boolean {
return this._isGlobal || this.base.isGlobal;
}
set isGlobal(v: true) {
this._isGlobal = v;
}
}
class AttrValue {
get isGlobal(): boolean {
return this.attribute.isGlobal;
}
}Metadata
Metadata
Assignees
Labels
@css-blocks/coreIssue with the core CSS Blocks libraryIssue with the core CSS Blocks libraryunder considerationA decision is pending.A decision is pending.