aliascss 1.1.9 → 1.1.11

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.
@@ -1,6 +1,6 @@
1
1
  export default function length(data) {
2
2
  return data.replace(/[-]?fit-content-([-]?\w+)/g, ' fit-content( $1 )')
3
- .replace(/[-]([-]?[0-9])/g, ' $1').replace(/([\d])d([\d])/, '$1.$2').replace(/-auto/g, ' auto')
3
+ .replace(/[-]([-]?[0-9])/g, ' $1').replace(/([\d])d([\d])/g, '$1.$2').replace(/-auto/g, ' auto')
4
4
  .replace(/([\d])p[\s]/g, "$1% ").replace(/([\d])p$/, "$1%").replace(/-(f|m)/g, '$1');
5
5
  }
6
6
  export const lenByNumPer = (value) => 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');
@@ -2600,8 +2600,20 @@ const cssProps = {
2600
2600
  alias: '',
2601
2601
  type: 'd',
2602
2602
  compiler: color,
2603
+ values: ['none:n', 'context-fill:cf', 'context-stroke:cs'],
2604
+ },
2605
+ 'fill-opacity': {
2606
+ alias: 'fo',
2607
+ type: 'd',
2608
+ compiler: (value) => value.replace(/^-/, '').replace(/(\d)d(\d)/, '$1.$2').replace(/([\d])p$/, '$1%'),
2603
2609
  values: [],
2604
2610
  },
2611
+ 'fill-rule': {
2612
+ alias: 'fr',
2613
+ type: 'd',
2614
+ // compiler:'',
2615
+ values: ['nonzero:nz', 'evenodd:eo'],
2616
+ },
2605
2617
  'stroke-dasharray': {
2606
2618
  alias: 'sda',
2607
2619
  type: 'd',
@@ -6,6 +6,8 @@ export declare function globalCSSCompiler(): void;
6
6
  export declare function compileFile(file: string, config: any, statementMaker: {
7
7
  ['make']: (a: string) => string;
8
8
  group: (a: string, b: string) => string;
9
+ ['rawCSS']?: string;
10
+ ['customGroupStatement']?: string;
9
11
  }, globalClassList: string[]): string[];
10
12
  export declare function groupStatement(name: string, classNames: string, statementMaker: {
11
13
  ['group']: (a: string, b: string) => string;
@@ -15,7 +17,7 @@ export declare function keyframesStatement(name: string, timeLine: string, state
15
17
  }): string;
16
18
  export declare function createCSSFileByFile(file: string, bool?: boolean): void;
17
19
  export declare function postify(file: string, plugin: any[], minify?: boolean): void;
18
- export declare function writeStatementToFile(file: string, content: string): void;
20
+ export declare function writeStatementToFile(file: string, content: string, from?: string): void;
19
21
  export declare function initialize(configFile: {
20
22
  [key: string]: any;
21
23
  }): void;
@@ -66,6 +66,15 @@ export function globalCSSCompiler() {
66
66
  }
67
67
  export function compileFile(file, config, statementMaker, globalClassList) {
68
68
  let [globalStatement, compiledStatement, moduleStatement] = ['', '', ''];
69
+ // inject config.group and config.statement
70
+ if (statementMaker.rawCSS) {
71
+ compiledStatement += `/* From:aliacss.config.statement */\n${statementMaker.rawCSS}\n/* -----End:aliacss.config.statement----- */\n\n`;
72
+ moduleStatement += `/* From:aliacss.config.statement */\n${statementMaker.rawCSS}\n/* ------End:aliacss.config.statement----- */\n\n`;
73
+ }
74
+ if (statementMaker.customGroupStatement) {
75
+ compiledStatement += `/* From:aliacss.config.group */\n${statementMaker.customGroupStatement}\n/* -----End:aliacss.config.group----- */\n\n`;
76
+ moduleStatement += `/* From:aliacss.config.group */\n${statementMaker.customGroupStatement}\n/* -----End:aliacss.config.group----- */\n\n`;
77
+ }
69
78
  const [classList, groups, keyframe] = extractClassNamesFromFile(file, config);
70
79
  // 2. group
71
80
  for (const key in groups) {
@@ -184,12 +193,12 @@ export function postify(file, plugin, minify = false) {
184
193
  // })
185
194
  // })
186
195
  }
187
- export function writeStatementToFile(file, content) {
196
+ export function writeStatementToFile(file, content, from) {
188
197
  // Check for Global
189
198
  if (init.output) {
190
199
  try {
191
- fs.writeFileSync(init.output, `\n/* Start :-----------ACSS:From aliasCSSConfig.statement------------------------*/\n${content}
192
- \n/* End :-----------ACSS aliasCSSConfig.statement----------------------------*/\n
200
+ fs.writeFileSync(init.output, `\n/* Start :-----------ACSS:From aliasCSSConfig.${from}------------------------*/\n${content}
201
+ \n/* End :-----------ACSS aliasCSSConfig.${from}----------------------------*/\n
193
202
  `, { flag: 'a+' });
194
203
  console.log('AliasCSS compiled', '[aliasCSSConfig.statement]', 'aliascss.config.js');
195
204
  }
@@ -266,13 +275,15 @@ export function initialize(configFile) {
266
275
  // Custom CSS statement
267
276
  if (configFile.hasOwnProperty('statement')) {
268
277
  init.rawCSS = configFile.statement;
269
- writeStatementToFile(init.output, configFile.statement);
278
+ init.statementMaker.rawCSS = configFile.statement;
279
+ writeStatementToFile(init.output, configFile.statement, 'config.statement');
270
280
  }
271
281
  // Custom Groups bundling acss classnames in single class name
272
282
  if (configFile.hasOwnProperty('group')) {
273
283
  init.customGroupStatement = init.statementMaker.groupObj(configFile.group);
284
+ init.statementMaker.customGroupStatement = init.statementMaker.groupObj(configFile.group);
274
285
  if (init.customGroupStatement)
275
- writeStatementToFile(init.output, init.customGroupStatement);
286
+ writeStatementToFile(init.output, init.customGroupStatement, 'config.group');
276
287
  }
277
288
  // Adding Custom color, length etc
278
289
  if (configFile.hasOwnProperty('custom') && typeof configFile.custom === 'object') {
@@ -0,0 +1,7 @@
1
+ export declare function createRegexForPseudo(prefix: {
2
+ [key: string]: string;
3
+ }): RegExp;
4
+ declare const prefix: {
5
+ [key: string]: string;
6
+ };
7
+ export default prefix;
@@ -0,0 +1,145 @@
1
+ export function createRegexForPseudo(prefix) {
2
+ const prefixAlias = Object.keys(prefix).reduce((previous, current) => previous + "|" + current);
3
+ return new RegExp("^(" + prefixAlias + ")(?=[-(|_])");
4
+ }
5
+ const prefix = {
6
+ '--active': ':active', // -a
7
+ '--a': ':active',
8
+ '--ac': ':active',
9
+ '--after-hover': '::after:hover',
10
+ '--afh': '::after:hover',
11
+ '--after': '::after', // -af
12
+ '--af': '::after', // -af
13
+ '--autofill': ':-webkit-autofill',
14
+ '--atf': ':-webkit-autofill',
15
+ '--any-link': ':any-link',
16
+ '--al': ':any-link',
17
+ '--backdrop': '::backdrop',
18
+ '--bd': '::backdrop',
19
+ '--blank': ':blank',
20
+ '--bl': ':blank',
21
+ '--before-hover': '::before:hover', // -bfh
22
+ '--bfh': '::before:hover', // -bfh
23
+ '--before': '::before', // -bf
24
+ '--bf': '::before', // -bf
25
+ '--checked': ':checked', // -ck
26
+ '--ch': ':checked', // -ck
27
+ '--current': ':current', // -ck
28
+ '--cur': ':current',
29
+ '--cue': '::cue',
30
+ '--cu': '::cue',
31
+ '--default': ':default', // -df
32
+ '--de': ':default', // -df
33
+ '--disabled': ':disabled', // -ds
34
+ '--di': ':disabled', // -ds
35
+ '--empty': ':empty', // -em
36
+ '--em': ':empty', // -em
37
+ '--enabled': ':enabled', // -en
38
+ '--en': ':enabled', // -en
39
+ '--file-selector-button': '::file-selector-button',
40
+ '--fsb': '::file-selector-button',
41
+ '--first-child': ':first-child', // -fc
42
+ '--fc': ':first-child',
43
+ '--first-letter': '::first-letter', // -f
44
+ '--fl': '::first-letter', // -fl
45
+ '--first-line': '::first-line', // -fln
46
+ '--fln': '::first-line', // -fln
47
+ '--first-of-type': ':first-of-type', // -fot
48
+ '--fot': ':first-of-type',
49
+ '--focus': ':focus', // -fo
50
+ '--fo': ':focus', // -fo
51
+ '--f': ':focus', // -fo
52
+ '--focus-within': ':focus-within', // -fo
53
+ '--fw': ':focus-within', // -fo
54
+ '--focus-visible': ':focus-visible', // -fo
55
+ '--fv': ':focus-visible', // -fo
56
+ '--fullscreen': ':fullscreen',
57
+ '--fs': ':fullscreen',
58
+ '--has': ':has', // --has
59
+ '--hs': ':has', // -hs
60
+ '--hover-after': ':hover::after', // -haf
61
+ '--haf': ':hover::after', // -haf
62
+ '--hover-before': ':hover::before', // -hbf
63
+ '--hbf': ':hover::before', // -hbf
64
+ '--hover-target': ':hover:target', // -htg
65
+ '--htg': ':hover:target', // -htg
66
+ '--hover': ':hover', // -h
67
+ '--h': ':hover', // -h
68
+ '--ho': ':hover', // -h
69
+ '--in-range': ':in-range', // -ir
70
+ '--ir': ':in-range', // -ir
71
+ '--indeterminate': ':indeterminate', // idt
72
+ '--ind': ':indeterminate', // idt
73
+ '--invalid': ':invalid', // -in
74
+ '--inv': ':invalid', // -in
75
+ '--is': ':is',
76
+ // '--is':':is',
77
+ '--lang': ':lang', // -ln
78
+ '--lan': ':lan', // -ln
79
+ '--last-child': ':last-child', // -lc
80
+ '--lc': ':last-child', // -lc
81
+ '--last-of-type': ':last-of-type', // -lot
82
+ '--lot': ':last-of-type', // -lot
83
+ '--link': ':link', // -l
84
+ '--ln': ':link', // -l
85
+ '--l': ':link', // -l
86
+ '--marker': '::marker',
87
+ '--m': '::marker',
88
+ '--not': ':not', // -n-
89
+ '--n': ':not', // -n-
90
+ '--nth-child': ':nth-child', // -nc2n
91
+ '--nc': ':nth-child', // -nc2n
92
+ '--nth-last-child': ':nth-last-child', // -nlc2n
93
+ '--nlc': ':nth-last-child', // -nlc2n
94
+ '--nth-last-of-type': ':nth-last-of-type', // -nlot2n
95
+ '--nlot': ':nth-last-of-type', // -nlot2n
96
+ '--nth-of-type': ':nth-of-type', // -not
97
+ '--nthot': ':nth-of-type', // -not
98
+ '--only-of-type': ':only-of-type', // -oot
99
+ '--oot': ':only-of-type', // -oot
100
+ '--only-child': ':only-child', // -oc
101
+ '--oc': ':only-child', // -oc
102
+ '--optional': ':optional', // -o
103
+ '--op': ':optional', // -o
104
+ '--out-of-range': ':out-of-range', // -oor
105
+ '--oor': ':out-of-range', // -oor
106
+ '--placeholder': '::placeholder', // -ph
107
+ '--ph': '::placeholder', // -ph
108
+ '--placeholder-shown': ':placeholder-shown', // -phs
109
+ '--phs': ':placeholder-shown', // -phs
110
+ '--popover-open': ':popover-open',
111
+ '--po': ':popover-open',
112
+ '--read-only': ':read-only', // -ro
113
+ '--ro': ':read-only', // -ro
114
+ '--read-write': ':read-write', // -rw
115
+ '--rw': ':read-write', // -rw
116
+ '--required': ':required', // -rq
117
+ '--rq': ':required', // -rq
118
+ '--root': ':root', // -rt
119
+ '--rt': ':root', // -rt
120
+ '--selection': '::selection', // -sl
121
+ '--s': '::selection', // -sl
122
+ '--spelling-error': '::spelling-error',
123
+ '--se': '::spelling-error',
124
+ '--scrollbar': '::-webkit-scrollbar',
125
+ '--webkit-scrollbar': '::-webkit-scrollbar',
126
+ '--sb': '::-webkit-scrollbar',
127
+ '--scrollbar-track': '::-webkit-scrollbar-track',
128
+ '--webkit-scrollbar-track': '::-webkit-scrollbar-track',
129
+ '--st': '::-webkit-scrollbar-track',
130
+ '--scrollbar-thumb': '::-webkit-scrollbar-thumb',
131
+ '--web-kit-scrollbar-thumb': '::-webkit-scrollbar-thumb',
132
+ '--stm': '::-webkit-scrollbar-thumb',
133
+ '--target': ':target', // -tg
134
+ '--tg': ':target', // -tg
135
+ '--user-invalid': ':user-invalid',
136
+ '--ui': ':user-invalid',
137
+ '--valid': ':valid', // -vl
138
+ '--va': ':valid', // -vl
139
+ '--visited': ':visited', // -vi
140
+ '--vi': ':visited', // -vi
141
+ '--v': ':visited', // -vi
142
+ '--where': ':where',
143
+ '--w': ':where'
144
+ };
145
+ export default prefix;
@@ -1,4 +1,4 @@
1
- import prefix, { createRegexForPseudo } from './PseudoPrefix.js';
1
+ import prefix, { createRegexForPseudo } from './PseudoPrefixNew.js';
2
2
  import extractPrefix from './extractPrefix.js';
3
3
  export default function PseudoEleStateNew(data) {
4
4
  var _a;
@@ -42,15 +42,16 @@ export default function PseudoEleStateNew(data) {
42
42
  return [cn, `${alias}(${cont})`];
43
43
  // return pseudoHandlerNthChild(data,/(^--nth(-child-|-last-child-|-last-of-type|-of-type-))([0-9]+[n]?)(?=[-|_])/)
44
44
  }
45
- else if (/^(-(nc|nlc|nlot|not)-)([a-z0-9]+)(?=[-|_])/.test(data)) {
46
- const mch = data.match(/^(-(n|nc|nlc|nlot|not)-)([a-z0-9]+)(?=[-|_])/);
45
+ else if (/^(--(nc|nlc|nlot|nthot)-)([a-z0-9]+)(?=[-|_])/.test(data)) {
46
+ const mch = data.match(/^(--(n|nc|nlc|nlot|not)-)([a-z0-9]+)(?=[-|_])/);
47
47
  const cn = (mch === null || mch === void 0 ? void 0 : mch[0]) ? data.replace(mch[0], '') : '';
48
48
  const alias = (mch === null || mch === void 0 ? void 0 : mch[1]) ? prefix[mch[1].replace(/-$/, '')] : '';
49
49
  const cont = mch === null || mch === void 0 ? void 0 : mch[3];
50
+ console.log(data, cn, alias, mch);
50
51
  return [cn, `${alias}(${cont})`];
51
52
  }
52
- else if (/(^-(-not|-has|-is|-where|n|hs|w|is)[-_])/.test(data)) {
53
- const mch = data.match(/(^-(-not|-has|-is|-where|n|hs|w|is)([_-]+[a-zA-Z0-9\.]+)(?=[-|_]))/);
53
+ else if (/(^-(-not|-has|-is|-where|-n|-hs|-w|-is)[-_])/.test(data)) {
54
+ const mch = data.match(/(^-(-not|-has|-is|-where|-n|-hs|-w|-is)([_-]+[a-zA-Z0-9\.]+)(?=[-|_]))/);
54
55
  const cn = (mch === null || mch === void 0 ? void 0 : mch[1]) ? data.replace(mch[1], '') : '';
55
56
  const alias = (mch === null || mch === void 0 ? void 0 : mch[2]) ? prefix['-' + mch[2].replace(/-$/, '')] : '';
56
57
  const cont = (_a = PseudoEleStateNew((mch === null || mch === void 0 ? void 0 : mch[3]) + '-dn')) === null || _a === void 0 ? void 0 : _a[1];
@@ -8,6 +8,7 @@ import { createCompilerObj, extractProperty } from "./utils/createCompilerObj.js
8
8
  import config from "./config.js";
9
9
  import cssProps from "./css-properties-all.js";
10
10
  import { staticClassNamesAlias } from "./static/staticClassNamesAlias.js";
11
+ import postcss from "postcss";
11
12
  const [staticClassNamesWithAlias, cssPropsWithAlias] = createCompilerObj(cssProps, config.globalValues);
12
13
  export const compiler = {
13
14
  // cache will cache propertyAndValue
@@ -18,6 +19,8 @@ export const compiler = {
18
19
  staticClassNames: Object.assign(Object.assign({}, staticClassNamesAlias), staticClassNamesWithAlias),
19
20
  cssProps: Object.assign({}, cssPropsWithAlias),
20
21
  prefix: null,
22
+ rawCSS: null,
23
+ customGroupStatement: null,
21
24
  extend(data) {
22
25
  Object.keys(data).forEach((key) => {
23
26
  if (data[key].hasOwnProperty('extend')) {
@@ -97,16 +100,39 @@ export const compiler = {
97
100
  console.log(error);
98
101
  }
99
102
  }
103
+ // if(result){
104
+ // className=className.replace(/([$.&%=\]\[@~:*#+\(\)\/^])/g,'\\$1');
105
+ // if(bool===true) return result;
106
+ // this.cache.propertyAndValue[pnv]=result;
107
+ // if(media){
108
+ // return `${media}{${
109
+ // beforeClassNameSelector+'.'+(as?as:className)+ elementAndPseudo
110
+ // }{${result}${important}}}`;
111
+ // }else{
112
+ // return `${beforeClassNameSelector}.${(as?as:className)}${elementAndPseudo}{${result}${important}}`;
113
+ // }
114
+ // }else{
115
+ // console.log(`Unable to process ${className} [media:${media},pseudoSelector:${elementAndPseudo},imp:${important}]`)
116
+ // }
117
+ // ------------PostCSSParse
100
118
  if (result) {
119
+ let stm = '';
101
120
  className = className.replace(/([$.&%=\]\[@~:*#+\(\)\/^])/g, '\\$1');
102
121
  if (bool === true)
103
122
  return result;
104
123
  this.cache.propertyAndValue[pnv] = result;
105
124
  if (media) {
106
- return `${media}{${beforeClassNameSelector + '.' + (as ? as : className) + elementAndPseudo}{${result}${important}}}`;
125
+ stm = `${media}{${beforeClassNameSelector + '.' + (as ? as : className) + elementAndPseudo}{${result}${important}}}`;
107
126
  }
108
127
  else {
109
- return `${beforeClassNameSelector}.${(as ? as : className)}${elementAndPseudo}{${result}${important}}`;
128
+ stm = `${beforeClassNameSelector}.${(as ? as : className)}${elementAndPseudo}{${result}${important}}`;
129
+ }
130
+ try {
131
+ postcss.parse(stm);
132
+ return stm;
133
+ }
134
+ catch (error) {
135
+ console.log('Not a Valid CSS Statement, PostCSS Parse:', stm);
110
136
  }
111
137
  }
112
138
  else {
@@ -0,0 +1,149 @@
1
+ import {getCompiler} from './lib/index.js'
2
+ export const compilers={
3
+ 'import-var':{
4
+ type:'group',
5
+ groups:{
6
+ 'spacing':`
7
+ --space-1:4px;
8
+ --space-2:8px;
9
+ --space-3:12px;
10
+ --space-4:16px;
11
+ --space-5:24px;
12
+ --space-6:32px;
13
+ --space-7:40px;
14
+ --space-8:48px;
15
+ --space-9:64px;
16
+ `,
17
+ theme:`
18
+
19
+ `
20
+ },
21
+
22
+ },
23
+ 'Text':{
24
+
25
+ compiler:(value)=>{
26
+ let result='';
27
+ const match=/-([-]?[\w\.]+)/;
28
+ const property=['font-size','line-height','letter-spacing','font-weight'];
29
+ value.match(new RegExp(match,'g')).forEach((e,i)=>{
30
+ if(i<property.length){
31
+ result+=`${property[i]}:${e.replace(match,'$1').replace(/(\d)d(\d)/,'$1.$2').replace(/([\d])p([\s]|$)/,'$1%$2')};`;
32
+ }
33
+
34
+ })
35
+ return result;
36
+
37
+ },
38
+ groups:{
39
+ xs:'font-size:12px;line-height:18px;letter-spacing:0.0025em',
40
+ '1':'font-size:12px;letter-spacing:0.0025em;line-height:16px;',
41
+ '2':'font-size:14px;letter-spacing:0em;line-height:20px;',
42
+ '3':'font-size:16px;letter-spacing:0em;line-height:24px;',
43
+ '4':'font-size:18px;letter-spacing:-0.0025em;line-height:26px;',
44
+ '5':'font-size:20px;letter-spacing:-0.005em;line-height:28px;',
45
+ '6':'font-size:24px;letter-spacing:-0.00625em;line-height:30px;',
46
+ '7':'font-size:28px;letter-spacing:-0.0075em;line-height:36px;',
47
+ '8':'font-size:35px;letter-spacing:-0.01em;line-height:40px;',
48
+ '9':'font-size:60px;letter-spacing:-0.025em;line-height:60px;',
49
+ },
50
+
51
+
52
+ },
53
+ Box:{
54
+ compiler:(value)=>{
55
+ let result='';
56
+ const match=/-([-]?[\w\.]+)/;
57
+ const property=['width','height','padding'];
58
+ value.match(new RegExp(match,'g')).forEach((e,i)=>{
59
+ if(i<property.length){
60
+ result+=`${property[i]}:${e.replace(match,'$1').replace(/(\d)d(\d)/,'$1.$2').replace(/([\d])p([\s]|$)/,'$1%$2')};`;
61
+ }else{
62
+
63
+ result=result.replace(/;$/,` ${e.replace(match,'$1').replace(/(\d)d(\d)/,'$1.$2').replace(/([\d])p([\s]|$)/,'$1%$2')};`)
64
+ }
65
+
66
+ })
67
+ return result;
68
+
69
+ },
70
+ type:'group',
71
+ groups:{
72
+
73
+ }
74
+ },
75
+ Position:{
76
+ 'alias':'pos',
77
+ compiler:(value)=>{
78
+ let result='';
79
+ const match=/-([-]?[\w\.]+)/;
80
+ const property=['position','top','right','bottom','left'];
81
+ value.match(new RegExp(match,'g')).forEach((e,i)=>{
82
+ if(i<property.length){
83
+ result+=`${property[i]}:${e.replace(match,'$1').replace(/(\d)d(\d)/,'$1.$2').replace(/([\d])p([\s]|$)/,'$1%$2')};`;
84
+ }
85
+
86
+ })
87
+ return result;
88
+
89
+ },
90
+ type:'group',
91
+ groups:{
92
+
93
+ }
94
+ },
95
+ Colorize:{
96
+ 'alias':'pos',
97
+ compiler:(value,custom)=>{
98
+ let result='';
99
+ const match=/-([-]?[\w\.]+)/;
100
+ const property=['background-color','border-color','color',];
101
+ value.match(new RegExp(match,'g')).forEach((e,i)=>{
102
+
103
+ if(i<property.length){
104
+ if(e.match(/^--[a-zA-Z]/)){
105
+ result+=`${property[i]}:var(${e});`
106
+ }else{
107
+ result+=`${property[i]}:${getCompiler('color').compiler(e,custom)};`;
108
+ }
109
+ }
110
+
111
+ })
112
+ return result;
113
+
114
+ },
115
+ type:'group',
116
+ groups:{
117
+
118
+ }
119
+ },
120
+ Container:{
121
+ type:"group",
122
+ compiler:(value)=>value,
123
+ groups:{
124
+ '1':'display:block;margin:auto;width:var(--container-1,448px)',
125
+ '2':'display:block;margin:auto;width:var(--container-2,688px)',
126
+ '3':'display:block;margin:auto;width:var(--container-3,880px)',
127
+ '4':'display:block;margin:auto;width:var(--container-4,1136px)',
128
+ 'xs':'display:block;margin:auto;width:var(--container-xs,448px)',
129
+ 'sm':'display:block;margin:auto;width:var(--container-sm,688px)',
130
+ 'md':'display:block;margin:auto;width:var(--container-md,880px)',
131
+ 'lg':'display:block;margin:auto;width:var(--container-lg,1136px)',
132
+ }
133
+ },
134
+ Section:{
135
+ type:"group",
136
+ compiler:(value)=>value,
137
+ groups:{
138
+ '1':'display:block;padding:var(--section-padding-1,24px) auto',
139
+ '2':'display:block;padding:var(--section-padding-2,40px) auto',
140
+ '3':'display:block;padding:var(--section-padding-3,64px) auto',
141
+ '4':'display:block;padding:var(--section-padding-4,80px) auto',
142
+ 'xs':'display:block;padding:var(--section-padding-xs,24px) auto',
143
+ 'sm':'display:block;padding:var(--section-padding-sm,40px) auto',
144
+ 'md':'display:block;padding:var(--section-padding-md,64px) auto',
145
+ 'lg':'display:block;padding:var(--section-padding-lg,80px) auto',
146
+
147
+ }
148
+ }
149
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aliascss",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "description": "AliasCSS is a CSS post processor.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -56,7 +56,8 @@
56
56
  "cssnano": "^7.0.4",
57
57
  "fast-glob": "^3.3.1",
58
58
  "postcss": "^8.4.39",
59
- "postcss-discard-duplicates": "^7.0.0"
59
+ "postcss-discard-duplicates": "^7.0.0",
60
+ "postcss-safe-parser": "^7.0.0"
60
61
  },
61
62
  "homepage": "https://github.com/Rodolopho/acss-lite#readme"
62
63
  }
package/ts.js CHANGED
@@ -1,5 +1,25 @@
1
1
  import main ,{ watch} from './lib/node/compileFile.js'
2
+ import postcss from 'postcss';
3
+
2
4
  import path from 'path'
5
+ import safeParse from 'postcss-safe-parser';
3
6
  let config=await import(path.resolve('aliascss.config.js'))
4
7
  console.log(config.default.input);
5
- // watch({input:['./demo/**/*.html'],output:{location:'./demo/acss.css','--file':true}});
8
+ // watch({input:['./demo/**/*.html'],output:{location:'./demo/acss.css','--file':true}});
9
+ //const safe = require('postcss-safe-parser')
10
+
11
+ const badCss = 'a {'
12
+
13
+ // postcss().process('.border{color:::red', { parser: safeParse }).then(result => {
14
+ // postcss().process('.border::hover{##transform:srrrr}', { }).then(result => {
15
+ // //result.css //= 'a {}'
16
+ // console.log(result.css);
17
+ // }).catch((e)=>{
18
+ // console.log('Error')
19
+ // })
20
+
21
+ console.log(postcss.parse(`@media (max-width : 576px){
22
+ .xs-bgc-red{background-color:red}
23
+ }`));
24
+ console.log(postcss.parse('.button{color:red}'));
25
+ console.log(postcss([]).process('.button{color:::red').css);