@mlut/core 2.3.1 → 2.5.0

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/README.md CHANGED
@@ -18,7 +18,7 @@ When using this package, you will need to install Sass separately. We recommend
18
18
  This allows you to control the versions of all your dependencies, and to choose which Sass implementation to use.
19
19
 
20
20
  ## Documentation ##
21
- Full documentation available [here](https://mlutcss.github.io/mlut/)
21
+ Full documentation available [here](https://docs.mlut.style/)
22
22
 
23
23
  ## License ##
24
24
  MIT
@@ -71,6 +71,11 @@
71
71
 
72
72
  @if list.length($fraction) > 1 {
73
73
  $dividend: list.nth($fraction, 1);
74
+ $is-css-function: string.index($value, '(') and string.slice($value, -1) == ')';
75
+
76
+ @if $is-css-function {
77
+ @return $value;
78
+ }
74
79
 
75
80
  @if map.get($data, 'negative') {
76
81
  $dividend: '-' + $dividend;
@@ -22,20 +22,29 @@ $-directions: map.values(ml.$main-directions);
22
22
 
23
23
  @function gradient($values, $data: ()) {
24
24
  $first-list: list.nth($values, 1);
25
+ $first-item: list.nth($first-list, 1);
26
+ $css-fn-name: map.get(
27
+ ml.$utils-db, 'utils', 'registry', map.get($data, 'name'), 'css-function'
28
+ );
25
29
 
26
- @if list.index($-directions, list.nth($first-list, 1)) {
30
+ @if (
31
+ list.index($-directions, $first-item) and
32
+ string.index($css-fn-name, 'linear')
33
+ ) {
27
34
  $first-list: list.join(to, $first-list);
35
+ } @else if string.index($css-fn-name, 'conic') {
36
+ $is-first-item-calc:
37
+ meta.type-of($first-item) == 'string' and string.index($first-item, 'calc(');
38
+
39
+ @if (meta.type-of($first-item) == 'number' or $is-first-item-calc) {
40
+ $first-list: list.join(from, $first-list);
41
+ }
28
42
  }
29
43
 
30
44
  @return meta.call(
31
45
  // TODO: add cache with frequently used CSS functions
32
- meta.get-function(
33
- map.get(
34
- ml.$utils-db, 'utils', 'registry', map.get($data, 'name'), 'css-function'
35
- ),
36
- true
37
- ),
38
- list.set-nth($values, 1, $first-list)
46
+ meta.get-function($css-fn-name, true),
47
+ list.set-nth($values, 1, $first-list),
39
48
  );
40
49
  }
41
50
 
@@ -321,7 +321,8 @@
321
321
  // Usage:
322
322
  // ```scss
323
323
  // @debug ml.uv('-Gdrl-b;r,black,#ff0'); // repeating-linear-gradient(to bottom right, black, #ff0)
324
- // @debug ml.uv('-Gdl-50d,blue;3r,cc;80p'); // linear-gradient(50deg, blue 3rem, currentColor 80%)
324
+ // @debug ml.uv('-Msgl-50d,blue;3r,cc;80p'); // linear-gradient(-50deg, blue 3rem, currentColor 80%)
325
+ // @debug ml.uv('-Gdc45d,#000;0.5g,yellow'); // conic-gradient(from 45deg, #000 0.5grad, yellow)
325
326
  // ```
326
327
  //
327
328
  // Styleguide: settings.utils.config.conversion.gradient
@@ -112,6 +112,20 @@ $-sizing-kw: (
112
112
  );
113
113
 
114
114
  $-bd-kw-links: ('border', 'line-style', 'line-width');
115
+ $-radial-grad-kw: (
116
+ 'position',
117
+ 'radial-shape',
118
+ 'ray-size',
119
+ 'color-space',
120
+ 'hue-interpolation',
121
+ 'gradients',
122
+ );
123
+ $-conic-grad-kw: (
124
+ 'position',
125
+ 'color-space',
126
+ 'hue-interpolation',
127
+ 'gradients',
128
+ );
115
129
 
116
130
  //stylelint-disable
117
131
  $utils-db: (
@@ -748,15 +762,7 @@ $utils-db: (
748
762
  'Bgr': (
749
763
  'properties': background-repeat,
750
764
  'multi-list-separator': ml.$tULs1,
751
- 'keywords': (
752
- '': no-repeat,
753
- 'nr': no-repeat,
754
- 'rx': repeat-x,
755
- 'ry': repeat-y,
756
- 'r': repeat,
757
- 's': space,
758
- 'rn': round,
759
- )
765
+ 'keywords': 'repeat-style',
760
766
  ),
761
767
  'Bgp': (
762
768
  'properties': background-position,
@@ -766,10 +772,7 @@ $utils-db: (
766
772
  'Bgs': (
767
773
  'properties': background-size,
768
774
  'multi-list-separator': ml.$tULs1,
769
- 'keywords': (
770
- 'ct': contain,
771
- 'cv': cover,
772
- ),
775
+ 'keywords': 'bg-size',
773
776
  ),
774
777
  'Bga': (
775
778
  'properties': background-attachment,
@@ -815,6 +818,38 @@ $utils-db: (
815
818
  'multi-list-separator': ml.$tULs1,
816
819
  'keywords': ('position', 'gradients'),
817
820
  ),
821
+ '-Gdrd': (
822
+ 'properties': background-image,
823
+ 'transformer': 'gradient',
824
+ 'css-function': 'radial-gradient',
825
+ 'conversion': 'gradient',
826
+ 'multi-list-separator': ml.$tULs1,
827
+ 'keywords': $-radial-grad-kw,
828
+ ),
829
+ '-Gdrr': (
830
+ 'properties': background-image,
831
+ 'transformer': 'gradient',
832
+ 'conversion': 'gradient',
833
+ 'css-function': 'repeating-radial-gradient',
834
+ 'multi-list-separator': ml.$tULs1,
835
+ 'keywords': $-radial-grad-kw,
836
+ ),
837
+ '-Gdc': (
838
+ 'properties': background-image,
839
+ 'transformer': 'gradient',
840
+ 'css-function': 'conic-gradient',
841
+ 'conversion': 'gradient',
842
+ 'multi-list-separator': ml.$tULs1,
843
+ 'keywords': $-conic-grad-kw,
844
+ ),
845
+ '-Gdrc': (
846
+ 'properties': background-image,
847
+ 'transformer': 'gradient',
848
+ 'css-function': 'repeating-conic-gradient',
849
+ 'conversion': 'gradient',
850
+ 'multi-list-separator': ml.$tULs1,
851
+ 'keywords': $-conic-grad-kw,
852
+ ),
818
853
 
819
854
  // TRANSFORM
820
855
  'Tf': (
@@ -1211,6 +1246,115 @@ $utils-db: (
1211
1246
  'conversion': 'num-percent',
1212
1247
  ),
1213
1248
 
1249
+ // MASK
1250
+ 'Ms': (
1251
+ 'properties': mask,
1252
+ 'multi-list-separator': ml.$tULs1,
1253
+ ),
1254
+ 'Msi': (
1255
+ 'properties': mask-image,
1256
+ 'multi-list-separator': ml.$tULs1,
1257
+ ),
1258
+ 'Mscl': (
1259
+ 'properties': mask-clip,
1260
+ 'multi-list-separator': ml.$tULs1,
1261
+ 'keywords': ('box-ext', 'mask-clip'),
1262
+ ),
1263
+ 'Mso': (
1264
+ 'properties': mask-origin,
1265
+ 'multi-list-separator': ml.$tULs1,
1266
+ 'keywords': 'box-ext',
1267
+ ),
1268
+ 'Msc': (
1269
+ 'properties': mask-composite,
1270
+ 'multi-list-separator': ml.$tULs1,
1271
+ 'keywords': (
1272
+ 'a': add,
1273
+ 's': subtract,
1274
+ 'i': intersect,
1275
+ 'e': exclude,
1276
+ ),
1277
+ ),
1278
+ 'Msm': (
1279
+ 'properties': mask-mode,
1280
+ 'multi-list-separator': ml.$tULs1,
1281
+ 'keywords': (
1282
+ 'a': alpha,
1283
+ 'l': luminance,
1284
+ 'ms': match-source,
1285
+ ),
1286
+ ),
1287
+ 'Msp': (
1288
+ 'properties': mask-position,
1289
+ 'multi-list-separator': ml.$tULs1,
1290
+ 'keywords': 'position',
1291
+ ),
1292
+ 'Msr': (
1293
+ 'properties': mask-repeat,
1294
+ 'multi-list-separator': ml.$tULs1,
1295
+ 'keywords': 'repeat-style',
1296
+ ),
1297
+ 'Mss': (
1298
+ 'properties': mask-size,
1299
+ 'multi-list-separator': ml.$tULs1,
1300
+ 'keywords': 'bg-size',
1301
+ ),
1302
+ 'Mst': (
1303
+ 'properties': mask-type,
1304
+ 'keywords': (
1305
+ 'a': alpha,
1306
+ 'l': luminance,
1307
+ ),
1308
+ ),
1309
+ '-Msgl': (
1310
+ 'properties': mask-image,
1311
+ 'transformer': 'gradient',
1312
+ 'css-function': 'linear-gradient',
1313
+ 'conversion': 'gradient',
1314
+ 'multi-list-separator': ml.$tULs1,
1315
+ 'keywords': ('position', 'gradients'),
1316
+ ),
1317
+ '-Msgrpl': (
1318
+ 'properties': mask-image,
1319
+ 'transformer': 'gradient',
1320
+ 'conversion': 'gradient',
1321
+ 'css-function': 'repeating-linear-gradient',
1322
+ 'multi-list-separator': ml.$tULs1,
1323
+ 'keywords': ('position', 'gradients'),
1324
+ ),
1325
+ '-Msgr': (
1326
+ 'properties': mask-image,
1327
+ 'transformer': 'gradient',
1328
+ 'css-function': 'radial-gradient',
1329
+ 'conversion': 'gradient',
1330
+ 'multi-list-separator': ml.$tULs1,
1331
+ 'keywords': $-radial-grad-kw,
1332
+ ),
1333
+ '-Msgrpr': (
1334
+ 'properties': mask-image,
1335
+ 'transformer': 'gradient',
1336
+ 'conversion': 'gradient',
1337
+ 'css-function': 'repeating-radial-gradient',
1338
+ 'multi-list-separator': ml.$tULs1,
1339
+ 'keywords': $-radial-grad-kw,
1340
+ ),
1341
+ '-Msgc': (
1342
+ 'properties': mask-image,
1343
+ 'transformer': 'gradient',
1344
+ 'css-function': 'conic-gradient',
1345
+ 'conversion': 'gradient',
1346
+ 'multi-list-separator': ml.$tULs1,
1347
+ 'keywords': $-conic-grad-kw,
1348
+ ),
1349
+ '-Msgrpc': (
1350
+ 'properties': mask-image,
1351
+ 'transformer': 'gradient',
1352
+ 'css-function': 'repeating-conic-gradient',
1353
+ 'conversion': 'gradient',
1354
+ 'multi-list-separator': ml.$tULs1,
1355
+ 'keywords': $-conic-grad-kw,
1356
+ ),
1357
+
1214
1358
  // BORDER
1215
1359
  'Bd': (
1216
1360
  'properties': border,
@@ -1756,8 +1900,14 @@ $utils-db: (
1756
1900
  'bb': border-box,
1757
1901
  'cb': content-box,
1758
1902
  'pb': padding-box,
1903
+ 'fb': fill-box,
1904
+ 'sb': stroke-box,
1905
+ 'vb': view-box,
1759
1906
  't': text,
1760
1907
  ),
1908
+ 'mask-clip': (
1909
+ 'nc': no-clip,
1910
+ ),
1761
1911
  'blend-mode': (
1762
1912
  'n': normal,
1763
1913
  'm': multiply,
@@ -1831,6 +1981,42 @@ $utils-db: (
1831
1981
  fill, outline-color, stroke,
1832
1982
  ),
1833
1983
  ),
1984
+ 'radial-shape': (
1985
+ // c - center, cc - currentColor
1986
+ 'cr': circle,
1987
+ 'el': ellipse,
1988
+ ),
1989
+ 'ray-size': (
1990
+ 'css': closest-side,
1991
+ 'csc': closest-corner,
1992
+ 'fts': farthest-side,
1993
+ 'ftc': farthest-corner,
1994
+ 'sd': sides,
1995
+ ),
1996
+ 'color-space': (
1997
+ 'dpp': display-p3,
1998
+ 'dppl': display-p3-linear,
1999
+ 'ppr': prophoto-rgb,
2000
+ ),
2001
+ 'hue-interpolation': (
2002
+ 'sr': shorter,
2003
+ 'lr': longer,
2004
+ 'ic': increasing,
2005
+ 'dc': decreasing,
2006
+ ),
2007
+ 'repeat-style': (
2008
+ '': no-repeat,
2009
+ 'nr': no-repeat,
2010
+ 'rx': repeat-x,
2011
+ 'ry': repeat-y,
2012
+ 'r': repeat,
2013
+ 's': space,
2014
+ 'rn': round,
2015
+ ),
2016
+ 'bg-size': (
2017
+ 'ct': contain,
2018
+ 'cv': cover,
2019
+ ),
1834
2020
  'sizing': $-sizing-kw,
1835
2021
  ),
1836
2022
  ),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mlut/core",
3
- "version": "2.3.1",
4
- "description": "Atomic CSS toolkit with Sass and ergonomics for creating styles of any complexity",
3
+ "version": "2.5.0",
4
+ "description": "Tailwind CSS alternative for custom websites and creative coding",
5
5
  "author": "mr150",
6
6
  "type": "module",
7
7
  "license": "MIT",