Skip to content

Commit 86a46f4

Browse files
committed
add new declarations #87
1 parent 804df8b commit 86a46f4

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

src/lib/syntax/syntax.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ export const pseudoElements: string[] = [':before', ':after', ':first-line', ':f
5656
// https://developer.mozilla.org/en-US/docs/Web/CSS/Mozilla_Extensions
5757
export const pseudoAliasMap: Record<string, string> =
5858
{
59+
'-moz-center': 'center',
60+
'-webkit-center': 'center',
5961
'-ms-grid-columns': 'grid-template-columns',
6062
'-ms-grid-rows': 'grid-template-rows',
6163
'-ms-grid-row': 'grid-row-start',
@@ -68,6 +70,7 @@ export const pseudoAliasMap: Record<string, string> =
6870
'::-ms-input-placeholder': '::placeholder',
6971
':-moz-any()': ':is',
7072
'-moz-user-modify': 'user-modify',
73+
'-webkit-match-parent': 'match-parent',
7174
'-moz-background-clip': 'background-clip',
7275
'-moz-background-origin': 'background-origin',
7376
'-ms-input-placeholder': 'placeholder',
@@ -225,6 +228,7 @@ export const webkitExtensions = new Set([
225228
'-webkit-min-logical-height',
226229
'-webkit-min-logical-width',
227230
'-webkit-nbsp-mode',
231+
'-webkit-match-parent',
228232
'-webkit-perspective-origin-x',
229233
'-webkit-perspective-origin-y',
230234
'-webkit-rtl-ordering',

src/lib/validation/config.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@
16121612
"syntax": "auto | fixed"
16131613
},
16141614
"text-align": {
1615-
"syntax": "start | end | left | right | center | justify | match-parent"
1615+
"syntax": "start | end | left | right | center | justify | match-parent | -moz-center | -webkit-center | -webkit-match-parent"
16161616
},
16171617
"text-align-last": {
16181618
"syntax": "auto | start | end | left | right | center | justify"
@@ -1843,7 +1843,7 @@
18431843
"syntax": "auto | grayscale"
18441844
},
18451845
"-moz-user-select": {
1846-
"syntax": "none | text | all | -moz-none"
1846+
"syntax": "none | text | all | -moz-none | auto | element | elements | text | toggle"
18471847
},
18481848
"-ms-flex-align": {
18491849
"syntax": "start | end | center | baseline | stretch"
@@ -3609,6 +3609,9 @@
36093609
},
36103610
"inset-area": {
36113611
"syntax": "[ [ left | center | right | span-left | span-right | x-start | x-end | span-x-start | span-x-end | x-self-start | x-self-end | span-x-self-start | span-x-self-end | span-all ] || [ top | center | bottom | span-top | span-bottom | y-start | y-end | span-y-start | span-y-end | y-self-start | y-self-end | span-y-self-start | span-y-self-end | span-all ] | [ block-start | center | block-end | span-block-start | span-block-end | span-all ] || [ inline-start | center | inline-end | span-inline-start | span-inline-end | span-all ] | [ self-block-start | self-block-end | span-self-block-start | span-self-block-end | span-all ] || [ self-inline-start | self-inline-end | span-self-inline-start | span-self-inline-end | span-all ] | [ start | center | end | span-start | span-end | span-all ]{1,2} | [ self-start | center | self-end | span-self-start | span-self-end | span-all ]{1,2} ]"
3612+
},
3613+
"-non-standard-text-align": {
3614+
"syntax": "| -moz-center | -webkit-center | -webkit-match-parent"
36123615
}
36133616
},
36143617
"selectors": {

tools/validation.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ for (const [key, value] of Object.entries(patches.types)) {
7575
}
7676
}
7777

78+
if (!('auto' in json.declarations['-moz-user-select'])) {
79+
80+
json.declarations['-moz-user-select'].syntax += ' | auto | element | elements | text | toggle';
81+
}
82+
7883
if (!(':-webkit-any()' in json.selectors)) {
7984

8085
json.selectors[':-webkit-any()'] = {syntax: ':-webkit-any( <forgiving-selector-list> )'};
@@ -85,6 +90,14 @@ if (!(':-webkit-any-link' in json.selectors)) {
8590
json.selectors[':-webkit-any-link'] = {syntax: ':-webkit-any-link'};
8691
}
8792

93+
if (!('-non-standard-text-align' in json.syntaxes)) {
94+
95+
json.syntaxes['-non-standard-text-align'] = {syntax: '| -moz-center | -webkit-center | -webkit-match-parent'};
96+
97+
// @ts-ignore
98+
json.declarations['text-align' as keyof typeof json.declarations].syntax += ' ' + json.syntaxes['-non-standard-text-align'].syntax;
99+
}
100+
88101
await writeFile(import.meta.dirname + '/../src/lib/validation/config.json', JSON.stringify(json, null, 1));
89102
console.debug(json);
90103

0 commit comments

Comments
 (0)