Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Check mdn/data initial values
const csstree = require('css-tree');
const data = require('mdn-data/css/properties.json');
Object.keys(data).forEach(name => {
const prop = data[name];
if (Array.isArray(prop.initial)) {
return;
}
if (typeof prop.initial === 'undefined') {
console.log(`"${name}" missed initial value`);
return;
}
const ast = csstree.parse(prop.initial, { context: 'value' });
const result = csstree.lexer.matchProperty(name, ast);
if (result.error) {
console.log();
console.log({ name, initial: prop.initial });
console.log(String(result.error));
}
});
{ name: '-moz-appearance',
initial: 'noneButOverriddenInUserAgentCSS' }
SyntaxMatchError: Mismatch
syntax: none | button | button-arrow-down | button-arrow-next | button-arrow-previous | button-arrow-up | button-bevel | button-focus | caret | checkbox | checkbox-container | checkbox-label | checkmenuitem | dualbutton | groupbox | listbox | listitem | menuarrow | menubar | menucheckbox | menuimage | menuitem | menuitemtext | menulist | menulist-button | menulist-text | menulist-textfield | menupopup | menuradio | menuseparator | meterbar | meterchunk | progressbar | progressbar-vertical | progresschunk | progresschunk-vertical | radio | radio-container | radio-label | radiomenuitem | range | range-thumb | resizer | resizerpanel | scale-horizontal | scalethumbend | scalethumb-horizontal | scalethumbstart | scalethumbtick | scalethumb-vertical | scale-vertical | scrollbarbutton-down | scrollbarbutton-left | scrollbarbutton-right | scrollbarbutton-up | scrollbarthumb-horizontal | scrollbarthumb-vertical | scrollbartrack-horizontal | scrollbartrack-vertical | searchfield | separator | sheet | spinner | spinner-downbutton | spinner-textfield | spinner-upbutton | splitter | statusbar | statusbarpanel | tab | tabpanel | tabpanels | tab-scroll-arrow-back | tab-scroll-arrow-forward | textfield | textfield-multiline | toolbar | toolbarbutton | toolbarbutton-dropdown | toolbargripper | toolbox | tooltip | treeheader | treeheadercell | treeheadersortarrow | treeitem | treeline | treetwisty | treetwistyopen | treeview | -moz-mac-unified-toolbar | -moz-win-borderless-glass | -moz-win-browsertabbar-toolbox | -moz-win-communicationstext | -moz-win-communications-toolbox | -moz-win-exclude-glass | -moz-win-glass | -moz-win-mediatext | -moz-win-media-toolbox | -moz-window-button-box | -moz-window-button-box-maximized | -moz-window-button-close | -moz-window-button-maximize | -moz-window-button-minimize | -moz-window-button-restore | -moz-window-frame-bottom | -moz-window-frame-left | -moz-window-frame-right | -moz-window-titlebar | -moz-window-titlebar-maximized
value: noneButOverriddenInUserAgentCSS
--------^
{ name: '-webkit-box-reflect', initial: 'none' }
SyntaxMatchError: Uncomplete match
syntax: [ above | below | right | left ]? <length>? <image>?
value: none
--------^
{ name: 'all', initial: 'noPracticalInitialValue' }
SyntaxMatchError: Mismatch
syntax: initial | inherit | unset
value: noPracticalInitialValue
--------^
{ name: 'border-image-outset', initial: '0s' }
SyntaxMatchError: Mismatch
syntax: [ <length> | <number> ]{1,4}
value: 0s
--------^
{ name: 'box-orient', initial: 'inlineAxisHorizontalInXUL' }
SyntaxMatchError: Mismatch
syntax: horizontal | vertical | inline-axis | block-axis | inherit
value: inlineAxisHorizontalInXUL
--------^
{ name: 'color', initial: 'variesFromBrowserToBrowser' }
SyntaxMatchError: Mismatch
syntax: <color>
value: variesFromBrowserToBrowser
--------^
{ name: 'outline-color', initial: 'invertOrCurrentColor' }
SyntaxMatchError: Mismatch
syntax: <color> | invert
value: invertOrCurrentColor
--------^
{ name: 'quotes', initial: 'dependsOnUserAgent' }
SyntaxMatchError: Mismatch
syntax: none | [ <string> <string> ]+
value: dependsOnUserAgent
--------^
{ name: 'text-align',
initial: 'startOrNamelessValueIfLTRRightIfRTL' }
SyntaxMatchError: Mismatch
syntax: start | end | left | right | center | justify | match-parent
value: startOrNamelessValueIfLTRRightIfRTL
--------^
{ name: 'text-size-adjust',
initial: 'autoForSmartphoneBrowsersSupportingInflation' }
SyntaxMatchError: Mismatch
syntax: none | auto | <percentage>
value: autoForSmartphoneBrowsersSupportingInflation
--------^
"-moz-background-clip" missed initial value
"-moz-border-radius-bottomleft" missed initial value
"-moz-border-radius-bottomright" missed initial value
"-moz-border-radius-topleft" missed initial value
"-moz-border-radius-topright" missed initial value
"-moz-osx-font-smoothing" missed initial value
"-moz-user-select" missed initial value
"-ms-filter" missed initial value
"-ms-flex-align" missed initial value
"-ms-flex-item-align" missed initial value
"-ms-flex-line-pack" missed initial value
"-ms-flex-negative" missed initial value
"-ms-flex-pack" missed initial value
"-ms-flex-order" missed initial value
"-ms-flex-positive" missed initial value
"-ms-flex-preferred-size" missed initial value
"-ms-interpolation-mode" missed initial value
"-ms-grid-column-align" missed initial value
"-ms-grid-row-align" missed initial value
"-ms-high-contrast-adjust" missed initial value
"-ms-user-select" missed initial value
"-webkit-appearance" missed initial value
"-webkit-background-clip" missed initial value
"-webkit-column-break-after" missed initial value
"-webkit-column-break-before" missed initial value
"-webkit-column-break-inside" missed initial value
"-webkit-font-smoothing" missed initial value
"-webkit-line-clamp" missed initial value
"-webkit-mask-box-image" missed initial value
"-webkit-overflow-scrolling" missed initial value
"-webkit-print-color-adjust" missed initial value
"-webkit-text-security" missed initial value
"-webkit-user-drag" missed initial value
"-webkit-user-select" missed initial value
"alignment-baseline" missed initial value
"baseline-shift" missed initial value
"behavior" missed initial value
"clip-rule" missed initial value
"cue" missed initial value
"cue-after" missed initial value
"cue-before" missed initial value
"dominant-baseline" missed initial value
"fill" missed initial value
"fill-opacity" missed initial value
"fill-rule" missed initial value
"glyph-orientation-horizontal" missed initial value
"glyph-orientation-vertical" missed initial value
"kerning" missed initial value
"marker" missed initial value
"marker-end" missed initial value
"marker-mid" missed initial value
"marker-start" missed initial value
"pause" missed initial value
"pause-after" missed initial value
"pause-before" missed initial value
"rest" missed initial value
"rest-after" missed initial value
"rest-before" missed initial value
"shape-rendering" missed initial value
"src" missed initial value
"speak" missed initial value
"speak-as" missed initial value
"stroke" missed initial value
"stroke-dasharray" missed initial value
"stroke-dashoffset" missed initial value
"stroke-linecap" missed initial value
"stroke-linejoin" missed initial value
"stroke-miterlimit" missed initial value
"stroke-opacity" missed initial value
"stroke-width" missed initial value
"text-anchor" missed initial value
"unicode-range" missed initial value
"voice-balance" missed initial value
"voice-duration" missed initial value
"voice-family" missed initial value
"voice-pitch" missed initial value
"voice-range" missed initial value
"voice-rate" missed initial value
"voice-stress" missed initial value
"voice-volume" missed initial value
"zoom" missed initial value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment