Skip to content

Commit add283e

Browse files
Add syntax field to CSSCustomProperty (#74)
1 parent 2d8d519 commit add283e

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2020
<!-- ## [x.y.z] - YYYY-MM-DD -->
2121
## Unreleased
2222
<!-- ### Changed -->
23-
<!-- ### Added -->
23+
### Added
24+
25+
- Added an optional `"syntax"` field to CSSCustomProperty to describe the property syntax using CSS Properties and Values API's syntax strings. Fixes
26+
https://github.com/webcomponents/custom-elements-manifest/issues/68
27+
2428
<!-- ### Removed -->
2529
### Fixed
2630

schema.d.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,21 @@ export interface CssCustomProperty {
323323
*/
324324
name: string;
325325

326+
/**
327+
* The expected syntax of the defined property. Defaults to "*".
328+
*
329+
* The syntax must be a valid CSS [syntax string](https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax)
330+
* as defined in the CSS Properties and Values API.
331+
*
332+
* Examples:
333+
*
334+
* "<color>": accepts a color
335+
* "<length> | <percentage>": accepts lengths or percentages but not calc expressions with a combination of the two
336+
* "small | medium | large": accepts one of these values set as custom idents.
337+
* "*": any valid token
338+
*/
339+
syntax?: string;
340+
326341
default?: string;
327342

328343
/**
@@ -541,8 +556,9 @@ export interface MixinDeclaration extends ClassLike, FunctionLike {
541556
/**
542557
* A class mixin that also adds custom element related properties.
543558
*/
544-
export interface CustomElementMixinDeclaration extends MixinDeclaration, CustomElement {
545-
}
559+
export interface CustomElementMixinDeclaration
560+
extends MixinDeclaration,
561+
CustomElement {}
546562

547563
export interface VariableDeclaration extends PropertyLike {
548564
kind: 'variable';

0 commit comments

Comments
 (0)