@cycjimmy/sass-lib 3.0.0 → 4.0.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 +25 -2
- package/functions/index.scss +13 -16
- package/index.scss +3 -6
- package/mixins/index.scss +2 -2
- package/package.json +16 -8
- package/placeholders/{layout.scss → _layout.scss} +3 -3
- package/placeholders/index.scss +2 -2
- /package/placeholders/{hidden-scrollbar.scss → _hiddenScrollbar.scss} +0 -0
- /package/placeholders/{position.scss → _position.scss} +0 -0
- /package/placeholders/{text-overflow.scss → _textOverflow.scss} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# sass-lib
|
|
2
2
|
|
|
3
|
-
![][workflows-badge-image]
|
|
3
|
+
![Test CI workflow status][workflows-badge-image]
|
|
4
4
|
[![libraries dependency status][libraries-status-image]][libraries-status-url]
|
|
5
5
|
[![libraries sourcerank][libraries-sourcerank-image]][libraries-sourcerank-url]
|
|
6
6
|
[![Release date][release-date-image]][release-url]
|
|
@@ -21,9 +21,32 @@ $ npm install @cycjimmy/sass-lib --save
|
|
|
21
21
|
$ yarn add @cycjimmy/sass-lib
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
## Requirements
|
|
25
|
+
|
|
26
|
+
- Dart Sass >= 1.80.0 (module system only, `@import` is not supported)
|
|
27
|
+
|
|
24
28
|
## Usage
|
|
29
|
+
|
|
30
|
+
```scss
|
|
31
|
+
// Native Dart Sass (enable the node package importer first:
|
|
32
|
+
// `sass --pkg-importer=node` or `importers: [new sass.NodePackageImporter()]`)
|
|
33
|
+
@use 'pkg:@cycjimmy/sass-lib' as *;
|
|
34
|
+
|
|
35
|
+
// Vite and other bundlers that resolve bare specifiers
|
|
36
|
+
@use '@cycjimmy/sass-lib' as *;
|
|
37
|
+
|
|
38
|
+
// webpack sass-loader
|
|
39
|
+
@use '~@cycjimmy/sass-lib' as *;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Entry points (prefix with `pkg:` for the native Dart Sass importer):
|
|
43
|
+
|
|
25
44
|
```scss
|
|
26
|
-
@use '
|
|
45
|
+
@use '@cycjimmy/sass-lib/functions/index' as fn;
|
|
46
|
+
@use '@cycjimmy/sass-lib/mixins/index' as mx;
|
|
47
|
+
@use '@cycjimmy/sass-lib/placeholders/index' as *;
|
|
48
|
+
@use '@cycjimmy/sass-lib/reset/h5';
|
|
49
|
+
@use '@cycjimmy/sass-lib/reset/special';
|
|
27
50
|
```
|
|
28
51
|
|
|
29
52
|
<!-- Links: -->
|
package/functions/index.scss
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* strip units
|
|
5
5
|
*/
|
|
6
6
|
@function strip-units($number) {
|
|
7
|
-
@return $number
|
|
7
|
+
@return math.div($number, $number * 0 + 1);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
|
|
@@ -14,31 +14,28 @@
|
|
|
14
14
|
* $designDrawingWidth
|
|
15
15
|
*
|
|
16
16
|
* Usage:
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* .selector {
|
|
18
|
+
* width: design-px2vw(750);
|
|
19
19
|
* }
|
|
20
20
|
*/
|
|
21
|
-
@function design-px2vw($designDrawingLength:0, $designDrawingWidth:750) {
|
|
22
|
-
@return strip-units($designDrawingLength)
|
|
21
|
+
@function design-px2vw($designDrawingLength: 0, $designDrawingWidth: 750) {
|
|
22
|
+
@return math.div(strip-units($designDrawingLength), strip-units($designDrawingWidth)) * 100vw;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* design-px2px
|
|
27
27
|
* $designDrawingLength
|
|
28
28
|
* $designDrawingWidth
|
|
29
|
+
* $pcRootWidth
|
|
29
30
|
*
|
|
30
31
|
* Usage:
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* get_function("design-px2px"),
|
|
34
|
-
* $designDrawingLength,
|
|
35
|
-
* $designDrawingWidth,
|
|
36
|
-
* $pcRootWidth,
|
|
37
|
-
* );
|
|
32
|
+
* .selector {
|
|
33
|
+
* width: design-px2px(750, 750, 500);
|
|
38
34
|
* }
|
|
39
35
|
*/
|
|
40
|
-
@function design-px2px($designDrawingLength:0, $designDrawingWidth:750, $pcRootWidth:500) {
|
|
41
|
-
@return math.round(
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
@function design-px2px($designDrawingLength: 0, $designDrawingWidth: 750, $pcRootWidth: 500) {
|
|
37
|
+
@return math.round(
|
|
38
|
+
math.div(strip-units($designDrawingLength), strip-units($designDrawingWidth))
|
|
39
|
+
* strip-units($pcRootWidth)
|
|
40
|
+
) * 1px;
|
|
44
41
|
}
|
package/index.scss
CHANGED
package/mixins/index.scss
CHANGED
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
@mixin square-wrap-vw($vw) {
|
|
68
|
-
$max: math.round($vw * 16
|
|
69
|
-
$min: math.round($vw * 3
|
|
68
|
+
$max: math.div(math.round(math.div($vw * 16, 9) * 100), 100);
|
|
69
|
+
$min: math.div(math.round(math.div($vw * 3, 2) * 100), 100);
|
|
70
70
|
|
|
71
71
|
width: $vw + vw;
|
|
72
72
|
height: $vw + vw;
|
package/package.json
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cycjimmy/sass-lib",
|
|
3
|
-
"version": "3.0.0",
|
|
4
|
-
"description": "Personal collection of sass.",
|
|
5
3
|
"type": "module",
|
|
6
|
-
"
|
|
4
|
+
"version": "4.0.0",
|
|
5
|
+
"description": "Personal collection of sass.",
|
|
6
|
+
"sass": "index.scss",
|
|
7
|
+
"author": "cycjimmy <cycjimmy@gmail.com> (https://github.com/cycjimmy)",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"homepage": "https://github.com/cycjimmy/sass-lib#readme",
|
|
7
10
|
"repository": {
|
|
8
11
|
"type": "git",
|
|
9
12
|
"url": "git+https://github.com/cycjimmy/sass-lib.git"
|
|
10
13
|
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/cycjimmy/sass-lib/issues"
|
|
16
|
+
},
|
|
11
17
|
"keywords": [
|
|
12
18
|
"collection",
|
|
13
19
|
"sass"
|
|
14
20
|
],
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"sass": "./index.scss",
|
|
24
|
+
"default": "./index.scss"
|
|
25
|
+
},
|
|
26
|
+
"./*": "./*"
|
|
19
27
|
},
|
|
20
|
-
"
|
|
28
|
+
"main": "index.scss"
|
|
21
29
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@use '../mixins/index' as mixins;
|
|
2
|
+
@use 'position' as *;
|
|
3
3
|
|
|
4
4
|
// full-container
|
|
5
5
|
%full-container {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// flex-center
|
|
14
14
|
%flex-center {
|
|
15
15
|
display: flex;
|
|
16
|
-
@include flex-box-align(center, center);
|
|
16
|
+
@include mixins.flex-box-align(center, center);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// clear-fix
|
package/placeholders/index.scss
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|