nk_jtb 0.3.0 → 0.5.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/index.html +16 -71
- package/main.js +1 -0
- package/package.json +8 -4
- package/public/images/logo.svg +1 -25
- package/scss/_nk.scss +33 -19
- package/scss/base/_base.scss +2 -16
- package/scss/base/_content_gap.scss +8 -2
- package/scss/base/_vars_base.scss +15 -4
- package/scss/base/_vars_colors.scss +3 -8
- package/scss/base/_vars_components.scss +17 -32
- package/scss/base/_vars_utility_maps.scss +17 -0
- package/scss/components/_accordion.scss +87 -20
- package/scss/components/_box.scss +1 -1
- package/scss/components/_button.scss +1 -12
- package/scss/components/_dropdown.scss +0 -12
- package/scss/components/_hero.scss +2 -2
- package/scss/components/_icon.scss +1 -4
- package/scss/components/_list.scss +32 -0
- package/scss/components/_menu.scss +12 -6
- package/scss/components/_navbar.scss +10 -2
- package/scss/components/_other.scss +11 -16
- package/scss/components/_sidebar.scss +20 -6
- package/scss/forms/_form.scss +7 -11
- package/scss/forms/_index.scss +1 -0
- package/scss/forms/_toggle.scss +57 -0
- package/scss/functions/_colorFunctions.scss +35 -0
- package/scss/functions/_helpers.scss +4 -0
- package/scss/jtb.scss +6 -2
- package/scss/layouts/__two-column.scss +32 -0
- package/scss/mixins/_colorSchemeSimple.scss +1 -1
- package/scss/mixins/_createState.scss +1 -1
- package/scss/mixins/_makeColorSchemeAdvanced.scss +1 -1
- package/scss/mixins/_makeCssPropertyMixins.scss +8 -3
- package/scss/mixins/_makeMagicClass.scss +61 -0
- package/scss/mixins/_makeMagicGrid2Cols.scss +70 -0
- package/scss/mixins/_makeMagicGridFixedWidth.scss +55 -0
- package/scss/mixins/_makeResponsiveClasses.scss +91 -0
- package/scss/mixins/_makeResponsivePositionUtilities.scss +3 -3
- package/scss/mixins/_media.scss +25 -24
- package/scss/play.scss +76 -0
- package/scss/utilities/_border.scss +24 -0
- package/scss/utilities/_display_visibility.scss +21 -148
- package/scss/utilities/_flex.scss +11 -1
- package/scss/utilities/_general.scss +12 -19
- package/scss/utilities/_grid.scss +44 -126
- package/scss/utilities/_opacity.scss +8 -0
- package/scss/utilities/_position.scss +15 -14
- package/scss/utilities/_sizes.scss +24 -34
- package/scss/utilities/_spacing.scss +53 -29
- package/scss/utilities/_state.scss +7 -0
- package/scss/utilities/_text.scss +39 -12
- package/scss/utilities/_themes.scss +46 -35
- package/scss/utilities/_transition.scss +5 -0
- package/scss/utilities/_translate.scss +32 -0
- package/public/images/hero-lg.jpg +0 -0
- package/public/images/hero-md.jpg +0 -0
- package/public/images/hero-sm.jpg +0 -0
- package/public/images/hero-xl.jpg +0 -0
- package/public/images/logo-alt.svg +0 -24
- package/public/images/logo.png +0 -0
- package/public/images/painting.jpg +0 -0
- package/scss/_play.scss +0 -34
- package/scss/functions/_setTextColor.scss +0 -12
- package/tests.html +0 -252
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
opacity: 0;
|
|
17
17
|
transform: translateY(-2em);
|
|
18
18
|
top: calc(100% + 4px); // push to bottom of toggle element
|
|
19
|
-
// top: calc(100% + $dropdown-toggle-gap); // push to bottom of toggle element
|
|
20
19
|
left: 0;
|
|
21
20
|
transition: all 0.1s ease-in-out 1s, visibility 0s linear 0.1s, z-index 0s linear 0.01s;
|
|
22
21
|
z-index: 1000;
|
|
@@ -33,14 +32,3 @@
|
|
|
33
32
|
transition-delay: 0s, 0s, 0.1s; // this removes the transition delay so the menu will be visible while the other styles transition
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
// ?????????????
|
|
38
|
-
.dd-item {
|
|
39
|
-
letter-spacing: -0.025em;
|
|
40
|
-
line-height: 1.25rem;
|
|
41
|
-
padding: 0.25rem 0.75rem;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.dd-item:hover {
|
|
45
|
-
background-color: rgb(243, 244, 246);
|
|
46
|
-
}
|
|
@@ -16,7 +16,7 @@ $hero-gradient: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4));
|
|
|
16
16
|
font-size: 2.25rem;
|
|
17
17
|
|
|
18
18
|
// font size never is or will be a one size fits all! STOP changing!!!
|
|
19
|
-
@include from-
|
|
19
|
+
@include from-md {
|
|
20
20
|
font-size: 3rem;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -27,7 +27,7 @@ $hero-gradient: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4));
|
|
|
27
27
|
color: $hero-subtitle-color;
|
|
28
28
|
font-size: 1.5rem;
|
|
29
29
|
|
|
30
|
-
@include from-
|
|
30
|
+
@include from-xl {
|
|
31
31
|
font-size: 2.1rem;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
@use '../base/vars_all' as *;
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
// 1. aligns better
|
|
4
|
+
// 1. aligns better text to text when inline
|
|
5
5
|
// 2. better alignment rather than changing size
|
|
6
6
|
|
|
7
7
|
.#{$icon-class} {
|
|
8
8
|
width: $icon-xy;
|
|
9
9
|
height: $icon-xy;
|
|
10
|
-
// align-items: center;
|
|
11
|
-
// display: inline-flex;
|
|
12
|
-
// justify-content: center;
|
|
13
10
|
vertical-align: bottom; // 1
|
|
14
11
|
color: $icon-color;
|
|
15
12
|
padding: 2px; // 2
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@use "../base/vars_colors" as *;
|
|
2
|
+
@use "../base/vars_components" as *;
|
|
3
|
+
|
|
4
|
+
// --------------------------------------------------------------------------
|
|
5
|
+
// -- TICK ICON LIST --
|
|
6
|
+
// --------------------------------------------------------------------------
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
.icon-list {
|
|
10
|
+
// leave as fallback?
|
|
11
|
+
// list-style: none;
|
|
12
|
+
ul {
|
|
13
|
+
margin-left: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:where(svg) {
|
|
17
|
+
margin-right: 1rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
& li {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
background-repeat: no-repeat;
|
|
24
|
+
background-position: left center;
|
|
25
|
+
padding-block: 0.25rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.tick-svg li {
|
|
29
|
+
background-image: $icon-tick;
|
|
30
|
+
padding-left: 2rem;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use "../base/vars_all" as *;
|
|
2
|
-
@use "../functions/
|
|
2
|
+
@use "../functions/colorFunctions" as *;
|
|
3
3
|
|
|
4
4
|
.menu {
|
|
5
5
|
flex-wrap: wrap;
|
|
@@ -7,23 +7,29 @@
|
|
|
7
7
|
flex-direction: column;
|
|
8
8
|
line-height: 1.25;
|
|
9
9
|
list-style: none;
|
|
10
|
+
margin-left: 0; // remove margin for ul
|
|
10
11
|
|
|
11
|
-
// add div to
|
|
12
12
|
:where(a, li a, .menu-item) {
|
|
13
|
-
color:
|
|
13
|
+
color: inherit;
|
|
14
14
|
padding: $menu-padding-y $menu-padding-x;
|
|
15
|
-
display
|
|
15
|
+
// this was initially set to display block but it is too difficult to
|
|
16
|
+
// work with icons and chevrons on the anchor element.
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
16
19
|
|
|
20
|
+
&.active,
|
|
17
21
|
&:hover {
|
|
22
|
+
cursor: pointer;
|
|
18
23
|
color: $menu-link-hover-color;
|
|
19
|
-
background: $menu-hover-bg;
|
|
24
|
+
background-color: $menu-hover-bg;
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
.menu-title {
|
|
24
29
|
font-weight: 600;
|
|
25
|
-
color: #7a7a7a;
|
|
26
30
|
letter-spacing: 0.05em;
|
|
31
|
+
margin-left: $menu-padding-x;
|
|
32
|
+
margin-bottom: 0.5em;
|
|
27
33
|
|
|
28
34
|
&:not(:first-child) {
|
|
29
35
|
margin-top: $content-gap;
|
|
@@ -11,8 +11,15 @@
|
|
|
11
11
|
background: $navbar-bg;
|
|
12
12
|
padding: $navbar-padding-y $navbar-padding-x;
|
|
13
13
|
position: relative;
|
|
14
|
+
box-shadow: 1px 2px 5px #2a2a2b;
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
li {
|
|
17
|
+
list-style: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
nav,
|
|
21
|
+
ul {
|
|
22
|
+
margin: 0; // this may be a problem for nested elements
|
|
16
23
|
display: flex;
|
|
17
24
|
}
|
|
18
25
|
|
|
@@ -20,7 +27,7 @@
|
|
|
20
27
|
padding: $navbar-nav-padding-y $navbar-nav-padding-x;
|
|
21
28
|
display: block; // 1. allowing the navbar to grow in height
|
|
22
29
|
background: $navbar-nav-item-bg;
|
|
23
|
-
color: $navbar-nav-
|
|
30
|
+
color: $navbar-nav-item-color;
|
|
24
31
|
line-height: 1.2rem;
|
|
25
32
|
|
|
26
33
|
&:hover {
|
|
@@ -29,6 +36,7 @@
|
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
&.active {
|
|
39
|
+
color: $navbar-nav-active-color;
|
|
32
40
|
background: $navbar-nav-active-bg;
|
|
33
41
|
}
|
|
34
42
|
}
|
|
@@ -24,21 +24,16 @@
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
// ==========================================================================
|
|
28
|
-
// -- Badge --
|
|
29
|
-
// ==========================================================================
|
|
30
27
|
.badge {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
right:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
border: 1px solid hsl(354, 70%, 44%);
|
|
43
|
-
color: rgb(255, 255, 255);
|
|
28
|
+
// font-size: 0.75em;
|
|
29
|
+
// padding-left: 0.25em;
|
|
30
|
+
// padding-right: 0.25em;
|
|
31
|
+
// padding-top: 0.25em;
|
|
32
|
+
// padding-bottom: 0.25em;
|
|
33
|
+
|
|
34
|
+
padding: 0.25em 0.4em;
|
|
35
|
+
font-size: .7rem;
|
|
36
|
+
line-height: 1;
|
|
37
|
+
text-align: center;
|
|
38
|
+
border-radius: 0.25rem;
|
|
44
39
|
}
|
|
@@ -3,10 +3,24 @@
|
|
|
3
3
|
left: 0;
|
|
4
4
|
top: 0;
|
|
5
5
|
bottom: 0;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
right: 0;
|
|
7
|
+
// width: 100%;
|
|
8
|
+
// max-width: 360px;
|
|
9
|
+
// z-index: 1000;
|
|
10
|
+
// overflow-y: auto;
|
|
11
|
+
// outline: none;
|
|
12
|
+
// transition: transform 0.25s ease-in-out;
|
|
13
|
+
z-index: 500;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.overlay {
|
|
17
|
+
position: fixed;
|
|
18
|
+
top: 0;
|
|
19
|
+
bottom: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
right: 0;
|
|
9
22
|
overflow-y: auto;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
23
|
+
background: rgba(0, 0, 0, 0.7);
|
|
24
|
+
z-index: 30;
|
|
25
|
+
margin: 0;
|
|
26
|
+
}
|
package/scss/forms/_form.scss
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
// @use "../base/vars_base" as *;
|
|
5
5
|
|
|
6
|
-
$placeholder-color: #bbbbbb !default;
|
|
7
|
-
|
|
8
6
|
// -- Base Elements --
|
|
9
7
|
// ==========================================================================
|
|
10
8
|
label {
|
|
@@ -26,12 +24,6 @@ select {
|
|
|
26
24
|
cursor: pointer;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
|
-
::placeholder {
|
|
30
|
-
color: $placeholder-color;
|
|
31
|
-
opacity: 1;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//
|
|
35
27
|
.checkbox,
|
|
36
28
|
.radio {
|
|
37
29
|
cursor: pointer;
|
|
@@ -41,6 +33,7 @@ select {
|
|
|
41
33
|
|
|
42
34
|
// -- frm-row --
|
|
43
35
|
// ==========================================================================
|
|
36
|
+
|
|
44
37
|
.frm-row {
|
|
45
38
|
position: relative;
|
|
46
39
|
display: flex;
|
|
@@ -57,7 +50,11 @@ select {
|
|
|
57
50
|
gap: 1rem;
|
|
58
51
|
|
|
59
52
|
label {
|
|
60
|
-
width
|
|
53
|
+
// exclude width class to make it easier to override or
|
|
54
|
+
// can also use flex-basis to override width
|
|
55
|
+
&:not([class*="w-"]) {
|
|
56
|
+
width: 10rem;
|
|
57
|
+
}
|
|
61
58
|
flex-shrink: 0; // prevent shrink for 100%
|
|
62
59
|
margin-top: 4px; // better alignment
|
|
63
60
|
}
|
|
@@ -98,8 +95,7 @@ select {
|
|
|
98
95
|
}
|
|
99
96
|
}
|
|
100
97
|
|
|
101
|
-
|
|
102
|
-
.withAddons:has(.leadingAddon){
|
|
98
|
+
.withAddons:has(.leadingAddon) {
|
|
103
99
|
background: green;
|
|
104
100
|
}
|
|
105
101
|
// the width of the addon will vary depending on the content
|
package/scss/forms/_index.scss
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
@use "../utilities/display_visibility" as *;
|
|
2
|
+
@use "../utilities/transition" as *;
|
|
3
|
+
|
|
4
|
+
$toggle-body-height: 1.5rem;
|
|
5
|
+
$toggle-body-width: 3rem;
|
|
6
|
+
$toggle-gap: 0.25rem;
|
|
7
|
+
|
|
8
|
+
.toggle {
|
|
9
|
+
position: relative;
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
|
|
14
|
+
input[type="checkbox"] {
|
|
15
|
+
height: 0;
|
|
16
|
+
width: 0;
|
|
17
|
+
visibility: hidden;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// toggle body
|
|
21
|
+
div {
|
|
22
|
+
border-radius: 9999px;
|
|
23
|
+
width: $toggle-body-width;
|
|
24
|
+
height: $toggle-body-height;
|
|
25
|
+
background-color: hsl(0deg, 0%, 90%);
|
|
26
|
+
|
|
27
|
+
// toggle off
|
|
28
|
+
&::after {
|
|
29
|
+
position: absolute;
|
|
30
|
+
content: "";
|
|
31
|
+
height: calc($toggle-body-height - $toggle-gap);
|
|
32
|
+
width: calc($toggle-body-height - $toggle-gap);
|
|
33
|
+
top: calc($toggle-gap / 2);
|
|
34
|
+
left: calc($toggle-gap + $toggle-gap / 2);
|
|
35
|
+
// left: calc($toggle-gap + .1125rem);
|
|
36
|
+
background-color: hsl(0, 0%, 100%);
|
|
37
|
+
border-color: rgba(0, 0, 0, 0.15);
|
|
38
|
+
border-radius: 9999px;
|
|
39
|
+
border-width: 1px;
|
|
40
|
+
@extend .transition;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
input[type="checkbox"]:checked {
|
|
45
|
+
// toggle body on (checked)
|
|
46
|
+
~ div {
|
|
47
|
+
background-color: hsl(100, 70%, 40%);
|
|
48
|
+
@extend .transition;
|
|
49
|
+
// toggle when checked
|
|
50
|
+
&::after {
|
|
51
|
+
// background-color: hsl(50, 10%, 10%);
|
|
52
|
+
transform: translateX(calc($toggle-body-width - $toggle-body-height));
|
|
53
|
+
@extend .transition;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@use "../base/vars_base" as *;
|
|
2
|
+
|
|
3
|
+
// set text colour based on the background
|
|
4
|
+
// --------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
@function setTextColor($bg-color) {
|
|
7
|
+
@if (lightness($bg-color) > 60) {
|
|
8
|
+
@return $base-color;
|
|
9
|
+
} @else {
|
|
10
|
+
@return #fff;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// --------------------------------------------------------------
|
|
15
|
+
// -- CONVERT COLOR TO RGBA --
|
|
16
|
+
// --------------------------------------------------------------
|
|
17
|
+
// will convert when passing in rgb, hex or hsl
|
|
18
|
+
//
|
|
19
|
+
// manually set a colour to convert
|
|
20
|
+
// background-color: convertToRgba(#e23465);
|
|
21
|
+
//
|
|
22
|
+
// optionally set the opacity
|
|
23
|
+
// background-color: convertToRgba(#e23465, 0.5);
|
|
24
|
+
//
|
|
25
|
+
// fetch a color from the color-map
|
|
26
|
+
// background-color: convertToRgba(map-get($color-map, 'blue'));
|
|
27
|
+
|
|
28
|
+
@function convertToRgba($color, $alpha: 1) {
|
|
29
|
+
@return rgba(red($color), green($color), blue($color), $alpha);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
package/scss/jtb.scss
CHANGED
|
@@ -13,28 +13,32 @@
|
|
|
13
13
|
@forward "nk";
|
|
14
14
|
@forward "forms";
|
|
15
15
|
|
|
16
|
-
|
|
17
16
|
@forward "components/accordion";
|
|
18
17
|
@forward "components/box";
|
|
19
18
|
@forward "components/button";
|
|
20
19
|
@forward "components/dropdown";
|
|
21
20
|
@forward "components/hero"; // has problems with img
|
|
22
21
|
@forward "components/icon";
|
|
22
|
+
@forward "components/list";
|
|
23
23
|
@forward "components/menu";
|
|
24
24
|
@forward "components/navbar";
|
|
25
25
|
@forward "components/other";
|
|
26
26
|
@forward "components/sidebar";
|
|
27
27
|
|
|
28
|
+
// this is completly optional
|
|
29
|
+
// @forward "layouts/_two-column";
|
|
28
30
|
|
|
29
31
|
@forward "utilities/border";
|
|
30
32
|
@forward "utilities/display_visibility";
|
|
31
33
|
@forward "utilities/flex";
|
|
32
34
|
@forward "utilities/general";
|
|
33
35
|
@forward "utilities/grid";
|
|
36
|
+
@forward "utilities/opacity";
|
|
34
37
|
@forward "utilities/position";
|
|
35
38
|
@forward "utilities/sizes";
|
|
36
39
|
@forward "utilities/spacing";
|
|
37
40
|
@forward "utilities/state";
|
|
38
41
|
@forward "utilities/text";
|
|
39
42
|
@forward "utilities/themes";
|
|
40
|
-
|
|
43
|
+
@forward "utilities/transition";
|
|
44
|
+
@forward "utilities/translate";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@use "../mixins/media" as *;
|
|
2
|
+
@use "../base/vars_base" as *;
|
|
3
|
+
|
|
4
|
+
// These are common design patterns layouts
|
|
5
|
+
|
|
6
|
+
// add reverse to swap column positions or use order utility classes??
|
|
7
|
+
|
|
8
|
+
// utility structure
|
|
9
|
+
|
|
10
|
+
// <div class="flex-col md:flex-row gg">
|
|
11
|
+
// <div class="w-24-full"></div>
|
|
12
|
+
// <div class="fg1"></div>
|
|
13
|
+
// </div>
|
|
14
|
+
|
|
15
|
+
// TEST: can i still override??
|
|
16
|
+
.two-column {
|
|
17
|
+
display: flex;
|
|
18
|
+
// gap: 3rem;
|
|
19
|
+
|
|
20
|
+
// > div {
|
|
21
|
+
// flex: 1;
|
|
22
|
+
// }
|
|
23
|
+
|
|
24
|
+
// aside {
|
|
25
|
+
// width: 24rem;
|
|
26
|
+
// flex: 0 1 100%;
|
|
27
|
+
// }
|
|
28
|
+
|
|
29
|
+
// @include to-lg {
|
|
30
|
+
// flex-direction: column;
|
|
31
|
+
// }
|
|
32
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@use "../base/vars_all" as *; // required to set defaults
|
|
2
2
|
@use "../mixins/colorSchemeSimple" as *;
|
|
3
|
-
@use "../functions/
|
|
3
|
+
@use "../functions/colorFunctions" as *;
|
|
4
4
|
|
|
5
5
|
// The minimum requirement for creating a theme-map is the $base
|
|
6
6
|
// color, all other properties can be created intuitively.
|
|
@@ -13,9 +13,12 @@
|
|
|
13
13
|
// --------------------------------------------------------------
|
|
14
14
|
// -- CREATE SINGLE CSS PROPERTY --
|
|
15
15
|
// --------------------------------------------------------------
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
// creates a single size based properties. if the situation arises when you do
|
|
17
|
+
// not need a unit, re-write with conditional
|
|
18
|
+
@mixin makeCssProperty($property, $value, $unit: null) {
|
|
19
|
+
$val: if($value == "full", 100, $value);
|
|
20
|
+
$u: if($value == "full", "%", $unit);
|
|
21
|
+
#{$property}: #{$val}#{$u};
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
// --------------------------------------------------------------
|
|
@@ -26,3 +29,5 @@
|
|
|
26
29
|
#{$property}: $value;
|
|
27
30
|
}
|
|
28
31
|
}
|
|
32
|
+
|
|
33
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@use "./media" as *;
|
|
2
|
+
@use "./makeCssPropertyMixins" as *;
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:map";
|
|
5
|
+
@use "sass:string";
|
|
6
|
+
|
|
7
|
+
// Make magic responsive class for a single css property.
|
|
8
|
+
//
|
|
9
|
+
// accepts single css property with list of lists with responsive sizes
|
|
10
|
+
|
|
11
|
+
@mixin makeMagicClass($property, $prefix, $listOfLists, $unit: rem) {
|
|
12
|
+
// must have at least two list
|
|
13
|
+
@each $list in $listOfLists {
|
|
14
|
+
// exclude empty list when creating single list
|
|
15
|
+
@if ($list != ()) {
|
|
16
|
+
$numBreakPoints: list.length($list);
|
|
17
|
+
|
|
18
|
+
// set the value of the BP based on position using negative
|
|
19
|
+
// numbers. This makes sure the position is always the same
|
|
20
|
+
$smValue: nth($list, -1);
|
|
21
|
+
$mdValue: nth($list, -2);
|
|
22
|
+
$lgValue: if($numBreakPoints >= 3, nth($list, -3), null);
|
|
23
|
+
$xlValue: if($numBreakPoints >= 4, nth($list, -4), null);
|
|
24
|
+
$xxlValue: if($numBreakPoints >= 5, nth($list, -5), null);
|
|
25
|
+
|
|
26
|
+
$derived-class: #{$mdValue}-#{$smValue};
|
|
27
|
+
|
|
28
|
+
@if ($numBreakPoints == 3) {
|
|
29
|
+
$derived-class: #{$lgValue}-#{$mdValue}-#{$smValue};
|
|
30
|
+
} @else if ($numBreakPoints == 4) {
|
|
31
|
+
$derived-class: #{$xlValue}-#{$lgValue}-#{$mdValue}-#{$smValue};
|
|
32
|
+
} @else if ($numBreakPoints == 5) {
|
|
33
|
+
$derived-class: #{$xxlValue}-#{$xlValue}-#{$lgValue}-#{$mdValue}-#{$smValue};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.#{$prefix}-#{$derived-class} {
|
|
37
|
+
@include from-sm {
|
|
38
|
+
@include makeCssProperty($property, $smValue, $unit);
|
|
39
|
+
}
|
|
40
|
+
@include from-md {
|
|
41
|
+
@include makeCssProperty($property, $mdValue, $unit);
|
|
42
|
+
}
|
|
43
|
+
@if ($numBreakPoints >= 3) {
|
|
44
|
+
@include from-lg {
|
|
45
|
+
@include makeCssProperty($property, $lgValue, $unit);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
@if ($numBreakPoints >= 4) {
|
|
49
|
+
@include from-xl {
|
|
50
|
+
@include makeCssProperty($property, $xlValue, $unit);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
@if ($numBreakPoints >= 5) {
|
|
54
|
+
@include from-xxl {
|
|
55
|
+
@include makeCssProperty($property, $xxlValue,$unit);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
@use "../base/vars_utility_maps" as *;
|
|
2
|
+
@use "../mixins/media" as *;
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
|
|
5
|
+
// mobile = 100
|
|
6
|
+
// small = 100
|
|
7
|
+
// medium = 50
|
|
8
|
+
// large = 30
|
|
9
|
+
|
|
10
|
+
// only need to add 1st column percentage, 2nd is calculated
|
|
11
|
+
// (25, 25) is shorthand for {25:75}_{25:75}_{100}
|
|
12
|
+
|
|
13
|
+
// The more sizes you add will cover more breakpoints.
|
|
14
|
+
|
|
15
|
+
// There is no need to specify a size for the smallest breakpoint as it will be automatically set to 100 percent in the make function.
|
|
16
|
+
|
|
17
|
+
// For example, if there are 2 sizes in the list there will be 3 breakpoints lg, md, and sm.
|
|
18
|
+
|
|
19
|
+
// In this example, only the first column width has been set as the second column width will be calculate and included automatically.
|
|
20
|
+
|
|
21
|
+
// Grid will display in rows by default, size are min-size so you do not need to worry about adding the smallest size as it will be 100% by default
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@mixin makeMagicGrid2Cols($listOfLists) {
|
|
25
|
+
// must have at least two list
|
|
26
|
+
@each $list in $listOfLists {
|
|
27
|
+
// exclude empty list when creating single list
|
|
28
|
+
@if ($list != ()) {
|
|
29
|
+
$numBreakPoints: list.length($list);
|
|
30
|
+
|
|
31
|
+
$smValue: nth($list, -1);
|
|
32
|
+
$mdValue: nth($list, -2);
|
|
33
|
+
$lgValue: if($numBreakPoints >= 3, nth($list, -3), null);
|
|
34
|
+
$xlValue: if($numBreakPoints >= 4, nth($list, -4), null);
|
|
35
|
+
$xxlValue: if($numBreakPoints >= 5, nth($list, -5), null);
|
|
36
|
+
|
|
37
|
+
$class: #{$mdValue}_#{$smValue};
|
|
38
|
+
|
|
39
|
+
@if ($numBreakPoints == 3) {
|
|
40
|
+
$class: #{$lgValue}_#{$mdValue}_#{$smValue};
|
|
41
|
+
} @else if ($numBreakPoints == 4) {
|
|
42
|
+
$class: #{$xlValue}_#{$lgValue}_#{$mdValue}_#{$smValue};
|
|
43
|
+
} @else if ($numBreakPoints == 5) {
|
|
44
|
+
$class: #{$xxlValue}_#{$xlValue}_#{$lgValue}_#{$mdValue}_#{$smValue};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.cols-#{$class} {
|
|
48
|
+
@include from-sm {
|
|
49
|
+
grid-template-columns: nth(map-get($fr-map-2-col, $smValue), 1) nth(map-get($fr-map-2-col, $smValue), 2);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@include from-md {
|
|
53
|
+
grid-template-columns: nth(map-get($fr-map-2-col, $mdValue), 1) nth(map-get($fr-map-2-col, $mdValue), 2);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@if ($numBreakPoints >= 3) {
|
|
57
|
+
@include from-lg {
|
|
58
|
+
grid-template-columns: nth(map-get($fr-map-2-col, $lgValue), 1) nth(map-get($fr-map-2-col, $lgValue), 2);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@if ($numBreakPoints >= 4) {
|
|
63
|
+
@include from-xl {
|
|
64
|
+
grid-template-columns: nth(map-get($fr-map-2-col, $xlValue), 1) nth(map-get($fr-map-2-col, $xlValue), 2);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|