aliascss 1.1.12 → 1.1.13

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.
@@ -967,7 +967,7 @@ const cssProps = {
967
967
  values: ['content:c', 'fixed:f'],
968
968
  },
969
969
  'filter': {
970
- alias: '',
970
+ alias: 'fl',
971
971
  type: 'd',
972
972
  compiler: filter,
973
973
  values: ['none:n', 'invert():invert:i', 'sepia():sepia:se', 'grayscale():grayscale:gs'],
@@ -2656,5 +2656,20 @@ const cssProps = {
2656
2656
  // compiler:'',
2657
2657
  values: ['arcs', 'bevel', 'iter', 'miter-clip', 'round'],
2658
2658
  },
2659
+ // -------------webkit---
2660
+ 'webkit-line-cramp': {
2661
+ alias: '',
2662
+ property: '-webkit-line-clamp',
2663
+ type: 'd',
2664
+ compiler: (value) => value.replace(/^-/, ''),
2665
+ values: ['none:n'],
2666
+ },
2667
+ 'webkit-box-orient': {
2668
+ alias: '',
2669
+ property: '-webkit-box-orient',
2670
+ type: 's',
2671
+ // compiler:(value:string)=>value.replace(/^-/,''),
2672
+ values: ['horizontal:h', 'vertical:v', 'inline-axis:ia', 'block-axis:ba'],
2673
+ }
2659
2674
  };
2660
2675
  export default cssProps;
@@ -17,6 +17,8 @@ const media = {
17
17
  '-xl': '@media (max-width : 1200px)',
18
18
  '-xxl': '@media (max-width : 1408px)',
19
19
  '-2xl': '@media (max-width : 1408px)',
20
+ 'dark': '@media (prefers-color-scheme: dark)',
21
+ 'light': '@media (prefers-color-scheme: light)'
20
22
  },
21
23
  };
22
24
  export function createRegexForMedia(prefix) {
@@ -4,6 +4,19 @@ bool = false) {
4
4
  if (staticClassNames.hasOwnProperty(className)) {
5
5
  return staticClassNames[className];
6
6
  }
7
+ // case CSS define var
8
+ if (className.startsWith('--') && className.includes(':')) {
9
+ const value = className.slice(className.indexOf(':')).replace(':', '');
10
+ const property = className.replace(value, '').replace(':', '');
11
+ if (/^--[a-zA-Z]/.test(value)) {
12
+ return bool ? [property, "var(" + value + ')'] : property + ": var(" + value + ')';
13
+ }
14
+ else {
15
+ return bool ? [property, value.replace(/[-]([-]?[\w])/g, ' $1').replace(/([\d])d([\d])/g, '$1.$2').replace(/([\d])p[\s]/g, "$1% ").replace(/([\d])p$/, "$1%").replace(/[\s]by[\s]/g, ' / ').replace(/auto flow/g, 'auto-flow')]
16
+ :
17
+ property + ":" + value.replace(/[-]([-]?[\w])/g, ' $1').replace(/([\d])d([\d])/g, '$1.$2').replace(/([\d])p[\s]/g, "$1% ").replace(/([\d])p$/, "$1%").replace(/[\s]by[\s]/g, ' / ').replace(/auto flow/g, 'auto-flow');
18
+ }
19
+ }
7
20
  const [property, propertyKey] = extractProperty(className, cssPropertiesWithAlias);
8
21
  // console.log(propertyKey,'ttt',property,className)
9
22
  if (property) {
@@ -77,7 +77,7 @@ export const compiler = {
77
77
  workingClassName = prefixPseudoElementAttribute[1];
78
78
  elementAndPseudo = prefixPseudoElementAttribute[0];
79
79
  // ---------------------------------------------------------------------
80
- const pnv = workingClassName.replace(/^-/, '');
80
+ const pnv = workingClassName.replace(/^-([a-zA-Z])/, '$1');
81
81
  let result = '';
82
82
  // x-class
83
83
  if (/^(x-width|x-height)/.test(pnv)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aliascss",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "AliasCSS is a CSS post processor.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",