Skip to content

Commit 59fd8d4

Browse files
Merge pull request #41 from angular-package/develop
v0.19.0-beta
2 parents e9f763c + 79d1567 commit 59fd8d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1579
-790
lines changed

CHANGELOG.md

+36
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# @angular-package/sass changelog
22

3+
### v0.19.0-beta [#](https://github.com/angular-package/sass/releases/tag/v0.19.0-beta)
4+
5+
- **Update** [`variant.property-set()`](https://github.com/angular-package/sass/blob/develop/variant/property/_property.set.function.scss) function to handle multiple properties. [8081d34]
6+
- **Update** [`variant.transform()`](https://github.com/angular-package/sass/blob/develop/variant/_variant.transform.mixin.scss) to handle multiple properties. [305e6c1]
7+
- **Update** [`schema.has-multiple-colors()`](https://github.com/angular-package/sass/blob/develop/color/palette/schema/_schema.has-multiple-colors.function.scss) function - add `$result` argument to return `bool` or `index` of found indicator. [eca4b74]
8+
- **Add** [`color.name-indicator-remove()`](https://github.com/angular-package/sass/blob/develop/color/name/indicator/_indicator.remove.function.scss) function to remove indicator or multiple indicators from color name..[ce0cdc4]
9+
- **Add** [`color.name-indicator-retrieve()`](https://github.com/angular-package/sass/blob/develop/color/name/indicator/_indicator.retrieve.function.scss) function to retrieve indicator or multiple indicators from color name. [b5679c6]
10+
- **Update** [`color.palette-create()`](https://github.com/angular-package/sass/blob/develop/color/palette/_palette.create.function.scss) function - remove property indicator `':'` and assign property to color. [d853f93]
11+
- **Update** [`variant.create()`](https://github.com/angular-package/sass/blob/develop/variant/_variant.create.function.scss) function to retrieve color, and use `no-property-name` among with `name` in `$type` equal to `color`. [5bfe892]
12+
- **Add** [`variant.property-multiple-is()`](https://github.com/angular-package/sass/blob/develop/variant/property/_property.multiple-is.function.scss) function to check whether `$value` is multiple properties. [e97555c]
13+
- **Add** [`variant.property-multiple()`](https://github.com/angular-package/sass/blob/develop/variant/property/_property.multiple.function.scss) function to handle multiple properties in variant. [dc7f92c]
14+
- **Fix** [`color.name-replace()`](https://github.com/angular-package/sass/blob/develop/color/name/_name.replace.function.scss) function - change variable `$update` to `$replace`, set argument `$type` to `null` by default, use directly `adjustment.has()`. [5e7068e]
15+
- **Update** [`color.variant-create()`](https://github.com/angular-package/sass/blob/develop/color/variant/_variant.create.mixin.scss) function - remove color indicator from class and property, and handle multiple properties. [fda9204]
16+
- **Update** [`name.retrieve()`](https://github.com/angular-package/sass/blob/develop/color/name/_name.retrieve.function.scss) function - add `input-name`, `property`, `property-name`, `no-property-name` properties - retrieve property from name. [534249e]
17+
- **Update** [`property.name()`](https://github.com/angular-package/sass/blob/develop/property/_property.name.function.scss) function - remove duplicates from name. [7eb5e2e]
18+
- **Update** add to [`list.remove-duplicate()`](https://github.com/angular-package/sass/blob/develop/list/remove/_remove.duplicate.function.scss) function `$remove` arbitrary argument to define what duplicate remove. [3fab0a7]
19+
- **Update** move [`modifier-retrieve()`](https://github.com/angular-package/sass/blob/develop/variant/modifier/_modifier.retrieve.function.scss) function to module [`modifier`](https://github.com/angular-package/sass/tree/develop/variant/modifier). [15b13f1]
20+
- **Fix** forward main index. [eb1b424]
21+
22+
[8081d34]: https://github.com/angular-package/sass/commit/8081d3444ddb73aff2f79055e97884b39c7be4eb
23+
[305e6c1]: https://github.com/angular-package/sass/commit/305e6c1d06dfaf0152fa0976ace215dff8828337
24+
[eca4b74]: https://github.com/angular-package/sass/commit/eca4b7488eafe9d7e4f72ec7bf914a5bc83d7e5d
25+
[ce0cdc4]: https://github.com/angular-package/sass/commit/ce0cdc4ca1397c800b8e372e99fd3a31ea506a10
26+
[b5679c6]: https://github.com/angular-package/sass/commit/b5679c6924547decd094f9a24c66d57540daa6ff
27+
[d853f93]: https://github.com/angular-package/sass/commit/d853f939164eb919f5eb32c2b891600078461153
28+
[5bfe892]: https://github.com/angular-package/sass/commit/5bfe8921086acadc1a77fe752640b19d874046e1
29+
[e97555c]: https://github.com/angular-package/sass/commit/e97555c6b96a7b53d08cb3b7f1e0faa5868bf741
30+
[dc7f92c]: https://github.com/angular-package/sass/commit/dc7f92c437d247e86d69844cb637b11dd81bc0b2
31+
[5e7068e]: https://github.com/angular-package/sass/commit/5e7068ed58df3088b8ff686c71a6e8290bf77c05
32+
[fda9204]: https://github.com/angular-package/sass/commit/fda92040fc088a2f78b26e44e4b4d39d38317271
33+
[534249e]: https://github.com/angular-package/sass/commit/534249ecad780d6fa0fd6e85fb4acf310cce4745
34+
[7eb5e2e]: https://github.com/angular-package/sass/commit/7eb5e2ea49300c778a916f4bc6fa208d496ea063
35+
[3fab0a7]: https://github.com/angular-package/sass/commit/3fab0a7e552d6da685016f98e67494772d02dd40
36+
[15b13f1]: https://github.com/angular-package/sass/commit/15b13f13c12bd5a03a375a0af648091e0906be3e
37+
[eb1b424]: https://github.com/angular-package/sass/commit/eb1b424f717a59480ea47c6593caaf3f4e84bdae
38+
339
### v0.18.0-beta [#](https://github.com/angular-package/sass/releases/tag/v0.18.0-beta)
440

541
- **Update** `color.palette-create()` handle multiple colors in nested colors and use `variant.create()` function from `palette`. [06544a7]

class/variant/_variant.create.mixin.scss

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
// Modules.
2-
@use '../../map';
32
@use '../../meta';
43

54
// Mixins.
65
@use '../../class/class.content.mixin';
7-
@use '../../property/property.set.mixin' as property;
86
@use '../../variant/variant.transform.mixin';
97

108
// Functions.
9+
@use '../../map/map.get.function';
1110
@use '../../selector/selector.class.function';
1211

13-
// Status:
14-
// The `class.variant-create()` mixin .
12+
// Status: DONE
13+
// The `class.variant-create()` mixin.
1514
// @param `$variant`
1615
// @param `$combine`
1716
// @param `$pseudo-class`
@@ -20,7 +19,7 @@
2019
// @param `$modifier`
2120
@mixin create(
2221
$variant,
23-
$combine: false false false,
22+
$combine: false false false false,
2423
$pseudo-class: (),
2524
$dictionary: (),
2625
$function: meta.get-function(class, false, selector),

class/variant/_variant.create.mixin.spec.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
div {
1010
@include class.variant-create((
1111
// FEATURE: Variant 1.
12-
outline: 2px solid blue,
12+
// outline: 2px solid blue,
1313
// border top: 1px solid yellow,
1414
// border: 1px solid red,
1515
// border top: 1px solid red,
@@ -60,7 +60,7 @@ div {
6060

6161
// (border, outline) top: (color: 1px solid red),
6262
// ((border, outline) start: ((start, end) color: 1px solid red)),
63-
// (border, outline) '+top': ((+color, radius): 1px solid red), // TODO: DONE
63+
// (border, outline) '+top': ((+color, radius): 1px solid red), // TODO:
6464

6565
// (basic: border): (top: 1px solid red),
6666
// (basic: border): ((one: top): 1px solid red),

color/name/_name.create.function.scss

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
// Modules.
99
@use '../../string';
10-
@use 'indicator';
10+
11+
// Module functions.
12+
@use 'indicator/indicator.add.function';
1113

1214
// Status: DONE
1315
// The `color.name-create()` function creates color name with `color` indicator and `$shade`.

color/name/_name.replace.function.scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@use '../../var/var.variables' as variables;
77

88
// Modules.
9-
@use 'adjustment';
9+
@use 'adjustment/adjustment.has.function';
1010

1111
// Module functions.
1212
@use 'name.create.function' as *;
@@ -22,14 +22,14 @@
2222
@function replace(
2323
$name,
2424
$replace,
25-
$type,
25+
$type: null,
2626
$delimiter: map.get(variables.$var, delimiter),
2727
$shade: (dark, light),
2828
) {
2929
@return if(
3030
adjustment.has($name),
31-
list.set-nth($name, 1, create($update, $type, $delimiter, $shade)),
32-
create($update, $type, $delimiter, $shade)
31+
list.set-nth($name, 1, create($replace, $type, $delimiter, $shade)),
32+
create($replace, $type, $delimiter, $shade)
3333
);
3434
}
3535

color/name/_name.retrieve.function.scss

+32-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,21 @@
77
@use '../../list/get/get.map.function' as list-get-map;
88
@use '../../list/has/has.number.function' as list-has-number;
99
@use '../../list/list.first.function' as list-first;
10+
@use '../../list/list.indexes.function' as list-indexes;
1011
@use '../../list/list.insert-nth.function' as list-insert-nth;
12+
@use '../../list/list.nth.function' as list-nth;
1113
@use '../../list/list.to-map.function' as list-to-map;
1214
@use '../../list/remove/remove.map.function' as list-remove-map;
15+
@use '../../list/remove/remove.nth.function' as list-remove-nth;
1316
@use '../../map/map.pick.function' as map-pick;
17+
@use '../../map/map.update.function' as map-update;
18+
@use '../../string/string.replace.function' as string-replace;
19+
@use '../../string/string.unquote.function' as string-unquote;
1420

1521
// Module functions.
1622
@use 'adjustment/adjustment.has.function';
23+
@use 'indicator/indicator.remove.function' as indicator-remove;
24+
@use 'indicator/indicator.retrieve.function' as indicator-retrieve;
1725

1826
// Status: DONE
1927
// The `color.name-retrieve()` function returns a map with attributes obtained from `$name`.
@@ -27,6 +35,9 @@
2735
$result: ();
2836
$separator: list.separator($name);
2937

38+
// Input name.
39+
$result: map.set($result, input-name, $name);
40+
3041
// Check whether `$name` contains adjustment.
3142
@if adjustment.has($name) {
3243
// Get `map` from `$name`.
@@ -59,12 +70,24 @@
5970
}
6071

6172
// Create map from `$attributes`.
62-
$result: map.set(list-to-map.to-map($name, (name: list string), $attributes...), separator, $separator);
73+
$result: map.merge($result, list-to-map.to-map($name, (name: list string), $attributes...));
74+
$result: map.set($result, separator, $separator);
6375
}
64-
65-
// No adjustments.
6676
} @else {
67-
$result: (name: $name, separator: $separator);
77+
// No adjustments.
78+
$result: map.merge($result, (name: $name, separator: $separator));
79+
}
80+
81+
// Name has property.
82+
$property-index: list-indexes.indexes(map.get($result, name), all, '~=', ':');
83+
@if $property-index {
84+
$property: string-unquote.unquote(string-replace.replace(indicator-retrieve.retrieve(map.get($result, name), ':'), 'first', ':', ''));
85+
$no-property-name: indicator-remove.remove(map.get($result, name), ':');
86+
$result: map-update.update($result, (
87+
property: $property,
88+
property-name: ($property: indicator-remove.remove(map.get($result, input-name), ':')),
89+
no-property-name: $no-property-name,
90+
));
6891
}
6992

7093
// If `$model` is set to name set retrieved adjustment to key of color name.
@@ -120,3 +143,8 @@
120143

121144
// `$model`
122145
// @debug retrieve((primary dark, '*' 5%, '-' 0.2), $model: name); // (primary dark: (lightness: "*" 5%, alpha: "-" 0.2, separator: comma))
146+
147+
// Retrieve color property.
148+
// @debug retrieve(primary dark ':color');
149+
// @debug retrieve((primary dark ':color', 5%));
150+
// @debug retrieve((primary dark ':color') 5%);

color/name/indicator/_index.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
@forward 'indicator.add-multiple.function';
22
@forward 'indicator.add.function';
3+
@forward 'indicator.remove.function';
4+
@forward 'indicator.retrieve.function';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Sass.
2+
@use 'sass:list';
3+
@use 'sass:map';
4+
5+
// Functions.
6+
@use '../../../list/list.indexes.function' as list-indexes;
7+
@use '../../../list/list.nth.function' as list-nth;
8+
@use '../../../list/remove/remove.nth.function' as list-remove-nth;
9+
@use '../adjustment/adjustment.has.function';
10+
11+
// Status: DONE
12+
// The `color.indicator-remove()` function.
13+
// @param `$color`
14+
// @param `$indicator`
15+
// @arbitrary `$indicators...`
16+
// @returns
17+
@function remove($color, $indicator, $indicators...) {
18+
@if adjustment.has($color) {
19+
$name: list-remove-nth.nth(
20+
list-nth.nth($color, 1),
21+
list-indexes.indexes(list-nth.nth($color, 1), all, '~=', $indicator, $indicators...)
22+
);
23+
@return list.set-nth($color, 1, $name);
24+
}
25+
@return list-remove-nth.nth($color, list-indexes.indexes($color, all, '~=', $indicator, $indicators...)...);
26+
}
27+
28+
// Examples.
29+
// @debug remove(primary dark ':background', ':background'); // primary dark
30+
// @debug remove(primary dark ':color', ':color'); // primary dark
31+
32+
// multiple
33+
// @debug remove(primary dark ':color', ':color', ':background'); // primary dark
34+
// @debug remove(primary dark ':color', ':'); // primary dark
35+
36+
// adjustment
37+
// @debug remove((primary dark ':color', 5%), ':'); // primary dark, 5%
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Functions.
2+
@use '../../../list/list.indexes.function' as list-indexes;
3+
@use '../../../list/list.nth.function' as list-nth;
4+
@use '../adjustment/adjustment.has.function';
5+
6+
// Status: DONE
7+
// The `color.indicator-retrieve()` function.
8+
// @param `$color`
9+
// @param `$indicator`
10+
// @arbitrary `$indicators...`
11+
// @returns
12+
@function retrieve($color, $indicator, $indicators...) {
13+
$color: if(adjustment.has($color), list-nth.nth($color, 1), $color);
14+
@return list-nth.nth(
15+
$color,
16+
list-indexes.indexes($color, all, '~=', $indicator, $indicators...)...
17+
);
18+
}
19+
20+
// Examples.
21+
// @debug retrieve(primary dark ':background', ':'); // :background
22+
// @debug retrieve(primary dark ':color', ':'); // :color
23+
24+
// multiple
25+
// @debug retrieve(primary dark '!test' ':color', ':', '!'); // '":color" "!test"
26+
27+
// adjustment
28+
// @debug retrieve((primary dark ':color', 5%), ':'); // :color

0 commit comments

Comments
 (0)