@cycjimmy/sass-lib 3.0.1 → 5.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 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,11 +21,38 @@ $ 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
+
25
30
  ```scss
26
- @use '~@cycjimmy/sass-lib' as sass-lib;
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 *;
27
40
  ```
28
41
 
42
+ Entry points (prefix with `pkg:` for the native Dart Sass importer):
43
+
44
+ ```scss
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';
50
+ ```
51
+
52
+ ## Development
53
+
54
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the local toolchain, repository settings and bot configuration.
55
+
29
56
  <!-- Links: -->
30
57
  [npm-image]: https://img.shields.io/npm/v/@cycjimmy/sass-lib
31
58
  [npm-url]: https://npmjs.org/package/@cycjimmy/sass-lib
@@ -4,7 +4,7 @@
4
4
  * strip units
5
5
  */
6
6
  @function strip-units($number) {
7
- @return $number / ($number * 0 + 1);
7
+ @return math.div($number, $number * 0 + 1);
8
8
  }
9
9
 
10
10
 
@@ -14,31 +14,27 @@
14
14
  * $designDrawingWidth
15
15
  *
16
16
  * Usage:
17
- * @function calc-vw($designDrawingLength:0) {
18
- * @return call(get_function("design-px2vw"), $designDrawingLength, $designDrawingWidth);
17
+ * .selector {
18
+ * width: design-px2vw(750);
19
19
  * }
20
20
  */
21
- @function design-px2vw($designDrawingLength:0, $designDrawingWidth:750) {
22
- @return strip-units($designDrawingLength) / strip-units($designDrawingWidth) * 100vw;
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
- * @function calc-px($designDrawingLength:0) {
32
- * @return call(
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(strip-units($designDrawingLength)
42
- / strip-units($designDrawingWidth)
43
- * strip-units($pcRootWidth)) * 1px;
36
+ @function design-px2px($designDrawingLength: 0, $designDrawingWidth: 750, $pcRootWidth: 500) {
37
+ @return math.round(
38
+ math.div(strip-units($designDrawingLength), strip-units($designDrawingWidth)) * strip-units($pcRootWidth)
39
+ ) * 1px;
44
40
  }
package/index.scss CHANGED
@@ -1,6 +1,3 @@
1
- @charset "utf-8";
2
-
3
- @forward "functions/index";
4
- @forward "mixins/index";
5
- @forward "placeholders/index";
6
-
1
+ @forward 'functions/index';
2
+ @forward 'mixins/index';
3
+ @forward 'placeholders/index';
package/mixins/index.scss CHANGED
@@ -19,22 +19,26 @@
19
19
  ) {
20
20
  position: absolute;
21
21
  margin: auto;
22
- @if ($overwrite == false) {
23
- left: $offset;
22
+
23
+ @if $overwrite == false {
24
24
  top: $offset;
25
25
  right: $offset;
26
26
  bottom: $offset;
27
+ left: $offset;
27
28
  } @else {
28
- @if ($top) {
29
+ @if $top {
29
30
  top: $top;
30
31
  }
31
- @if ($right) {
32
+
33
+ @if $right {
32
34
  right: $right;
33
35
  }
34
- @if ($bottom) {
36
+
37
+ @if $bottom {
35
38
  bottom: $bottom;
36
39
  }
37
- @if ($left) {
40
+
41
+ @if $left {
38
42
  left: $left;
39
43
  }
40
44
  }
@@ -47,10 +51,11 @@
47
51
  * options: false, center, flex-end, ...
48
52
  */
49
53
  @mixin flex-box-align($mainAxis:false, $crossAxis:false) {
50
- @if ($mainAxis != false) {
54
+ @if $mainAxis != false {
51
55
  justify-content: $mainAxis;
52
56
  }
53
- @if ($crossAxis != false) {
57
+
58
+ @if $crossAxis != false {
54
59
  align-items: $crossAxis;
55
60
  }
56
61
  }
@@ -59,19 +64,19 @@
59
64
  * square container
60
65
  */
61
66
  @mixin square-wrap($width:100%) {
62
- height: 0;
63
67
  width: $width;
68
+ height: 0;
64
69
  padding-bottom: $width;
65
70
  }
66
71
 
67
72
  @mixin square-wrap-vw($vw) {
68
- $max: math.round($vw * 16 /9 * 100)/100;
69
- $min: math.round($vw * 3 /2 * 100)/100;
73
+ $max: math.div(math.round(math.div($vw * 16, 9) * 100), 100);
74
+ $min: math.div(math.round(math.div($vw * 3, 2) * 100), 100);
70
75
 
71
76
  width: $vw + vw;
72
- height: $vw + vw;
73
77
  min-width: $min + vh;
74
78
  max-width: $max + vh;
79
+ height: $vw + vw;
75
80
  min-height: $min + vh;
76
81
  max-height: $max + vh;
77
82
  }
package/package.json CHANGED
@@ -1,21 +1,32 @@
1
1
  {
2
2
  "name": "@cycjimmy/sass-lib",
3
- "version": "3.0.1",
4
- "description": "Personal collection of sass.",
5
3
  "type": "module",
6
- "main": "index.scss",
4
+ "version": "5.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
- "author": "cycjimmy <cycjimmy@gmail.com> (https://github.com/cycjimmy)",
16
- "license": "MIT",
17
- "bugs": {
18
- "url": "https://github.com/cycjimmy/sass-lib/issues"
21
+ "exports": {
22
+ ".": {
23
+ "sass": "./index.scss",
24
+ "default": "./index.scss"
25
+ },
26
+ "./*": "./*"
19
27
  },
20
- "homepage": "https://github.com/cycjimmy/sass-lib#readme"
28
+ "main": "index.scss",
29
+ "publishConfig": {
30
+ "access": "public"
31
+ }
21
32
  }
@@ -8,15 +8,18 @@
8
8
 
9
9
  %hidden-scrollbar-x {
10
10
  @extend %common-hidden-scrollbar;
11
+
11
12
  overflow-x: auto;
12
13
  }
13
14
 
14
15
  %hidden-scrollbar-y {
15
16
  @extend %common-hidden-scrollbar;
17
+
16
18
  overflow-y: auto;
17
19
  }
18
20
 
19
21
  %hidden-scrollbar {
20
22
  @extend %common-hidden-scrollbar;
23
+
21
24
  overflow: auto;
22
25
  }
@@ -4,8 +4,9 @@
4
4
  // full-container
5
5
  %full-container {
6
6
  @extend %abs;
7
- left: 0;
7
+
8
8
  top: 0;
9
+ left: 0;
9
10
  width: 100%;
10
11
  height: 100%;
11
12
  }
@@ -13,6 +14,7 @@
13
14
  // flex-center
14
15
  %flex-center {
15
16
  display: flex;
17
+
16
18
  @include mixins.flex-box-align(center, center);
17
19
  }
18
20
 
@@ -20,8 +22,8 @@
20
22
  %clear-fix {
21
23
  &::before,
22
24
  &::after {
23
- content: ' ';
24
25
  display: table;
26
+ content: ' ';
25
27
  }
26
28
 
27
29
  &::after {
package/reset/h5.scss CHANGED
@@ -1,15 +1,14 @@
1
1
  * {
2
- margin: 0;
3
2
  padding: 0;
3
+ margin: 0;
4
4
  }
5
5
 
6
6
  body {
7
7
  overflow: hidden;
8
- user-select: none;
9
- -webkit-touch-callout: none;
10
8
  -webkit-overflow-scrolling: touch;
11
-
12
9
  text-size-adjust: 100%;
10
+ -webkit-touch-callout: none;
11
+ user-select: none;
13
12
  }
14
13
 
15
14
  h1,
@@ -25,16 +24,16 @@ h6 {
25
24
  a,
26
25
  button,
27
26
  input {
28
- -webkit-tap-highlight-color: rgba(255, 0, 0, 0);
29
- outline: none;
30
27
  border: 0;
31
- touch-action: manipulation;
32
28
  cursor: pointer;
29
+ outline: none;
30
+ -webkit-tap-highlight-color: rgba(255, 0, 0, 0);
31
+ touch-action: manipulation;
33
32
  }
34
33
 
35
34
  a {
36
- text-decoration: none;
37
35
  color: inherit;
36
+ text-decoration: none;
38
37
  }
39
38
 
40
39
  a,
@@ -21,14 +21,14 @@ h3,
21
21
  h4,
22
22
  h5,
23
23
  h6 {
24
- margin: 0;
25
24
  padding: 0;
25
+ margin: 0;
26
26
  }
27
27
 
28
28
  body {
29
- -webkit-touch-callout: none;
30
- text-size-adjust: 100%;
31
29
  -webkit-overflow-scrolling: touch;
30
+ text-size-adjust: 100%;
31
+ -webkit-touch-callout: none;
32
32
  }
33
33
 
34
34
  h1,
@@ -44,15 +44,15 @@ h6 {
44
44
  a,
45
45
  button,
46
46
  input {
47
- -webkit-tap-highlight-color: rgba(255, 0, 0, 0);
48
- outline: none;
49
47
  border: 0;
48
+ outline: none;
49
+ -webkit-tap-highlight-color: rgba(255, 0, 0, 0);
50
50
  touch-action: manipulation;
51
51
  }
52
52
 
53
53
  a {
54
- text-decoration: none;
55
54
  color: inherit;
55
+ text-decoration: none;
56
56
  }
57
57
 
58
58
  a,
@@ -73,8 +73,8 @@ iframe,
73
73
  object,
74
74
  audio,
75
75
  video {
76
- height: auto;
77
76
  max-width: 100%;
77
+ height: auto;
78
78
  }
79
79
 
80
80
  // Iframe