@unsass/selector 1.2.0 → 1.3.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/CHANGELOG.md +13 -0
- package/package.json +6 -6
- package/src/_mixins.scss +29 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.3.0](https://github.com/unsass/selector/compare/v1.2.0...v1.3.0) (2023-09-11)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **create:** add list option for `$scope` parameter ([ebd78c1](https://github.com/unsass/selector/commit/ebd78c1705a2271b4d8bad8b2441936abc928284))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Build System
|
|
14
|
+
|
|
15
|
+
* **deps:** bump to `sass` 1.66.1 ([b9ff3d5](https://github.com/unsass/selector/commit/b9ff3d5ccad6ab1a5fba427cfdc753a09f50418d))
|
|
16
|
+
* **deps:** prevent dependencies vulnerabilities ([610177d](https://github.com/unsass/selector/commit/610177d035c8d255e836846fe4a5b7c9be932c08))
|
|
17
|
+
|
|
5
18
|
## [1.2.0](https://github.com/unsass/selector/compare/v1.1.0...v1.2.0) (2023-03-20)
|
|
6
19
|
|
|
7
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unsass/selector",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Sass functions and mixins to manage CSS selectors.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint:css": "stylelint --fix \"**/*.scss\"",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
},
|
|
16
16
|
"sass": "index.scss",
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@commitlint/cli": "^17.
|
|
19
|
-
"@commitlint/config-conventional": "^17.
|
|
20
|
-
"@semantic-release/changelog": "^6.0.
|
|
18
|
+
"@commitlint/cli": "^17.7.1",
|
|
19
|
+
"@commitlint/config-conventional": "^17.7.0",
|
|
20
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
21
21
|
"@semantic-release/git": "^10.0.1",
|
|
22
22
|
"glob": "^7.2.0",
|
|
23
23
|
"husky": "^8.0.3",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"jest-junit": "^15.0.0",
|
|
27
27
|
"npm-run-all": "^4.1.5",
|
|
28
28
|
"sass-true": "^7.0.0",
|
|
29
|
-
"semantic-release": "^
|
|
29
|
+
"semantic-release": "^21.1.1",
|
|
30
30
|
"stylelint": "^15.3.0",
|
|
31
31
|
"stylelint-config-unsass": "^1.0.1"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@unsass/string": "^1.4.2",
|
|
35
35
|
"@unsass/types": "^1.0.2",
|
|
36
|
-
"sass": "^1.
|
|
36
|
+
"sass": "^1.66.1"
|
|
37
37
|
},
|
|
38
38
|
"keywords": [
|
|
39
39
|
"sass",
|
package/src/_mixins.scss
CHANGED
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
/// }
|
|
51
51
|
///
|
|
52
52
|
/// @param {string} $selector - Selector name.
|
|
53
|
-
/// @param {string} $scope - Selector affix value.
|
|
53
|
+
/// @param {string, list} $scope - Selector affix value.
|
|
54
54
|
/// @param {string} $separator - Selector affix separator.
|
|
55
55
|
/// @param {string} $pseudo-class - Selector pseudo-class.
|
|
56
56
|
/// @param {string} $pseudo-element - Selector pseudo-element.
|
|
@@ -90,15 +90,39 @@
|
|
|
90
90
|
///
|
|
91
91
|
|
|
92
92
|
@if $scope and not $suffix {
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
$class: "";
|
|
94
|
+
|
|
95
|
+
@if type.is-list($scope) {
|
|
96
|
+
@each $key in $scope {
|
|
97
|
+
@if type.is-number(string.to-number(string.slice($key, 1, $end-at: 1))) {
|
|
98
|
+
$key: string.replace(\3 #{string.unquote($key)}, " ");
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
$class: $class + "#{$key}\\#{$separator}";
|
|
102
|
+
}
|
|
103
|
+
} @else {
|
|
104
|
+
@if type.is-number(string.to-number(string.slice($scope, 1, $end-at: 1))) {
|
|
105
|
+
$scope: string.replace(\3 #{string.unquote($scope)}, " ");
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
$class: "#{$scope}\\#{$separator}";
|
|
95
109
|
}
|
|
96
110
|
|
|
97
|
-
$selector: selector.append(
|
|
111
|
+
$selector: selector.append($class, $selector);
|
|
98
112
|
}
|
|
99
113
|
|
|
100
114
|
@if $scope and $suffix {
|
|
101
|
-
$
|
|
115
|
+
$class: "";
|
|
116
|
+
|
|
117
|
+
@if type.is-list($scope) {
|
|
118
|
+
@each $key in $scope {
|
|
119
|
+
$class: $class + "\\#{$separator}#{$key}";
|
|
120
|
+
}
|
|
121
|
+
} @else {
|
|
122
|
+
$class: "\\#{$separator}#{$scope}";
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
$selector: selector.append($selector, $class);
|
|
102
126
|
}
|
|
103
127
|
|
|
104
128
|
///
|