aliascss 1.3.8 → 1.3.9

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,5 +1,9 @@
1
1
  export default function clipPath(data, custom) {
2
2
  const valuePortion = data.replace(/^-/, '') || '';
3
+ // for raw-css function
4
+ if (valuePortion.match(/[(]/)) {
5
+ return valuePortion;
6
+ }
3
7
  // const match = /^(path|pa|circle|c|inset|i|polygon|p|ellipse|e|xywh|rect|r)[-]?[\d]/;
4
8
  const match = /^(path|pa|circle|c|inset|i|polygon|p|ellipse|e|xywh|rect|r)[-]?([\d]|-)/;
5
9
  let shape = null;
@@ -14,6 +14,10 @@ export default function color(color, custom) {
14
14
  }
15
15
  // remove - before the color
16
16
  color = color.replace(/^[-]/, '');
17
+ // check if is a raw function
18
+ if (color.match(/^(rgb|hsl|hsla|rgba|hwb|hwba|lab|oklab|lch|oklch)[(]/)) {
19
+ return color;
20
+ }
17
21
  // custom-color
18
22
  if (custom.hasOwnProperty('colors') && typeof custom.colors === 'object') {
19
23
  if (custom.colors.hasOwnProperty(color)) {
@@ -4,6 +4,11 @@ export default function filter(valuePortion, custom) {
4
4
  const matchRegEx = /^[-]?([a-zA-Z]+([-][\w]+)?)(?=[-])/;
5
5
  valuePortion.split(/__/).forEach((each) => {
6
6
  var _a;
7
+ // check for raw-css funcion
8
+ if (each.match(/[(]/)) {
9
+ compileValue += each.replace(/^-/, '') + " ";
10
+ return;
11
+ }
7
12
  let [fn, value] = ['', ''];
8
13
  // css-var
9
14
  if (each.match(/--[a-zA-Z]/)) {
@@ -3,7 +3,10 @@ export default function gradient(datas, custom) {
3
3
  datas = datas.replace(/^[-]/, '');
4
4
  let masterHolder = '';
5
5
  datas.split('__').forEach((data) => {
6
- const matched = data.match(/[-]?(((repeating-)?(conic|linear|radial)-gradient)|(rrg|rg|lg|rcg|cg|rcg|rlg))([\w_-]+)/);
6
+ if (data.match(/[-]?(((repeating-)?(conic|linear|radial)-gradient)|(rrg|rg|lg|rcg|cg|rcg|rlg))[\(]/)) {
7
+ masterHolder += data.replace(/[_]/g, ' ') + ', ';
8
+ }
9
+ const matched = data.match(/[-]?(((repeating-)?(conic|linear|radial)-gradient)|(rrg|rg|lg|rcg|cg|rcg|rlg))([-_][\w_-]+)/);
7
10
  // console.warn(matched, data);
8
11
  if (matched) {
9
12
  const grad = matched[1];
@@ -5,6 +5,11 @@ export default (value) => {
5
5
  let compileValue = '';
6
6
  // check for multiple value
7
7
  value.split(/__(?=[a-z])/).forEach((e) => {
8
+ //
9
+ if (e.match(/[(]/)) {
10
+ compileValue += e + " ";
11
+ return;
12
+ }
8
13
  // extract function
9
14
  const result = transformEach(e);
10
15
  if (result)
@@ -4,6 +4,12 @@ export default function url(data) {
4
4
  let holder = '';
5
5
  data.split(/__/).forEach((each) => {
6
6
  each = each.replace(/^[-]?url/, '');
7
+ // match raw-css function
8
+ if (each.match(/^[(]/)) {
9
+ holder += 'url' + each + ',';
10
+ return;
11
+ }
12
+ // css-var inside url
7
13
  if (each.match(/^--[a-zA-Z]/)) {
8
14
  holder += `url(var(${each})),`;
9
15
  return;
@@ -224,7 +224,7 @@ const cssProps = {
224
224
  if (value.match(/^[-]?url/)) {
225
225
  return url(value);
226
226
  }
227
- else if (value.match(/[-]?(((repeating-)?(conic|linear|radial)-gradient)|(rrg|rg|lg|rcg|cg|rcg|rlg))([\w_-]+)/)) {
227
+ else if (value.match(/[-]?(((repeating-)?(conic|linear|radial)-gradient)|(rrg|rg|lg|rcg|cg|rcg|rlg))([(-_][\w_-]+)/)) {
228
228
  return gradient(value, custom);
229
229
  }
230
230
  else {
@@ -649,7 +649,7 @@ const cssProps = {
649
649
  compiler: length,
650
650
  values: [''],
651
651
  },
652
- 'border-start-star-radius': {
652
+ 'border-start-start-radius': {
653
653
  alias: 'bssr',
654
654
  type: 'd',
655
655
  compiler: length,
@@ -29,13 +29,13 @@ bool = false) {
29
29
  const val = value.replace(/(--[\w-]+)/g, 'var($1)')
30
30
  .replace(/^[(]/, '').replace(/_$/, '').replace(/[)]$/, '')
31
31
  .replace(/,/g, ', ');
32
- value = val;
32
+ value = val.replace(/_/g, ' ');
33
33
  }
34
34
  else {
35
35
  const val = value.replace(/(--[\w-]+)/g, 'var($1)')
36
36
  .replace(/^[(]/, '').replace(/[)]$/, '')
37
37
  .replace(/,/g, ' ');
38
- value = val;
38
+ value = val.replace(/_/g, ' ');
39
39
  }
40
40
  return bool ? [property, value] : property + ":" + value;
41
41
  }
@@ -130,13 +130,15 @@ bool = false) {
130
130
  if (valuePortion.match(/_$/)) {
131
131
  const val = valuePortion.replace(/(--[\w-]+)/g, 'var($1)')
132
132
  .replace(/^[(]/, '').replace(/_$/, '').replace(/[)]$/, '')
133
- .replace(/,/g, ', ');
133
+ .replace(/,/g, ', ')
134
+ .replace(/[_]/g, ' ');
134
135
  return bool ? [prop, val] : prop + ":" + val;
135
136
  }
136
137
  else {
137
138
  const val = valuePortion.replace(/(--[\w-]+)/g, 'var($1)')
138
139
  .replace(/^[(]/, '').replace(/[)]$/, '')
139
- .replace(/,/g, ' ');
140
+ .replace(/,/g, ' ')
141
+ .replace(/[_]/g, ' ');
140
142
  return bool ? [prop, val] : prop + ":" + val;
141
143
  }
142
144
  }
@@ -0,0 +1,3 @@
1
+ export declare const staticClassNamesAlias: {
2
+ [key: string]: string;
3
+ };