You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Better logic for merging CSS decls onto CSS Block nodes.
- discoverGuid doesn't need to be async.
- Don't check if each rule in the blockdef file has a block-class decl.
Instead, validate that each style node has a preset class name after the
block has been processed.
- Add new prop names to BlockSyntax.
- Rename some methods and properties.
- Allow spaces preceeding @block-syntax-version.
- Add fixtures and test coverage for blockdef processing. Ensure that
the resulting block reflects the decls on a given style node for property
conflict resolution.
thrownewError(`Couldn\'t find block class corresponding to selector ${sel}. This shouldn't happen.`);
51
55
}
52
-
node.setPresetClassName(val);
53
56
});
54
57
});
58
+
});
55
59
56
-
// If we didn't find block-class declared, we should error.
57
-
if(!foundDecl){
60
+
// At this point, every style node should have a fixed block-class.
61
+
block.all(true).forEach(styleNode=>{
62
+
if(!styleNode.presetCssClass){
58
63
block.addError(
59
64
newCssBlockError(
60
-
`Definition file rule ${rule.selectors} is missing a 'block-class' declaration`,
61
-
sourceRange(configuration,root,file,rule),
65
+
`Style node ${styleNode.asSource()} doesn't have a preset block class after parsing definition file. You may need to declare this style node in the definition file.`,
* The preset selector string for this style node. This is set if a specific
57
-
* class name was specified using a block-class declaration. This is only
58
-
* relevant to definition files.
59
-
*/
60
-
getpresetCssClass(): string|undefined{
61
-
returnthis.presetSelector;
62
-
}
63
-
64
55
/**
65
56
* Return the source selector this `Style` was read from.
66
57
* @param scope Optional scope to resolve this name relative to. If `true`, return the Block name instead of `:scope`. If a Block object, return with the local name instead of `:scope`.
0 commit comments