@nulllogic/scssleon 1.0.1 → 1.0.3
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/package.json +5 -5
- package/scss/_base.scss +31 -0
- package/scss/_config.scss +109 -0
- package/scss/_content.scss +24 -0
- package/scss/_functions.scss +97 -0
- package/scss/_mixins.scss +22 -0
- package/scss/_reset.scss +347 -0
- package/scss/_root.scss +36 -0
- package/scss/_utilities.scss +356 -0
- package/scss/animations/_placeholder.scss +12 -0
- package/scss/components/_accordion.scss +15 -0
- package/scss/components/_alert.scss +15 -0
- package/scss/components/_badge.scss +15 -0
- package/scss/components/_breadcrumb.scss +15 -0
- package/scss/components/_button.scss +15 -0
- package/scss/components/_button_group.scss +15 -0
- package/scss/components/_card.scss +15 -0
- package/scss/components/_container.scss +39 -0
- package/scss/components/_dropdown.scss +5 -0
- package/scss/components/_form.scss +50 -0
- package/scss/components/_loader.scss +15 -0
- package/scss/components/_modal.scss +15 -0
- package/scss/components/_nav.scss +14 -0
- package/scss/components/_navbar.scss +15 -0
- package/scss/components/_overlay.scss +15 -0
- package/scss/components/_pagination.scss +15 -0
- package/scss/components/_placeholder.scss +34 -0
- package/scss/components/_sidecap.scss +15 -0
- package/scss/components/_table.scss +78 -0
- package/scss/forms/_checkbox.scss +14 -0
- package/scss/forms/_input-group.scss +14 -0
- package/scss/forms/_input.scss +14 -0
- package/scss/forms/_label.scss +14 -0
- package/scss/forms/_radio.scss +14 -0
- package/scss/forms/_range.scss +14 -0
- package/scss/forms/_select.scss +14 -0
- package/scss/forms/_switch.scss +14 -0
- package/scss/forms/_validation.scss +14 -0
- package/scss/helpers/_clearfix.scss +5 -0
- package/scss/helpers/_screen_reader.scss +11 -0
- package/scss/helpers/_text_truncate.scss +5 -0
- package/scss/mixins/_border-radius.scss +3 -0
- package/scss/mixins/_box-shadow.scss +16 -0
- package/scss/mixins/_breakpoints.scss +10 -0
- package/scss/mixins/_clearfix.scss +9 -0
- package/scss/mixins/_forms.scss +152 -0
- package/scss/mixins/_gradients.scss +6 -0
- package/scss/mixins/_grid.scss +93 -0
- package/scss/mixins/_transition.scss +30 -0
- package/scss/mixins/_utilities.scss +15 -0
- package/scss/mixins/generators/_color-sheme.scss +17 -0
- package/scss/mixins/generators/_components.scss +33 -0
- package/scss/mixins/generators/_properties.scss +116 -0
- package/scss/mixins/generators/_wrapper.scss +16 -0
- package/scss/mixins/variants/_alert.scss +24 -0
- package/scss/mixins/variants/_button.scss +122 -0
- package/scss/scssleon.scss +205 -0
- package/scss/themes/_default.scss +874 -0
- package/scss/themes/_wordpress_admin.scss +0 -0
- package/scss/utilities/_api.scss +24 -0
- package/.dockerignore +0 -2
- package/.eslintignore +0 -2
- package/.prettierignore +0 -1
- package/Dockerfile +0 -29
- package/Makefile +0 -22
- package/dist/css/scssleon.css +0 -1830
- package/dist/css/scssleon.css.map +0 -1
- /package/{CHANGELOG.md → scss/components/_icon.scss} +0 -0
- /package/{CONTRIBUTING.md → scss/themes/_shopify_app.scss} +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
┌─┐┬ ┌─┐┌─┐┌─┐┬ ┬┌─┐┬ ┌┬┐┌─┐┬─┐┌─┐
|
|
3
|
+
├─┘│ ├─┤│ ├┤ ├─┤│ ││ ││├┤ ├┬┘└─┐
|
|
4
|
+
┴ ┴─┘┴ ┴└─┘└─┘┴ ┴└─┘┴─┘─┴┘└─┘┴└─└─┘
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* Load settings and functions */
|
|
8
|
+
@use "../mixins" as mixins;
|
|
9
|
+
@use "../functions" as functions;
|
|
10
|
+
|
|
11
|
+
/* SCSS variables definition requirement */
|
|
12
|
+
$config: nil !default;
|
|
13
|
+
$theme: nil !default;
|
|
14
|
+
|
|
15
|
+
@include mixins.generate-component(
|
|
16
|
+
"placeholder",
|
|
17
|
+
"placeholder",
|
|
18
|
+
$config,
|
|
19
|
+
$theme
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
@keyframes placeholder-glow {
|
|
23
|
+
50% {
|
|
24
|
+
opacity: 0.5;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@keyframes placeholder-wave {
|
|
29
|
+
100% {
|
|
30
|
+
mask-position: -200% 0;
|
|
31
|
+
-webkit-mask-position: -200% 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
┌─┐┬┌┬┐┌─┐┌─┐┌─┐┌─┐
|
|
3
|
+
└─┐│ ││├┤ │ ├─┤├─┘
|
|
4
|
+
└─┘┴─┴┘└─┘└─┘┴ ┴┴
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* Load settings and functions */
|
|
8
|
+
@use "../mixins" as mixins;
|
|
9
|
+
@use "../functions" as functions;
|
|
10
|
+
|
|
11
|
+
/* SCSS variables definition requirement */
|
|
12
|
+
$config: nil !default;
|
|
13
|
+
$theme: nil !default;
|
|
14
|
+
|
|
15
|
+
@include mixins.generate-component("sidecap", "sidecap", $config, $theme);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
┌┬┐┌─┐┌┐ ┬ ┌─┐
|
|
3
|
+
│ ├─┤├┴┐│ ├┤
|
|
4
|
+
┴ ┴ ┴└─┘┴─┘└─┘
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* Load settings and functions */
|
|
8
|
+
@use "../mixins" as mixins;
|
|
9
|
+
@use "../functions" as functions;
|
|
10
|
+
|
|
11
|
+
/* SCSS variables definition requirement */
|
|
12
|
+
$config: nil !default;
|
|
13
|
+
$theme: nil !default;
|
|
14
|
+
|
|
15
|
+
.table {
|
|
16
|
+
width: 100%;
|
|
17
|
+
color: inherit;
|
|
18
|
+
vertical-align: middle;
|
|
19
|
+
border-color: inherit;
|
|
20
|
+
|
|
21
|
+
> :not(caption) > * > * {
|
|
22
|
+
padding: 5px;
|
|
23
|
+
border-bottom-width: 1px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
> tbody {
|
|
27
|
+
vertical-align: inherit;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
> thead {
|
|
31
|
+
vertical-align: bottom;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.table-group-divider {
|
|
36
|
+
border-top: 1px solid #ccc;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Border versions
|
|
40
|
+
.table-bordered {
|
|
41
|
+
> :not(caption) > * {
|
|
42
|
+
border-width: 1px;
|
|
43
|
+
|
|
44
|
+
> * {
|
|
45
|
+
border-width: 1px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.table-borderless {
|
|
51
|
+
> :not(caption) > * > * {
|
|
52
|
+
border-bottom-width: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
> :not(:first-child) {
|
|
56
|
+
border-top-width: 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Zebra-striping
|
|
61
|
+
.table-striped {
|
|
62
|
+
> tbody > tr:nth-of-type(odd) > * {
|
|
63
|
+
color: inherit;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// For columns
|
|
68
|
+
.table-striped-columns {
|
|
69
|
+
> :not(caption) > tr > :nth-child(even) {
|
|
70
|
+
color: inherit;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.table-hover {
|
|
75
|
+
> tbody > tr:hover > * {
|
|
76
|
+
color: inherit;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use '../themes/default' as theme;
|
|
2
|
+
@use '../functions' as functions;
|
|
3
|
+
@use '../mixins' as mixins;
|
|
4
|
+
|
|
5
|
+
/* SCSS variables definition requirement */
|
|
6
|
+
$config: nil !default;
|
|
7
|
+
$theme: nil !default;
|
|
8
|
+
|
|
9
|
+
@include mixins.generate-component(
|
|
10
|
+
"form.checkbox",
|
|
11
|
+
"checkbox",
|
|
12
|
+
$config,
|
|
13
|
+
$theme
|
|
14
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use '../themes/default' as theme;
|
|
2
|
+
@use '../functions' as functions;
|
|
3
|
+
@use '../mixins' as mixins;
|
|
4
|
+
|
|
5
|
+
/* SCSS variables definition requirement */
|
|
6
|
+
$config: nil !default;
|
|
7
|
+
$theme: nil !default;
|
|
8
|
+
|
|
9
|
+
@include mixins.generate-component(
|
|
10
|
+
"form.input-group",
|
|
11
|
+
"input-group",
|
|
12
|
+
$config,
|
|
13
|
+
$theme
|
|
14
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use '../themes/default' as theme;
|
|
2
|
+
@use '../functions' as functions;
|
|
3
|
+
@use '../mixins' as mixins;
|
|
4
|
+
|
|
5
|
+
/* SCSS variables definition requirement */
|
|
6
|
+
$config: nil !default;
|
|
7
|
+
$theme: nil !default;
|
|
8
|
+
|
|
9
|
+
@include mixins.generate-component(
|
|
10
|
+
"form.input",
|
|
11
|
+
"input",
|
|
12
|
+
$config,
|
|
13
|
+
$theme
|
|
14
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use '../themes/default' as theme;
|
|
2
|
+
@use '../functions' as functions;
|
|
3
|
+
@use '../mixins' as mixins;
|
|
4
|
+
|
|
5
|
+
/* SCSS variables definition requirement */
|
|
6
|
+
$config: nil !default;
|
|
7
|
+
$theme: nil !default;
|
|
8
|
+
|
|
9
|
+
@include mixins.generate-component(
|
|
10
|
+
"form.label",
|
|
11
|
+
"label",
|
|
12
|
+
$config,
|
|
13
|
+
$theme
|
|
14
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use '../themes/default' as theme;
|
|
2
|
+
@use '../functions' as functions;
|
|
3
|
+
@use '../mixins' as mixins;
|
|
4
|
+
|
|
5
|
+
/* SCSS variables definition requirement */
|
|
6
|
+
$config: nil !default;
|
|
7
|
+
$theme: nil !default;
|
|
8
|
+
|
|
9
|
+
@include mixins.generate-component(
|
|
10
|
+
"form.radio",
|
|
11
|
+
"radio",
|
|
12
|
+
$config,
|
|
13
|
+
$theme
|
|
14
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use '../themes/default' as theme;
|
|
2
|
+
@use '../functions' as functions;
|
|
3
|
+
@use '../mixins' as mixins;
|
|
4
|
+
|
|
5
|
+
/* SCSS variables definition requirement */
|
|
6
|
+
$config: nil !default;
|
|
7
|
+
$theme: nil !default;
|
|
8
|
+
|
|
9
|
+
@include mixins.generate-component(
|
|
10
|
+
"form.range",
|
|
11
|
+
"range",
|
|
12
|
+
$config,
|
|
13
|
+
$theme
|
|
14
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use '../themes/default' as theme;
|
|
2
|
+
@use '../functions' as functions;
|
|
3
|
+
@use '../mixins' as mixins;
|
|
4
|
+
|
|
5
|
+
/* SCSS variables definition requirement */
|
|
6
|
+
$config: nil !default;
|
|
7
|
+
$theme: nil !default;
|
|
8
|
+
|
|
9
|
+
@include mixins.generate-component(
|
|
10
|
+
"form.select",
|
|
11
|
+
"select",
|
|
12
|
+
$config,
|
|
13
|
+
$theme
|
|
14
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use '../themes/default' as theme;
|
|
2
|
+
@use '../functions' as functions;
|
|
3
|
+
@use '../mixins' as mixins;
|
|
4
|
+
|
|
5
|
+
/* SCSS variables definition requirement */
|
|
6
|
+
$config: nil !default;
|
|
7
|
+
$theme: nil !default;
|
|
8
|
+
|
|
9
|
+
@include mixins.generate-component(
|
|
10
|
+
"form.switch",
|
|
11
|
+
"switch",
|
|
12
|
+
$config,
|
|
13
|
+
$theme
|
|
14
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use '../themes/default' as theme;
|
|
2
|
+
@use '../functions' as functions;
|
|
3
|
+
@use '../mixins' as mixins;
|
|
4
|
+
|
|
5
|
+
/* SCSS variables definition requirement */
|
|
6
|
+
$config: nil !default;
|
|
7
|
+
$theme: nil !default;
|
|
8
|
+
|
|
9
|
+
@include mixins.generate-component(
|
|
10
|
+
"form.validation",
|
|
11
|
+
"validation",
|
|
12
|
+
$config,
|
|
13
|
+
$theme
|
|
14
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@mixin box-shadow($shadow...) {
|
|
2
|
+
$result: ();
|
|
3
|
+
|
|
4
|
+
@each $value in $shadow {
|
|
5
|
+
@if $value != null {
|
|
6
|
+
$result: append($result, $value, "comma");
|
|
7
|
+
}
|
|
8
|
+
@if $value == none and length($shadow) > 1 {
|
|
9
|
+
@warn "The keyword 'none' must be used as a single argument.";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@if (length($result) > 0) {
|
|
14
|
+
box-shadow: $result;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// This mixin uses an `if()` technique to be compatible with Dart Sass
|
|
2
|
+
// See https://github.com/sass/sass/issues/1873#issuecomment-152293725 for more details
|
|
3
|
+
|
|
4
|
+
// scss-docs-start form-validation-mixins
|
|
5
|
+
@mixin form-validation-state-selector($state) {
|
|
6
|
+
@if ($state == "valid" or $state == "invalid") {
|
|
7
|
+
.was-validated #{if(&, "&", "")}:#{$state},
|
|
8
|
+
#{if(&, "&", "")}.is-#{$state} {
|
|
9
|
+
@content;
|
|
10
|
+
}
|
|
11
|
+
} @else {
|
|
12
|
+
#{if(&, "&", "")}.is-#{$state} {
|
|
13
|
+
@content;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@mixin form-validation-state(
|
|
19
|
+
$state,
|
|
20
|
+
$color,
|
|
21
|
+
$icon,
|
|
22
|
+
$tooltip-color: color-contrast($color),
|
|
23
|
+
$tooltip-bg-color: rgba($color, $form-feedback-tooltip-opacity),
|
|
24
|
+
$focus-box-shadow: 0 0 $input-btn-focus-blur $input-focus-width rgba($color, $input-btn-focus-color-opacity)
|
|
25
|
+
) {
|
|
26
|
+
.#{$state}-feedback {
|
|
27
|
+
display: none;
|
|
28
|
+
width: 100%;
|
|
29
|
+
margin-top: $form-feedback-margin-top;
|
|
30
|
+
font-size : $form-feedback-font-size;
|
|
31
|
+
font-style: $form-feedback-font-style;
|
|
32
|
+
color: $color;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.#{$state}-tooltip {
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 100%;
|
|
38
|
+
z-index: 5;
|
|
39
|
+
display: none;
|
|
40
|
+
max-width: 100%; // Contain to parent when possible
|
|
41
|
+
padding: $form-feedback-tooltip-padding-y $form-feedback-tooltip-padding-x;
|
|
42
|
+
margin-top: .1rem;
|
|
43
|
+
font-size : $form-feedback-tooltip-font-size;
|
|
44
|
+
line-height: $form-feedback-tooltip-line-height;
|
|
45
|
+
color: $tooltip-color;
|
|
46
|
+
background-color: $tooltip-bg-color;
|
|
47
|
+
@include border-radius($form-feedback-tooltip-border-radius);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@include form-validation-state-selector($state) {
|
|
51
|
+
~ .#{$state}-feedback,
|
|
52
|
+
~ .#{$state}-tooltip {
|
|
53
|
+
display: block;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.form-control {
|
|
58
|
+
@include form-validation-state-selector($state) {
|
|
59
|
+
border-color: $color;
|
|
60
|
+
|
|
61
|
+
@if $enable-validation-icons {
|
|
62
|
+
padding-right: $input-height-inner;
|
|
63
|
+
background-image: escape-svg($icon);
|
|
64
|
+
background-repeat: no-repeat;
|
|
65
|
+
background-position: right $input-height-inner-quarter center;
|
|
66
|
+
background-size: $input-height-inner-half $input-height-inner-half;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:focus {
|
|
70
|
+
border-color: $color;
|
|
71
|
+
box-shadow: $focus-box-shadow;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// stylelint-disable-next-line selector-no-qualifying-type
|
|
77
|
+
textarea.form-control {
|
|
78
|
+
@include form-validation-state-selector($state) {
|
|
79
|
+
@if $enable-validation-icons {
|
|
80
|
+
padding-right: $input-height-inner;
|
|
81
|
+
background-position: top $input-height-inner-quarter right $input-height-inner-quarter;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.form-select {
|
|
87
|
+
@include form-validation-state-selector($state) {
|
|
88
|
+
border-color: $color;
|
|
89
|
+
|
|
90
|
+
@if $enable-validation-icons {
|
|
91
|
+
&:not([multiple]):not([size]),
|
|
92
|
+
&:not([multiple])[size="1"] {
|
|
93
|
+
padding-right: $form-select-feedback-icon-padding-end;
|
|
94
|
+
background-image: escape-svg($form-select-indicator), escape-svg($icon);
|
|
95
|
+
background-position: $form-select-bg-position, $form-select-feedback-icon-position;
|
|
96
|
+
background-size: $form-select-bg-size, $form-select-feedback-icon-size;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&:focus {
|
|
101
|
+
border-color: $color;
|
|
102
|
+
box-shadow: $focus-box-shadow;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.form-control-color {
|
|
108
|
+
@include form-validation-state-selector($state) {
|
|
109
|
+
@if $enable-validation-icons {
|
|
110
|
+
width: add($form-color-width, $input-height-inner);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.form-check-input {
|
|
116
|
+
@include form-validation-state-selector($state) {
|
|
117
|
+
border-color: $color;
|
|
118
|
+
|
|
119
|
+
&:checked {
|
|
120
|
+
background-color: $color;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&:focus {
|
|
124
|
+
box-shadow: $focus-box-shadow;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
~ .form-check-label {
|
|
128
|
+
color: $color;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
.form-check-inline .form-check-input {
|
|
133
|
+
~ .#{$state}-feedback {
|
|
134
|
+
margin-left: .5em;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.input-group .form-control,
|
|
139
|
+
.input-group .form-select {
|
|
140
|
+
@include form-validation-state-selector($state) {
|
|
141
|
+
@if $state == "valid" {
|
|
142
|
+
z-index: 1;
|
|
143
|
+
} @else if $state == "invalid" {
|
|
144
|
+
z-index: 2;
|
|
145
|
+
}
|
|
146
|
+
&:focus {
|
|
147
|
+
z-index: 3;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// scss-docs-end form-validation-mixins
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use "sass:meta";
|
|
4
|
+
|
|
5
|
+
@use '../config';
|
|
6
|
+
@use './breakpoints' as mixins;
|
|
7
|
+
@use '../functions' as functions;
|
|
8
|
+
|
|
9
|
+
// Row columns
|
|
10
|
+
@function divide($dividend, $divisor, $precision: 10) {
|
|
11
|
+
|
|
12
|
+
$sign: if($dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0, 1, -1);
|
|
13
|
+
$dividend: abs($dividend);
|
|
14
|
+
$divisor: abs($divisor);
|
|
15
|
+
|
|
16
|
+
@if $dividend == 0 {
|
|
17
|
+
@return 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@if $divisor == 0 {
|
|
21
|
+
@error "Cannot divide by 0";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
$remainder: $dividend;
|
|
25
|
+
$result: 0;
|
|
26
|
+
$factor: 10;
|
|
27
|
+
|
|
28
|
+
@while ($remainder > 0 and $precision >= 0) {
|
|
29
|
+
$quotient: 0;
|
|
30
|
+
|
|
31
|
+
@while ($remainder >= $divisor) {
|
|
32
|
+
$remainder: $remainder - $divisor;
|
|
33
|
+
$quotient: $quotient + 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
$result: $result * 10 + $quotient;
|
|
37
|
+
$factor: $factor * .1;
|
|
38
|
+
$remainder: $remainder * 10;
|
|
39
|
+
$precision: $precision - 1;
|
|
40
|
+
|
|
41
|
+
@if ($precision < 0 and $remainder >= $divisor * 5) {
|
|
42
|
+
$result: $result + 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
$result: $result * $factor * $sign;
|
|
47
|
+
|
|
48
|
+
@return $result;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@mixin generate_columns($size: false, $columns) {
|
|
52
|
+
|
|
53
|
+
@if $size {
|
|
54
|
+
flex: 0 0 auto;
|
|
55
|
+
width: percentage(divide($size, $columns));
|
|
56
|
+
|
|
57
|
+
} @else {
|
|
58
|
+
flex: 1 1 0;
|
|
59
|
+
max-width: 100%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Framework grid generation
|
|
65
|
+
@mixin generate_grid_columns($columns, $breakpoints) {
|
|
66
|
+
|
|
67
|
+
@each $breakpoint in map-keys($breakpoints) {
|
|
68
|
+
$infix: mixins.breakpoint-infix($breakpoint, $breakpoints);
|
|
69
|
+
|
|
70
|
+
@include mixins.media-breakpoint-up($breakpoint, $breakpoints) {
|
|
71
|
+
|
|
72
|
+
.col#{$infix} {
|
|
73
|
+
flex: 1 0 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.col#{$infix}-auto {
|
|
77
|
+
flex: 0 0 auto;
|
|
78
|
+
width: auto;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@if $columns > 0 {
|
|
82
|
+
@for $i from 1 through $columns {
|
|
83
|
+
.col#{$infix}-#{$i} {
|
|
84
|
+
@include generate_columns($i, $columns);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@mixin transition($transition...) {
|
|
2
|
+
@if length($transition) == 0 {
|
|
3
|
+
$transition: config.$transition-base;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
@if length($transition) > 1 {
|
|
7
|
+
@each $value in $transition {
|
|
8
|
+
@if $value == null or $value == none {
|
|
9
|
+
@warn "The keyword 'none' or 'null' must be used as a single argument.";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@if config.$enable-transitions {
|
|
15
|
+
@if nth($transition, 1) != null {
|
|
16
|
+
transition: $transition;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@if config.$enable-reduced-motion and
|
|
20
|
+
nth($transition, 1) !=
|
|
21
|
+
null and
|
|
22
|
+
nth($transition, 1) !=
|
|
23
|
+
none
|
|
24
|
+
{
|
|
25
|
+
@media (prefers-reduced-motion: reduce) {
|
|
26
|
+
transition: none;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
3
|
+
// Utility generator
|
|
4
|
+
// Used to generate utilities & print utilities
|
|
5
|
+
@mixin generate-utility($property, $settings) {
|
|
6
|
+
$class : map.get($settings, 'property');
|
|
7
|
+
$values : map.get($settings, 'values');
|
|
8
|
+
$suffix : map.get($settings, 'suffix');
|
|
9
|
+
|
|
10
|
+
@each $name, $value in $values {
|
|
11
|
+
.#{$name} {
|
|
12
|
+
#{$property} : #{$value};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
3
|
+
@use '../../functions' as functions;
|
|
4
|
+
|
|
5
|
+
// Media that add color variables
|
|
6
|
+
|
|
7
|
+
@mixin generate-color-scheme($schema) {
|
|
8
|
+
@if $schema == 'light' {
|
|
9
|
+
@media (prefers-color-scheme: light) {
|
|
10
|
+
@content
|
|
11
|
+
}
|
|
12
|
+
} @else if $schema == 'dark' {
|
|
13
|
+
@media (prefers-color-scheme: dark) {
|
|
14
|
+
@content
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:meta";
|
|
3
|
+
|
|
4
|
+
@use "properties";
|
|
5
|
+
@use "wrapper";
|
|
6
|
+
|
|
7
|
+
@use "../../functions" as functions;
|
|
8
|
+
|
|
9
|
+
@mixin generate-component($component, $class, $config, $theme) {
|
|
10
|
+
$theme-component: "";
|
|
11
|
+
|
|
12
|
+
// Checking, if the component was previously defined inside theme components
|
|
13
|
+
@if (meta.type-of($component) == "string") {
|
|
14
|
+
/* Loading component settings and styling */
|
|
15
|
+
$theme-component: functions.get-theme(
|
|
16
|
+
$theme,
|
|
17
|
+
"components" + "." + $component
|
|
18
|
+
);
|
|
19
|
+
} @else {
|
|
20
|
+
$theme-component: $component;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
%#{$class} {
|
|
24
|
+
@include properties.generate-properties($class, $theme-component, $config);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@include wrapper.generate-wrapper($config) {
|
|
28
|
+
.#{$class} {
|
|
29
|
+
@extend %#{$class};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|