@master/css 2.0.0-rc.34 → 2.0.0-rc.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common.cjs +15 -1
- package/dist/common.d.ts +1 -0
- package/dist/common.mjs +15 -2
- package/dist/config/index.cjs +2 -2
- package/dist/config/rules.cjs +32 -53
- package/dist/config/rules.d.ts +1 -1
- package/dist/config/rules.mjs +25 -43
- package/dist/config/utilities.cjs +12 -0
- package/dist/config/utilities.d.ts +12 -0
- package/dist/config/utilities.mjs +12 -0
- package/dist/index.cjs +2 -1
- package/dist/index.mjs +1 -1
- package/dist/utils/autofill-solid-style.cjs +31 -0
- package/dist/utils/autofill-solid-style.d.ts +3 -0
- package/dist/utils/autofill-solid-style.mjs +29 -0
- package/dist/utils/is-core-rule.cjs +1 -1
- package/package.json +1 -1
package/dist/common.cjs
CHANGED
|
@@ -102,7 +102,7 @@ const VALUE_UNITS = [
|
|
|
102
102
|
const UNIT_REGEX = /^([+-.]?\d+(\.?\d+)?)(%|cm|mm|q|in|pt|pc|px|em|rem|ex|rex|cap|rcap|ch|rch|ic|ric|lh|rlh|vw|svw|lvw|dvw|vh|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax|cqw|cqh|cqi|cqb|cqmin|cqmax|deg|grad|rad|turn|s|ms|hz|khz|dpi|dpcm|dppx|x|fr|db|st)?$/;
|
|
103
103
|
const IMAGE_VALUE_REGEX = /(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\(.*\)/;
|
|
104
104
|
const COLOR_VALUE_REGEX = /(?:#|(?:color|color-contrast|color-mix|hwb|lab|lch|oklab|oklch|rgb|rgba|hsl|hsla)\(.*\)|(?:\$colors)(?![a-zA-Z0-9-]))/;
|
|
105
|
-
const NUMBER_VALUE_REGEX = /(?:[\d.]|(?:max|min|calc|clamp)\(
|
|
105
|
+
const NUMBER_VALUE_REGEX = /(?:[\d.]|(?:max|min|calc|clamp)\([^|]*\))/;
|
|
106
106
|
const OFFICIAL_URL = new URL('https://rc.css.master.co');
|
|
107
107
|
const CLASS_ATTRIBUTES = [
|
|
108
108
|
'class',
|
|
@@ -122,10 +122,24 @@ const CLASS_FUNCTIONS = [
|
|
|
122
122
|
'styled(?:\\s+)?(?:\\.\\w+)?',
|
|
123
123
|
'classList(?:\\s+)?\\.(?:add|remove|toggle|replace)'
|
|
124
124
|
];
|
|
125
|
+
const BORDER_STYLE_VALUES = [
|
|
126
|
+
'none',
|
|
127
|
+
'auto',
|
|
128
|
+
'hidden',
|
|
129
|
+
'dotted',
|
|
130
|
+
'dashed',
|
|
131
|
+
'solid',
|
|
132
|
+
'double',
|
|
133
|
+
'groove',
|
|
134
|
+
'ridge',
|
|
135
|
+
'inset',
|
|
136
|
+
'outset'
|
|
137
|
+
];
|
|
125
138
|
|
|
126
139
|
exports.ANIMATION_SIGN = ANIMATION_SIGN;
|
|
127
140
|
exports.AT_SIGN = AT_SIGN;
|
|
128
141
|
exports.BASE_UNIT_REGEX = BASE_UNIT_REGEX;
|
|
142
|
+
exports.BORDER_STYLE_VALUES = BORDER_STYLE_VALUES;
|
|
129
143
|
exports.CLASS_ATTRIBUTES = CLASS_ATTRIBUTES;
|
|
130
144
|
exports.CLASS_DECLARATIONS = CLASS_DECLARATIONS;
|
|
131
145
|
exports.CLASS_FUNCTIONS = CLASS_FUNCTIONS;
|
package/dist/common.d.ts
CHANGED
package/dist/common.mjs
CHANGED
|
@@ -100,7 +100,7 @@ const VALUE_UNITS = [
|
|
|
100
100
|
const UNIT_REGEX = /^([+-.]?\d+(\.?\d+)?)(%|cm|mm|q|in|pt|pc|px|em|rem|ex|rex|cap|rcap|ch|rch|ic|ric|lh|rlh|vw|svw|lvw|dvw|vh|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax|cqw|cqh|cqi|cqb|cqmin|cqmax|deg|grad|rad|turn|s|ms|hz|khz|dpi|dpcm|dppx|x|fr|db|st)?$/;
|
|
101
101
|
const IMAGE_VALUE_REGEX = /(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\(.*\)/;
|
|
102
102
|
const COLOR_VALUE_REGEX = /(?:#|(?:color|color-contrast|color-mix|hwb|lab|lch|oklab|oklch|rgb|rgba|hsl|hsla)\(.*\)|(?:\$colors)(?![a-zA-Z0-9-]))/;
|
|
103
|
-
const NUMBER_VALUE_REGEX = /(?:[\d.]|(?:max|min|calc|clamp)\(
|
|
103
|
+
const NUMBER_VALUE_REGEX = /(?:[\d.]|(?:max|min|calc|clamp)\([^|]*\))/;
|
|
104
104
|
const OFFICIAL_URL = new URL('https://rc.css.master.co');
|
|
105
105
|
const CLASS_ATTRIBUTES = [
|
|
106
106
|
'class',
|
|
@@ -120,5 +120,18 @@ const CLASS_FUNCTIONS = [
|
|
|
120
120
|
'styled(?:\\s+)?(?:\\.\\w+)?',
|
|
121
121
|
'classList(?:\\s+)?\\.(?:add|remove|toggle|replace)'
|
|
122
122
|
];
|
|
123
|
+
const BORDER_STYLE_VALUES = [
|
|
124
|
+
'none',
|
|
125
|
+
'auto',
|
|
126
|
+
'hidden',
|
|
127
|
+
'dotted',
|
|
128
|
+
'dashed',
|
|
129
|
+
'solid',
|
|
130
|
+
'double',
|
|
131
|
+
'groove',
|
|
132
|
+
'ridge',
|
|
133
|
+
'inset',
|
|
134
|
+
'outset'
|
|
135
|
+
];
|
|
123
136
|
|
|
124
|
-
export { ANIMATION_SIGN, AT_SIGN, BASE_UNIT_REGEX, CLASS_ATTRIBUTES, CLASS_DECLARATIONS, CLASS_FUNCTIONS, COLOR_VALUE_REGEX, DELIMITER_SIGN, IMAGE_VALUE_REGEX, NUMBER_VALUE_REGEX, OFFICIAL_URL, QUERY_COMPARISON_OPERATORS, QUERY_LOGICAL_OPERATORS, SELECTOR_SIGNS, SEPARATOR_SIGN, SEPARATOR_SIGNS, TRANSITION_SIGN, UNIT_REGEX, VALUE_DELIMITERS, VALUE_UNITS };
|
|
137
|
+
export { ANIMATION_SIGN, AT_SIGN, BASE_UNIT_REGEX, BORDER_STYLE_VALUES, CLASS_ATTRIBUTES, CLASS_DECLARATIONS, CLASS_FUNCTIONS, COLOR_VALUE_REGEX, DELIMITER_SIGN, IMAGE_VALUE_REGEX, NUMBER_VALUE_REGEX, OFFICIAL_URL, QUERY_COMPARISON_OPERATORS, QUERY_LOGICAL_OPERATORS, SELECTOR_SIGNS, SEPARATOR_SIGN, SEPARATOR_SIGNS, TRANSITION_SIGN, UNIT_REGEX, VALUE_DELIMITERS, VALUE_UNITS };
|
package/dist/config/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@ const config = {
|
|
|
13
13
|
queries,
|
|
14
14
|
selectors,
|
|
15
15
|
utilities,
|
|
16
|
-
rules
|
|
16
|
+
rules,
|
|
17
17
|
functions,
|
|
18
18
|
animations,
|
|
19
19
|
variables,
|
|
@@ -30,7 +30,7 @@ exports.selectors = selectors;
|
|
|
30
30
|
exports.utilities = utilities;
|
|
31
31
|
exports.animations = animations;
|
|
32
32
|
exports.variables = variables;
|
|
33
|
-
exports.rules = rules
|
|
33
|
+
exports.rules = rules;
|
|
34
34
|
exports.modes = modes;
|
|
35
35
|
exports.functions = functions;
|
|
36
36
|
exports.config = config;
|
package/dist/config/rules.cjs
CHANGED
|
@@ -1,43 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var cssEscape = require('../shared/utils/css-escape.cjs');
|
|
6
4
|
var layer = require('../layer.cjs');
|
|
7
5
|
var common = require('../common.cjs');
|
|
6
|
+
var autofillSolidStyle = require('../utils/autofill-solid-style.cjs');
|
|
8
7
|
|
|
9
|
-
// values
|
|
10
|
-
const BORDER_STYLE_VALUES = [
|
|
11
|
-
'none',
|
|
12
|
-
'auto',
|
|
13
|
-
'hidden',
|
|
14
|
-
'dotted',
|
|
15
|
-
'dashed',
|
|
16
|
-
'solid',
|
|
17
|
-
'double',
|
|
18
|
-
'groove',
|
|
19
|
-
'ridge',
|
|
20
|
-
'inset',
|
|
21
|
-
'outset'
|
|
22
|
-
];
|
|
23
|
-
const autofillSolidToValueComponent = function(valueComponents) {
|
|
24
|
-
if (valueComponents.length < 2) return valueComponents;
|
|
25
|
-
const styleValueComponent = valueComponents.find((valueComponent)=>{
|
|
26
|
-
return valueComponent.type === 'string' && BORDER_STYLE_VALUES.includes(valueComponent.value) || valueComponent.type === 'variable' && BORDER_STYLE_VALUES.includes(String(valueComponent.variable?.value));
|
|
27
|
-
});
|
|
28
|
-
if (!styleValueComponent) {
|
|
29
|
-
valueComponents.push({
|
|
30
|
-
type: 'separator',
|
|
31
|
-
value: ' ',
|
|
32
|
-
token: '|'
|
|
33
|
-
}, {
|
|
34
|
-
type: 'string',
|
|
35
|
-
value: 'solid',
|
|
36
|
-
token: 'solid'
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
return valueComponents;
|
|
40
|
-
};
|
|
41
8
|
const rules = {
|
|
42
9
|
group: {
|
|
43
10
|
matcher: /^(?:.+?[*_>~+])?\{.+?\}/,
|
|
@@ -154,7 +121,7 @@ const rules = {
|
|
|
154
121
|
},
|
|
155
122
|
variable: {
|
|
156
123
|
matcher: /^\$[\w-]+:/,
|
|
157
|
-
layer: layer.
|
|
124
|
+
layer: layer.Shorthand,
|
|
158
125
|
declare (value) {
|
|
159
126
|
return {
|
|
160
127
|
['--' + this.keyToken.slice(1, -1)]: value
|
|
@@ -789,6 +756,19 @@ const rules = {
|
|
|
789
756
|
],
|
|
790
757
|
layer: layer.Native
|
|
791
758
|
},
|
|
759
|
+
'text-wrap': {
|
|
760
|
+
ambiguousKeys: [
|
|
761
|
+
'text',
|
|
762
|
+
't'
|
|
763
|
+
],
|
|
764
|
+
ambiguousValues: [
|
|
765
|
+
'wrap',
|
|
766
|
+
'nowrap',
|
|
767
|
+
'balance',
|
|
768
|
+
'pretty'
|
|
769
|
+
],
|
|
770
|
+
layer: layer.NativeShorthand
|
|
771
|
+
},
|
|
792
772
|
'text-indent': {
|
|
793
773
|
unit: 'rem',
|
|
794
774
|
layer: layer.Native
|
|
@@ -1372,7 +1352,7 @@ const rules = {
|
|
|
1372
1352
|
'bt',
|
|
1373
1353
|
'border-top'
|
|
1374
1354
|
],
|
|
1375
|
-
ambiguousValues: BORDER_STYLE_VALUES,
|
|
1355
|
+
ambiguousValues: common.BORDER_STYLE_VALUES,
|
|
1376
1356
|
layer: layer.Native
|
|
1377
1357
|
},
|
|
1378
1358
|
'border-bottom-style': {
|
|
@@ -1380,7 +1360,7 @@ const rules = {
|
|
|
1380
1360
|
'bb',
|
|
1381
1361
|
'border-bottom'
|
|
1382
1362
|
],
|
|
1383
|
-
ambiguousValues: BORDER_STYLE_VALUES,
|
|
1363
|
+
ambiguousValues: common.BORDER_STYLE_VALUES,
|
|
1384
1364
|
layer: layer.Native
|
|
1385
1365
|
},
|
|
1386
1366
|
'border-left-style': {
|
|
@@ -1388,7 +1368,7 @@ const rules = {
|
|
|
1388
1368
|
'bl',
|
|
1389
1369
|
'border-left'
|
|
1390
1370
|
],
|
|
1391
|
-
ambiguousValues: BORDER_STYLE_VALUES,
|
|
1371
|
+
ambiguousValues: common.BORDER_STYLE_VALUES,
|
|
1392
1372
|
layer: layer.Native
|
|
1393
1373
|
},
|
|
1394
1374
|
'border-right-style': {
|
|
@@ -1396,7 +1376,7 @@ const rules = {
|
|
|
1396
1376
|
'br',
|
|
1397
1377
|
'border-right'
|
|
1398
1378
|
],
|
|
1399
|
-
ambiguousValues: BORDER_STYLE_VALUES,
|
|
1379
|
+
ambiguousValues: common.BORDER_STYLE_VALUES,
|
|
1400
1380
|
layer: layer.Native
|
|
1401
1381
|
},
|
|
1402
1382
|
'border-x-style': {
|
|
@@ -1404,7 +1384,7 @@ const rules = {
|
|
|
1404
1384
|
'bx',
|
|
1405
1385
|
'border-x'
|
|
1406
1386
|
],
|
|
1407
|
-
ambiguousValues: BORDER_STYLE_VALUES,
|
|
1387
|
+
ambiguousValues: common.BORDER_STYLE_VALUES,
|
|
1408
1388
|
layer: layer.Shorthand,
|
|
1409
1389
|
declare (value) {
|
|
1410
1390
|
return {
|
|
@@ -1418,7 +1398,7 @@ const rules = {
|
|
|
1418
1398
|
'by',
|
|
1419
1399
|
'border-y'
|
|
1420
1400
|
],
|
|
1421
|
-
ambiguousValues: BORDER_STYLE_VALUES,
|
|
1401
|
+
ambiguousValues: common.BORDER_STYLE_VALUES,
|
|
1422
1402
|
layer: layer.Shorthand,
|
|
1423
1403
|
declare (value) {
|
|
1424
1404
|
return {
|
|
@@ -1432,7 +1412,7 @@ const rules = {
|
|
|
1432
1412
|
'b',
|
|
1433
1413
|
'border'
|
|
1434
1414
|
],
|
|
1435
|
-
ambiguousValues: BORDER_STYLE_VALUES,
|
|
1415
|
+
ambiguousValues: common.BORDER_STYLE_VALUES,
|
|
1436
1416
|
layer: layer.NativeShorthand
|
|
1437
1417
|
},
|
|
1438
1418
|
// border width
|
|
@@ -1582,31 +1562,31 @@ const rules = {
|
|
|
1582
1562
|
key: 'bt',
|
|
1583
1563
|
layer: layer.NativeShorthand,
|
|
1584
1564
|
unit: 'rem',
|
|
1585
|
-
transformValueComponents:
|
|
1565
|
+
transformValueComponents: autofillSolidStyle
|
|
1586
1566
|
},
|
|
1587
1567
|
'border-bottom': {
|
|
1588
1568
|
key: 'bb',
|
|
1589
1569
|
layer: layer.NativeShorthand,
|
|
1590
1570
|
unit: 'rem',
|
|
1591
|
-
transformValueComponents:
|
|
1571
|
+
transformValueComponents: autofillSolidStyle
|
|
1592
1572
|
},
|
|
1593
1573
|
'border-left': {
|
|
1594
1574
|
key: 'bl',
|
|
1595
1575
|
layer: layer.NativeShorthand,
|
|
1596
1576
|
unit: 'rem',
|
|
1597
|
-
transformValueComponents:
|
|
1577
|
+
transformValueComponents: autofillSolidStyle
|
|
1598
1578
|
},
|
|
1599
1579
|
'border-right': {
|
|
1600
1580
|
key: 'br',
|
|
1601
1581
|
layer: layer.NativeShorthand,
|
|
1602
1582
|
unit: 'rem',
|
|
1603
|
-
transformValueComponents:
|
|
1583
|
+
transformValueComponents: autofillSolidStyle
|
|
1604
1584
|
},
|
|
1605
1585
|
'border-x': {
|
|
1606
1586
|
key: 'bx',
|
|
1607
1587
|
unit: 'rem',
|
|
1608
1588
|
layer: layer.Shorthand,
|
|
1609
|
-
transformValueComponents:
|
|
1589
|
+
transformValueComponents: autofillSolidStyle,
|
|
1610
1590
|
declare (value) {
|
|
1611
1591
|
return {
|
|
1612
1592
|
'border-left': value,
|
|
@@ -1618,7 +1598,7 @@ const rules = {
|
|
|
1618
1598
|
key: 'by',
|
|
1619
1599
|
unit: 'rem',
|
|
1620
1600
|
layer: layer.Shorthand,
|
|
1621
|
-
transformValueComponents:
|
|
1601
|
+
transformValueComponents: autofillSolidStyle,
|
|
1622
1602
|
declare (value) {
|
|
1623
1603
|
return {
|
|
1624
1604
|
'border-top': value,
|
|
@@ -1630,7 +1610,7 @@ const rules = {
|
|
|
1630
1610
|
key: 'b',
|
|
1631
1611
|
unit: 'rem',
|
|
1632
1612
|
layer: layer.NativeShorthand,
|
|
1633
|
-
transformValueComponents:
|
|
1613
|
+
transformValueComponents: autofillSolidStyle
|
|
1634
1614
|
},
|
|
1635
1615
|
'background-attachment': {
|
|
1636
1616
|
ambiguousKeys: [
|
|
@@ -2030,7 +2010,7 @@ const rules = {
|
|
|
2030
2010
|
ambiguousKeys: [
|
|
2031
2011
|
'outline'
|
|
2032
2012
|
],
|
|
2033
|
-
ambiguousValues: BORDER_STYLE_VALUES,
|
|
2013
|
+
ambiguousValues: common.BORDER_STYLE_VALUES,
|
|
2034
2014
|
layer: layer.Native
|
|
2035
2015
|
},
|
|
2036
2016
|
'outline-width': {
|
|
@@ -2055,7 +2035,7 @@ const rules = {
|
|
|
2055
2035
|
'outline-offset',
|
|
2056
2036
|
'outline-color'
|
|
2057
2037
|
],
|
|
2058
|
-
transformValueComponents:
|
|
2038
|
+
transformValueComponents: autofillSolidStyle
|
|
2059
2039
|
},
|
|
2060
2040
|
'accent-color': {
|
|
2061
2041
|
key: 'accent',
|
|
@@ -2299,5 +2279,4 @@ const rules = {
|
|
|
2299
2279
|
}
|
|
2300
2280
|
};
|
|
2301
2281
|
|
|
2302
|
-
exports
|
|
2303
|
-
exports.default = rules;
|
|
2282
|
+
module.exports = rules;
|
package/dist/config/rules.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { RuleDefinition } from '../rule';
|
|
2
2
|
import Layer from '../layer';
|
|
3
|
-
export declare const autofillSolidToValueComponent: RuleDefinition['transformValueComponents'];
|
|
4
3
|
declare const rules: {
|
|
5
4
|
group: RuleDefinition;
|
|
6
5
|
variable: RuleDefinition;
|
|
@@ -73,6 +72,7 @@ declare const rules: {
|
|
|
73
72
|
'text-orientation': RuleDefinition;
|
|
74
73
|
'text-transform': RuleDefinition;
|
|
75
74
|
'text-rendering': RuleDefinition;
|
|
75
|
+
'text-wrap': RuleDefinition;
|
|
76
76
|
'text-indent': RuleDefinition;
|
|
77
77
|
'vertical-align': RuleDefinition;
|
|
78
78
|
columns: RuleDefinition;
|
package/dist/config/rules.mjs
CHANGED
|
@@ -1,39 +1,8 @@
|
|
|
1
1
|
import cssEscape from '../shared/utils/css-escape.mjs';
|
|
2
2
|
import Layer from '../layer.mjs';
|
|
3
|
-
import { VALUE_DELIMITERS, NUMBER_VALUE_REGEX, COLOR_VALUE_REGEX, IMAGE_VALUE_REGEX } from '../common.mjs';
|
|
3
|
+
import { VALUE_DELIMITERS, NUMBER_VALUE_REGEX, COLOR_VALUE_REGEX, BORDER_STYLE_VALUES, IMAGE_VALUE_REGEX } from '../common.mjs';
|
|
4
|
+
import autofillSolidStyle from '../utils/autofill-solid-style.mjs';
|
|
4
5
|
|
|
5
|
-
// values
|
|
6
|
-
const BORDER_STYLE_VALUES = [
|
|
7
|
-
'none',
|
|
8
|
-
'auto',
|
|
9
|
-
'hidden',
|
|
10
|
-
'dotted',
|
|
11
|
-
'dashed',
|
|
12
|
-
'solid',
|
|
13
|
-
'double',
|
|
14
|
-
'groove',
|
|
15
|
-
'ridge',
|
|
16
|
-
'inset',
|
|
17
|
-
'outset'
|
|
18
|
-
];
|
|
19
|
-
const autofillSolidToValueComponent = function(valueComponents) {
|
|
20
|
-
if (valueComponents.length < 2) return valueComponents;
|
|
21
|
-
const styleValueComponent = valueComponents.find((valueComponent)=>{
|
|
22
|
-
return valueComponent.type === 'string' && BORDER_STYLE_VALUES.includes(valueComponent.value) || valueComponent.type === 'variable' && BORDER_STYLE_VALUES.includes(String(valueComponent.variable?.value));
|
|
23
|
-
});
|
|
24
|
-
if (!styleValueComponent) {
|
|
25
|
-
valueComponents.push({
|
|
26
|
-
type: 'separator',
|
|
27
|
-
value: ' ',
|
|
28
|
-
token: '|'
|
|
29
|
-
}, {
|
|
30
|
-
type: 'string',
|
|
31
|
-
value: 'solid',
|
|
32
|
-
token: 'solid'
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
return valueComponents;
|
|
36
|
-
};
|
|
37
6
|
const rules = {
|
|
38
7
|
group: {
|
|
39
8
|
matcher: /^(?:.+?[*_>~+])?\{.+?\}/,
|
|
@@ -150,7 +119,7 @@ const rules = {
|
|
|
150
119
|
},
|
|
151
120
|
variable: {
|
|
152
121
|
matcher: /^\$[\w-]+:/,
|
|
153
|
-
layer: Layer.
|
|
122
|
+
layer: Layer.Shorthand,
|
|
154
123
|
declare (value) {
|
|
155
124
|
return {
|
|
156
125
|
['--' + this.keyToken.slice(1, -1)]: value
|
|
@@ -785,6 +754,19 @@ const rules = {
|
|
|
785
754
|
],
|
|
786
755
|
layer: Layer.Native
|
|
787
756
|
},
|
|
757
|
+
'text-wrap': {
|
|
758
|
+
ambiguousKeys: [
|
|
759
|
+
'text',
|
|
760
|
+
't'
|
|
761
|
+
],
|
|
762
|
+
ambiguousValues: [
|
|
763
|
+
'wrap',
|
|
764
|
+
'nowrap',
|
|
765
|
+
'balance',
|
|
766
|
+
'pretty'
|
|
767
|
+
],
|
|
768
|
+
layer: Layer.NativeShorthand
|
|
769
|
+
},
|
|
788
770
|
'text-indent': {
|
|
789
771
|
unit: 'rem',
|
|
790
772
|
layer: Layer.Native
|
|
@@ -1578,31 +1560,31 @@ const rules = {
|
|
|
1578
1560
|
key: 'bt',
|
|
1579
1561
|
layer: Layer.NativeShorthand,
|
|
1580
1562
|
unit: 'rem',
|
|
1581
|
-
transformValueComponents:
|
|
1563
|
+
transformValueComponents: autofillSolidStyle
|
|
1582
1564
|
},
|
|
1583
1565
|
'border-bottom': {
|
|
1584
1566
|
key: 'bb',
|
|
1585
1567
|
layer: Layer.NativeShorthand,
|
|
1586
1568
|
unit: 'rem',
|
|
1587
|
-
transformValueComponents:
|
|
1569
|
+
transformValueComponents: autofillSolidStyle
|
|
1588
1570
|
},
|
|
1589
1571
|
'border-left': {
|
|
1590
1572
|
key: 'bl',
|
|
1591
1573
|
layer: Layer.NativeShorthand,
|
|
1592
1574
|
unit: 'rem',
|
|
1593
|
-
transformValueComponents:
|
|
1575
|
+
transformValueComponents: autofillSolidStyle
|
|
1594
1576
|
},
|
|
1595
1577
|
'border-right': {
|
|
1596
1578
|
key: 'br',
|
|
1597
1579
|
layer: Layer.NativeShorthand,
|
|
1598
1580
|
unit: 'rem',
|
|
1599
|
-
transformValueComponents:
|
|
1581
|
+
transformValueComponents: autofillSolidStyle
|
|
1600
1582
|
},
|
|
1601
1583
|
'border-x': {
|
|
1602
1584
|
key: 'bx',
|
|
1603
1585
|
unit: 'rem',
|
|
1604
1586
|
layer: Layer.Shorthand,
|
|
1605
|
-
transformValueComponents:
|
|
1587
|
+
transformValueComponents: autofillSolidStyle,
|
|
1606
1588
|
declare (value) {
|
|
1607
1589
|
return {
|
|
1608
1590
|
'border-left': value,
|
|
@@ -1614,7 +1596,7 @@ const rules = {
|
|
|
1614
1596
|
key: 'by',
|
|
1615
1597
|
unit: 'rem',
|
|
1616
1598
|
layer: Layer.Shorthand,
|
|
1617
|
-
transformValueComponents:
|
|
1599
|
+
transformValueComponents: autofillSolidStyle,
|
|
1618
1600
|
declare (value) {
|
|
1619
1601
|
return {
|
|
1620
1602
|
'border-top': value,
|
|
@@ -1626,7 +1608,7 @@ const rules = {
|
|
|
1626
1608
|
key: 'b',
|
|
1627
1609
|
unit: 'rem',
|
|
1628
1610
|
layer: Layer.NativeShorthand,
|
|
1629
|
-
transformValueComponents:
|
|
1611
|
+
transformValueComponents: autofillSolidStyle
|
|
1630
1612
|
},
|
|
1631
1613
|
'background-attachment': {
|
|
1632
1614
|
ambiguousKeys: [
|
|
@@ -2051,7 +2033,7 @@ const rules = {
|
|
|
2051
2033
|
'outline-offset',
|
|
2052
2034
|
'outline-color'
|
|
2053
2035
|
],
|
|
2054
|
-
transformValueComponents:
|
|
2036
|
+
transformValueComponents: autofillSolidStyle
|
|
2055
2037
|
},
|
|
2056
2038
|
'accent-color': {
|
|
2057
2039
|
key: 'accent',
|
|
@@ -2295,4 +2277,4 @@ const rules = {
|
|
|
2295
2277
|
}
|
|
2296
2278
|
};
|
|
2297
2279
|
|
|
2298
|
-
export {
|
|
2280
|
+
export { rules as default };
|
|
@@ -158,6 +158,18 @@ const utilities = {
|
|
|
158
158
|
width: '100%',
|
|
159
159
|
height: '100%'
|
|
160
160
|
},
|
|
161
|
+
top: {
|
|
162
|
+
top: 0
|
|
163
|
+
},
|
|
164
|
+
left: {
|
|
165
|
+
left: 0
|
|
166
|
+
},
|
|
167
|
+
right: {
|
|
168
|
+
right: 0
|
|
169
|
+
},
|
|
170
|
+
bottom: {
|
|
171
|
+
bottom: 0
|
|
172
|
+
},
|
|
161
173
|
center: {
|
|
162
174
|
left: 0,
|
|
163
175
|
right: 0,
|
|
@@ -156,6 +156,18 @@ declare const utilities: {
|
|
|
156
156
|
readonly width: "100%";
|
|
157
157
|
readonly height: "100%";
|
|
158
158
|
};
|
|
159
|
+
readonly top: {
|
|
160
|
+
readonly top: 0;
|
|
161
|
+
};
|
|
162
|
+
readonly left: {
|
|
163
|
+
readonly left: 0;
|
|
164
|
+
};
|
|
165
|
+
readonly right: {
|
|
166
|
+
readonly right: 0;
|
|
167
|
+
};
|
|
168
|
+
readonly bottom: {
|
|
169
|
+
readonly bottom: 0;
|
|
170
|
+
};
|
|
159
171
|
readonly center: {
|
|
160
172
|
readonly left: 0;
|
|
161
173
|
readonly right: 0;
|
|
@@ -156,6 +156,18 @@ const utilities = {
|
|
|
156
156
|
width: '100%',
|
|
157
157
|
height: '100%'
|
|
158
158
|
},
|
|
159
|
+
top: {
|
|
160
|
+
top: 0
|
|
161
|
+
},
|
|
162
|
+
left: {
|
|
163
|
+
left: 0
|
|
164
|
+
},
|
|
165
|
+
right: {
|
|
166
|
+
right: 0
|
|
167
|
+
},
|
|
168
|
+
bottom: {
|
|
169
|
+
bottom: 0
|
|
170
|
+
},
|
|
159
171
|
center: {
|
|
160
172
|
left: 0,
|
|
161
173
|
right: 0,
|
package/dist/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ exports.Rule = rule.Rule;
|
|
|
32
32
|
exports.ANIMATION_SIGN = common.ANIMATION_SIGN;
|
|
33
33
|
exports.AT_SIGN = common.AT_SIGN;
|
|
34
34
|
exports.BASE_UNIT_REGEX = common.BASE_UNIT_REGEX;
|
|
35
|
+
exports.BORDER_STYLE_VALUES = common.BORDER_STYLE_VALUES;
|
|
35
36
|
exports.CLASS_ATTRIBUTES = common.CLASS_ATTRIBUTES;
|
|
36
37
|
exports.CLASS_DECLARATIONS = common.CLASS_DECLARATIONS;
|
|
37
38
|
exports.CLASS_FUNCTIONS = common.CLASS_FUNCTIONS;
|
|
@@ -69,4 +70,4 @@ exports.functions = functions;
|
|
|
69
70
|
exports.animations = animations;
|
|
70
71
|
exports.variables = variables;
|
|
71
72
|
exports.modes = modes;
|
|
72
|
-
exports.rules = rules
|
|
73
|
+
exports.rules = rules;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { config } from './config/index.mjs';
|
|
2
2
|
export { Rule } from './rule.mjs';
|
|
3
|
-
export { ANIMATION_SIGN, AT_SIGN, BASE_UNIT_REGEX, CLASS_ATTRIBUTES, CLASS_DECLARATIONS, CLASS_FUNCTIONS, COLOR_VALUE_REGEX, DELIMITER_SIGN, IMAGE_VALUE_REGEX, NUMBER_VALUE_REGEX, OFFICIAL_URL, QUERY_COMPARISON_OPERATORS, QUERY_LOGICAL_OPERATORS, SELECTOR_SIGNS, SEPARATOR_SIGN, SEPARATOR_SIGNS, TRANSITION_SIGN, UNIT_REGEX, VALUE_DELIMITERS, VALUE_UNITS } from './common.mjs';
|
|
3
|
+
export { ANIMATION_SIGN, AT_SIGN, BASE_UNIT_REGEX, BORDER_STYLE_VALUES, CLASS_ATTRIBUTES, CLASS_DECLARATIONS, CLASS_FUNCTIONS, COLOR_VALUE_REGEX, DELIMITER_SIGN, IMAGE_VALUE_REGEX, NUMBER_VALUE_REGEX, OFFICIAL_URL, QUERY_COMPARISON_OPERATORS, QUERY_LOGICAL_OPERATORS, SELECTOR_SIGNS, SEPARATOR_SIGN, SEPARATOR_SIGNS, TRANSITION_SIGN, UNIT_REGEX, VALUE_DELIMITERS, VALUE_UNITS } from './common.mjs';
|
|
4
4
|
export { default as MasterCSS, default, masterCSSs } from './core.mjs';
|
|
5
5
|
export { default as Layer } from './layer.mjs';
|
|
6
6
|
export { default as extendConfig } from './utils/extend-config.mjs';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var common = require('../common.cjs');
|
|
4
|
+
|
|
5
|
+
const autofillSolidStyle = function(valueComponents) {
|
|
6
|
+
if (valueComponents.length < 2) return valueComponents;
|
|
7
|
+
let styleIncluded = false;
|
|
8
|
+
let varIncluded = false;
|
|
9
|
+
for (const valueComponent of valueComponents){
|
|
10
|
+
if (valueComponent.type === 'string' && common.BORDER_STYLE_VALUES.includes(valueComponent.value) || valueComponent.type === 'variable' && common.BORDER_STYLE_VALUES.includes(String(valueComponent.variable?.value))) {
|
|
11
|
+
styleIncluded = true;
|
|
12
|
+
}
|
|
13
|
+
if (valueComponent.type === 'function' && valueComponent.name === 'var') {
|
|
14
|
+
varIncluded = true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (!styleIncluded && !varIncluded) {
|
|
18
|
+
valueComponents.push({
|
|
19
|
+
type: 'separator',
|
|
20
|
+
value: ' ',
|
|
21
|
+
token: '|'
|
|
22
|
+
}, {
|
|
23
|
+
type: 'string',
|
|
24
|
+
value: 'solid',
|
|
25
|
+
token: 'solid'
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return valueComponents;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
module.exports = autofillSolidStyle;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BORDER_STYLE_VALUES } from '../common.mjs';
|
|
2
|
+
|
|
3
|
+
const autofillSolidStyle = function(valueComponents) {
|
|
4
|
+
if (valueComponents.length < 2) return valueComponents;
|
|
5
|
+
let styleIncluded = false;
|
|
6
|
+
let varIncluded = false;
|
|
7
|
+
for (const valueComponent of valueComponents){
|
|
8
|
+
if (valueComponent.type === 'string' && BORDER_STYLE_VALUES.includes(valueComponent.value) || valueComponent.type === 'variable' && BORDER_STYLE_VALUES.includes(String(valueComponent.variable?.value))) {
|
|
9
|
+
styleIncluded = true;
|
|
10
|
+
}
|
|
11
|
+
if (valueComponent.type === 'function' && valueComponent.name === 'var') {
|
|
12
|
+
varIncluded = true;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (!styleIncluded && !varIncluded) {
|
|
16
|
+
valueComponents.push({
|
|
17
|
+
type: 'separator',
|
|
18
|
+
value: ' ',
|
|
19
|
+
token: '|'
|
|
20
|
+
}, {
|
|
21
|
+
type: 'string',
|
|
22
|
+
value: 'solid',
|
|
23
|
+
token: 'solid'
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return valueComponents;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { autofillSolidStyle as default };
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@master/css","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","test":"jest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"The CSS language and framework for rapidly building modern and high-performance websites","author":"Aoyue Design LLC.","funding":"https://css.master.co/docs/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/core"},"keywords":["style","styles","html","variants","virtual","virtual-css","utility","css","ui","lightweight","class","webpack","plugin","integration","vite","parcel","build-tools","mastercss"],"sideEffects":false,"main":"./dist/index.cjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"bin":"./dist/bin/index.mjs","files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/colors":"^2.0.0","@master/normal.css":"^
|
|
1
|
+
{"name":"@master/css","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","test":"jest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"The CSS language and framework for rapidly building modern and high-performance websites","author":"Aoyue Design LLC.","funding":"https://css.master.co/docs/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/core"},"keywords":["style","styles","html","variants","virtual","virtual-css","utility","css","ui","lightweight","class","webpack","plugin","integration","vite","parcel","build-tools","mastercss"],"sideEffects":false,"main":"./dist/index.cjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"bin":"./dist/bin/index.mjs","files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/colors":"^2.0.0","@master/normal.css":"^3.0.0","@techor/extend":"^3.0.22","csstype":"^3.1.3"},"devDependencies":{"@master/css-shared":"^2.0.0-rc.36"},"version":"2.0.0-rc.36"}
|