aliascss 1.1.19 → 1.1.20

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.
@@ -46,13 +46,13 @@ const prefix = {
46
46
  '-fln': '::first-line', // -fln
47
47
  '--first-of-type': ':first-of-type', // -fot
48
48
  '-fot': ':first-of-type',
49
- '--focus': ':focus', // -fo
50
- '-fo': ':focus', // -fo
51
- '-f': ':focus', // -fo
52
49
  '--focus-within': ':focus-within', // -fo
53
50
  '-fw': ':focus-within', // -fo
54
51
  '--focus-visible': ':focus-visible', // -fo
55
52
  '-fv': ':focus-visible', // -fo
53
+ '--focus': ':focus', // -fo
54
+ '-fo': ':focus', // -fo
55
+ '-f': ':focus', // -fo
56
56
  '--fullscreen': ':fullscreen',
57
57
  '-fs': ':fullscreen',
58
58
  '--has': ':has', // --has
@@ -46,13 +46,13 @@ const prefix = {
46
46
  '--fln': '::first-line', // -fln
47
47
  '--first-of-type': ':first-of-type', // -fot
48
48
  '--fot': ':first-of-type',
49
- '--focus': ':focus', // -fo
50
- '--fo': ':focus', // -fo
51
- '--f': ':focus', // -fo
52
49
  '--focus-within': ':focus-within', // -fo
53
50
  '--fw': ':focus-within', // -fo
54
51
  '--focus-visible': ':focus-visible', // -fo
55
52
  '--fv': ':focus-visible', // -fo
53
+ '--focus': ':focus', // -fo
54
+ '--fo': ':focus', // -fo
55
+ '--f': ':focus', // -fo
56
56
  '--fullscreen': ':fullscreen',
57
57
  '--fs': ':fullscreen',
58
58
  '--has': ':has', // --has
@@ -8,6 +8,15 @@ type Property = {
8
8
  };
9
9
  compiler?: (...args: any[]) => any;
10
10
  };
11
+ /**
12
+ * @param className : string
13
+ * @param cssPropertiesWithAlias: Compiler Object
14
+ * @param staticClassNames : StaticClassNames
15
+ * @param custom : custom values for color, font, etc
16
+ * @param extractProperty :extractProperty(className:string,cssPropertiesWithAlias:{[key:string]:Property})=>[Property,string]
17
+ * @param bool : return[property,value] or property:value
18
+ * @returns {string[]|null|{}}
19
+ */
11
20
  export default function getPropertyAndValue(className: string, cssPropertiesWithAlias: {
12
21
  [key: string]: Property;
13
22
  }, staticClassNames: {
@@ -1,3 +1,12 @@
1
+ /**
2
+ * @param className : string
3
+ * @param cssPropertiesWithAlias: Compiler Object
4
+ * @param staticClassNames : StaticClassNames
5
+ * @param custom : custom values for color, font, etc
6
+ * @param extractProperty :extractProperty(className:string,cssPropertiesWithAlias:{[key:string]:Property})=>[Property,string]
7
+ * @param bool : return[property,value] or property:value
8
+ * @returns {string[]|null|{}}
9
+ */
1
10
  export default function getPropertyAndValue(className, cssPropertiesWithAlias, staticClassNames, custom, extractProperty, // (a:string,b:{[key:string]:Property})=>[Property,string],
2
11
  bool = false) {
3
12
  // Case 1 StaticClassNames
@@ -44,6 +44,13 @@ export const compiler = {
44
44
  },
45
45
  // className as another-name, bool->only return property and value
46
46
  make(className, as, bool) {
47
+ var _a;
48
+ if (/--as-[a-zA-Z0-9-_]+$/.test(className)) {
49
+ const asMatch = (_a = className.match(/--as-([a-zA-Z0-9-_]+)$/)) !== null && _a !== void 0 ? _a : [null, null];
50
+ if (asMatch[0] && asMatch[1]) {
51
+ return this.group(className.replace(asMatch[0], ''), asMatch[1]);
52
+ }
53
+ }
47
54
  let unPrefixedClassName = className;
48
55
  // check for [group-acss,]
49
56
  const matchGroupCSS = className.match(/\[([^[]*)\]$/);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aliascss",
3
- "version": "1.1.19",
3
+ "version": "1.1.20",
4
4
  "description": "AliasCSS is a CSS post processor.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",