Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/homepage.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Addons may contains any tools, settings and styles. Addons now at the **preview*
<section class="Mb4gg">

## What next? ##
- masks and multiple gradients
- multiple gradients
- first-class pseudoselectors with arguments like `has()`
- performance optimization
- plugins for editors and IDEs with hints and autocompletion
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mlut/core",
"version": "2.4.0",
"version": "2.5.0",
"description": "Tailwind CSS alternative for custom websites and creative coding",
"author": "mr150",
"type": "module",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@

@if list.length($fraction) > 1 {
$dividend: list.nth($fraction, 1);
$is-css-function: string.index($value, '(') and string.slice($value, -1) == ')';

@if $is-css-function {
@return $value;
}

@if map.get($data, 'negative') {
$dividend: '-' + $dividend;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/sass/tools/settings/base/_utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
// Usage:
// ```scss
// @debug ml.uv('-Gdrl-b;r,black,#ff0'); // repeating-linear-gradient(to bottom right, black, #ff0)
// @debug ml.uv('-Gdl-50d,blue;3r,cc;80p'); // linear-gradient(-50deg, blue 3rem, currentColor 80%)
// @debug ml.uv('-Msgl-50d,blue;3r,cc;80p'); // linear-gradient(-50deg, blue 3rem, currentColor 80%)
// @debug ml.uv('-Gdc45d,#000;0.5g,yellow'); // conic-gradient(from 45deg, #000 0.5grad, yellow)
// ```
//
Expand Down
189 changes: 148 additions & 41 deletions packages/core/src/sass/tools/settings/common/_utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ $-sizing-kw: (
);

$-bd-kw-links: ('border', 'line-style', 'line-width');
$-radial-grad-kw: (
'position',
'radial-shape',
'ray-size',
'color-space',
'hue-interpolation',
'gradients',
);
$-conic-grad-kw: (
'position',
'color-space',
'hue-interpolation',
'gradients',
);

//stylelint-disable
$utils-db: (
Expand Down Expand Up @@ -748,15 +762,7 @@ $utils-db: (
'Bgr': (
'properties': background-repeat,
'multi-list-separator': ml.$tULs1,
'keywords': (
'': no-repeat,
'nr': no-repeat,
'rx': repeat-x,
'ry': repeat-y,
'r': repeat,
's': space,
'rn': round,
)
'keywords': 'repeat-style',
),
'Bgp': (
'properties': background-position,
Expand All @@ -766,10 +772,7 @@ $utils-db: (
'Bgs': (
'properties': background-size,
'multi-list-separator': ml.$tULs1,
'keywords': (
'ct': contain,
'cv': cover,
),
'keywords': 'bg-size',
),
'Bga': (
'properties': background-attachment,
Expand Down Expand Up @@ -821,55 +824,31 @@ $utils-db: (
'css-function': 'radial-gradient',
'conversion': 'gradient',
'multi-list-separator': ml.$tULs1,
'keywords': (
'position',
'radial-shape',
'ray-size',
'color-space',
'hue-interpolation',
'gradients',
),
'keywords': $-radial-grad-kw,
),
'-Gdrr': (
'properties': background-image,
'transformer': 'gradient',
'conversion': 'gradient',
'css-function': 'repeating-radial-gradient',
'multi-list-separator': ml.$tULs1,
'keywords': (
'position',
'radial-shape',
'ray-size',
'color-space',
'hue-interpolation',
'gradients',
),
'keywords': $-radial-grad-kw,
),
'-Gdc': (
'properties': background-image,
'transformer': 'gradient',
'css-function': 'conic-gradient',
'conversion': 'gradient',
'multi-list-separator': ml.$tULs1,
'keywords': (
'position',
'color-space',
'hue-interpolation',
'gradients',
),
'keywords': $-conic-grad-kw,
),
'-Gdrc': (
'properties': background-image,
'transformer': 'gradient',
'css-function': 'repeating-conic-gradient',
'conversion': 'gradient',
'multi-list-separator': ml.$tULs1,
'keywords': (
'position',
'color-space',
'hue-interpolation',
'gradients',
),
'keywords': $-conic-grad-kw,
),

// TRANSFORM
Expand Down Expand Up @@ -1267,6 +1246,115 @@ $utils-db: (
'conversion': 'num-percent',
),

// MASK
'Ms': (
'properties': mask,
'multi-list-separator': ml.$tULs1,
),
'Msi': (
'properties': mask-image,
'multi-list-separator': ml.$tULs1,
),
'Mscl': (
'properties': mask-clip,
'multi-list-separator': ml.$tULs1,
'keywords': ('box-ext', 'mask-clip'),
),
'Mso': (
'properties': mask-origin,
'multi-list-separator': ml.$tULs1,
'keywords': 'box-ext',
),
'Msc': (
'properties': mask-composite,
'multi-list-separator': ml.$tULs1,
'keywords': (
'a': add,
's': subtract,
'i': intersect,
'e': exclude,
),
),
'Msm': (
'properties': mask-mode,
'multi-list-separator': ml.$tULs1,
'keywords': (
'a': alpha,
'l': luminance,
'ms': match-source,
),
),
'Msp': (
'properties': mask-position,
'multi-list-separator': ml.$tULs1,
'keywords': 'position',
),
'Msr': (
'properties': mask-repeat,
'multi-list-separator': ml.$tULs1,
'keywords': 'repeat-style',
),
'Mss': (
'properties': mask-size,
'multi-list-separator': ml.$tULs1,
'keywords': 'bg-size',
),
'Mst': (
'properties': mask-type,
'keywords': (
'a': alpha,
'l': luminance,
),
),
'-Msgl': (
'properties': mask-image,
'transformer': 'gradient',
'css-function': 'linear-gradient',
'conversion': 'gradient',
'multi-list-separator': ml.$tULs1,
'keywords': ('position', 'gradients'),
),
'-Msgrpl': (
'properties': mask-image,
'transformer': 'gradient',
'conversion': 'gradient',
'css-function': 'repeating-linear-gradient',
'multi-list-separator': ml.$tULs1,
'keywords': ('position', 'gradients'),
),
'-Msgr': (
'properties': mask-image,
'transformer': 'gradient',
'css-function': 'radial-gradient',
'conversion': 'gradient',
'multi-list-separator': ml.$tULs1,
'keywords': $-radial-grad-kw,
),
'-Msgrpr': (
'properties': mask-image,
'transformer': 'gradient',
'conversion': 'gradient',
'css-function': 'repeating-radial-gradient',
'multi-list-separator': ml.$tULs1,
'keywords': $-radial-grad-kw,
),
'-Msgc': (
'properties': mask-image,
'transformer': 'gradient',
'css-function': 'conic-gradient',
'conversion': 'gradient',
'multi-list-separator': ml.$tULs1,
'keywords': $-conic-grad-kw,
),
'-Msgrpc': (
'properties': mask-image,
'transformer': 'gradient',
'css-function': 'repeating-conic-gradient',
'conversion': 'gradient',
'multi-list-separator': ml.$tULs1,
'keywords': $-conic-grad-kw,
),

// BORDER
'Bd': (
'properties': border,
Expand Down Expand Up @@ -1812,8 +1900,14 @@ $utils-db: (
'bb': border-box,
'cb': content-box,
'pb': padding-box,
'fb': fill-box,
'sb': stroke-box,
'vb': view-box,
't': text,
),
'mask-clip': (
'nc': no-clip,
),
'blend-mode': (
'n': normal,
'm': multiply,
Expand Down Expand Up @@ -1910,6 +2004,19 @@ $utils-db: (
'ic': increasing,
'dc': decreasing,
),
'repeat-style': (
'': no-repeat,
'nr': no-repeat,
'rx': repeat-x,
'ry': repeat-y,
'r': repeat,
's': space,
'rn': round,
),
'bg-size': (
'ct': contain,
'cv': cover,
),
'sizing': $-sizing-kw,
),
),
Expand Down
2 changes: 1 addition & 1 deletion packages/mlut/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ Available [here](https://docs.mlut.style/) or can be run locally. Documentation
- I hired a junior dev for my open source project. This is what happened: [RU](https://habr.com/ru/articles/962468/)

## What next? ##
- masks and multiple gradients
- multiple gradients
- first-class pseudoselectors with arguments like `has()`
- performance optimization
- plugins for editors and IDEs with hints and autocompletion
Expand Down
2 changes: 1 addition & 1 deletion packages/mlut/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mlut",
"version": "7.1.1",
"description": "Atomic CSS toolkit with Sass and ergonomics for creating styles of any complexity",
"description": "Tailwind CSS alternative for custom websites and creative coding",
"author": "mr150",
"type": "module",
"license": "MIT",
Expand Down
4 changes: 4 additions & 0 deletions test/sass/tools/functions/utils/_convert-util-value.scss
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ ml.$utils-cfg: map.set(
('t,#007,cc', '-Gdrl'):
repeating-linear-gradient(to top, #007, currentColor),
),
'correct CSS functions usage': (
('url(img/circle.png)', 'Bgi'): url(img/circle.png),
('url("img/triangle.png")', 'Bgi'): url("img/triangle.png"),
),
);

@each $test, $data in $-tests {
Expand Down