@madj2k/fe-frontend-kit 2.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/index.js +7 -0
- package/index.scss +6 -0
- package/menus/flyout-menu/flyout-menu-2.0.0.js +331 -0
- package/menus/flyout-menu/flyout-menu-2.0.0.scss +47 -0
- package/menus/flyout-menu/index.js +2 -0
- package/menus/flyout-menu/index.scss +1 -0
- package/menus/pulldown-menu/index.js +2 -0
- package/menus/pulldown-menu/index.scss +1 -0
- package/menus/pulldown-menu/pulldown-menu-2.0.0.js +196 -0
- package/menus/pulldown-menu/pulldown-menu-2.0.0.scss +33 -0
- package/package.json +31 -0
- package/readme.md +218 -0
- package/sass/bootstrap-5.3.0/00_mixins/_accessibility.scss +42 -0
- package/sass/bootstrap-5.3.0/00_mixins/_colors.scss +99 -0
- package/sass/bootstrap-5.3.0/00_mixins/_effects.scss +45 -0
- package/sass/bootstrap-5.3.0/00_mixins/_flex-box.scss +104 -0
- package/sass/bootstrap-5.3.0/00_mixins/_form.scss +164 -0
- package/sass/bootstrap-5.3.0/00_mixins/_format.scss +208 -0
- package/sass/bootstrap-5.3.0/00_mixins/_icons.scss +129 -0
- package/sass/bootstrap-5.3.0/00_mixins/_nav.scss +327 -0
- package/sass/bootstrap-5.3.0/00_mixins/_page.scss +261 -0
- package/sass/bootstrap-5.3.0/00_mixins/_section.scss +111 -0
- package/sass/bootstrap-5.3.0/00_mixins/_toggle-list.scss +133 -0
- package/sass/bootstrap-5.3.0/00_mixins/_unit.scss +51 -0
- package/sass/bootstrap-5.3.0/10_config/_colors.scss +17 -0
- package/sass/bootstrap-5.3.0/10_config/_font.scss +228 -0
- package/sass/bootstrap-5.3.0/10_config/_maps.scss +51 -0
- package/sass/bootstrap-5.3.0/index.scss +20 -0
- package/tools/owl/index.js +2 -0
- package/tools/owl/index.scss +1 -0
- package/tools/owl/owl-thumbnail-2.0.0.js +355 -0
- package/tools/owl/owl-thumbnail-2.0.0.scss +0 -0
- package/tools/resize-end/index.js +2 -0
- package/tools/resize-end/index.scss +1 -0
- package/tools/resize-end/resize-end-2.0.0.js +108 -0
- package/tools/resize-end/resize-end-2.0.0.scss +10 -0
- package/tools/scrolling/index.js +2 -0
- package/tools/scrolling/index.scss +1 -0
- package/tools/scrolling/scrolling-2.0.0.js +244 -0
- package/tools/scrolling/scrolling-2.0.0.scss +10 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/// Applies responsive font-size and line-height for a given font style from the `$font-formats` map.
|
|
2
|
+
///
|
|
3
|
+
/// Supports multiple breakpoints: mobile, tablet, and desktop. default is the fallback
|
|
4
|
+
/// Used as a base mixin for semantic text styles like `h1`, `copy`, etc.
|
|
5
|
+
///
|
|
6
|
+
/// @group Typography
|
|
7
|
+
/// @param {String} $font-format - The key name of the format to apply (e.g., 'h1', 'copy-small').
|
|
8
|
+
/// @param {Map} $font-formats - A map of font style definitions. Defaults to the global `$font-formats` map.
|
|
9
|
+
///
|
|
10
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
11
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
12
|
+
///
|
|
13
|
+
@mixin font-format($font-format: 'h1', $font-formats: $font-formats) {
|
|
14
|
+
$format-data: map-get($font-formats, $font-format);
|
|
15
|
+
$mobile-data: map-get($format-data, 'mobile');
|
|
16
|
+
$default-data: map-get($format-data, 'default');
|
|
17
|
+
$keys: map-keys(if($mobile-data, $mobile-data, $default-data));
|
|
18
|
+
|
|
19
|
+
@each $key in $keys {
|
|
20
|
+
$value: if($mobile-data,
|
|
21
|
+
map-get($mobile-data, $key),
|
|
22
|
+
map-get($default-data, $key)
|
|
23
|
+
);
|
|
24
|
+
#{$key}: $value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@if map-has-key($format-data, 'tablet') {
|
|
28
|
+
@include media-breakpoint-up(lg) {
|
|
29
|
+
@each $key in $keys {
|
|
30
|
+
#{$key}: map-get(map-get($format-data, 'tablet'), $key);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@if map-has-key($format-data, 'desktop') {
|
|
36
|
+
@include media-breakpoint-up(xl) {
|
|
37
|
+
@each $key in $keys {
|
|
38
|
+
#{$key}: map-get(map-get($format-data, 'desktop'), $key);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/// Typography style for `<h1>` elements.
|
|
45
|
+
///
|
|
46
|
+
/// @group Typography
|
|
47
|
+
///
|
|
48
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
49
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
50
|
+
///
|
|
51
|
+
@mixin h1 {
|
|
52
|
+
@include font-format('h1');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/// Typography style for `<h2>` elements.
|
|
56
|
+
///
|
|
57
|
+
/// @group Typography
|
|
58
|
+
///
|
|
59
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
60
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
61
|
+
///
|
|
62
|
+
@mixin h2 {
|
|
63
|
+
@include font-format('h2');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/// Typography style for `<h3>` elements.
|
|
67
|
+
///
|
|
68
|
+
/// @group Typography
|
|
69
|
+
///
|
|
70
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
71
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
72
|
+
///
|
|
73
|
+
@mixin h3 {
|
|
74
|
+
@include font-format('h3');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/// Typography style for `<h4>` elements.
|
|
78
|
+
///
|
|
79
|
+
/// @group Typography
|
|
80
|
+
///
|
|
81
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
82
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
83
|
+
///
|
|
84
|
+
@mixin h4 {
|
|
85
|
+
@include font-format('h4');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/// Typography style for `<h5>` elements.
|
|
89
|
+
///
|
|
90
|
+
/// @group Typography
|
|
91
|
+
///
|
|
92
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
93
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
94
|
+
///
|
|
95
|
+
@mixin h5 {
|
|
96
|
+
@include font-format('h5');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/// Typography style for `<h6>` elements.
|
|
100
|
+
///
|
|
101
|
+
/// @group Typography
|
|
102
|
+
///
|
|
103
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
104
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
105
|
+
///
|
|
106
|
+
@mixin h6 {
|
|
107
|
+
@include font-format('h6');
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
/// Typography style for body copy text.
|
|
112
|
+
///
|
|
113
|
+
/// @group Typography
|
|
114
|
+
///
|
|
115
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
116
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
117
|
+
///
|
|
118
|
+
@mixin copy {
|
|
119
|
+
@include font-format('copy');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/// Typography style for small body copy.
|
|
123
|
+
///
|
|
124
|
+
/// @group Typography
|
|
125
|
+
///
|
|
126
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
127
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
128
|
+
///
|
|
129
|
+
@mixin copy-small {
|
|
130
|
+
@include font-format('copy-small');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/// Typography style for links (without additional decoration).
|
|
134
|
+
///
|
|
135
|
+
/// @group Typography
|
|
136
|
+
///
|
|
137
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
138
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
139
|
+
///
|
|
140
|
+
@mixin link {
|
|
141
|
+
@include font-format('link');
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/// Typography style for overline/captions.
|
|
145
|
+
///
|
|
146
|
+
/// @group Typography
|
|
147
|
+
///
|
|
148
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
149
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
150
|
+
///
|
|
151
|
+
@mixin overline {
|
|
152
|
+
@include font-format('overline');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/// Typography style for subheaders.
|
|
156
|
+
///
|
|
157
|
+
/// @group Typography
|
|
158
|
+
///
|
|
159
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
160
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
161
|
+
///
|
|
162
|
+
@mixin subheader {
|
|
163
|
+
@include font-format('subheader');
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/// Applies typographic styles for bold text using the bold font family.
|
|
167
|
+
///
|
|
168
|
+
/// @group Utilities
|
|
169
|
+
///
|
|
170
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
171
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
172
|
+
///
|
|
173
|
+
@mixin bold {
|
|
174
|
+
@include font-format('bold');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/// Enables word breaking and hyphenation for improved long text handling.
|
|
178
|
+
///
|
|
179
|
+
/// Works across modern and legacy browsers.
|
|
180
|
+
///
|
|
181
|
+
/// @group Utilities
|
|
182
|
+
///
|
|
183
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
184
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
185
|
+
///
|
|
186
|
+
@mixin hyphenate() {
|
|
187
|
+
overflow-wrap: break-word;
|
|
188
|
+
word-break: break-word;
|
|
189
|
+
-webkit-hyphens: auto;
|
|
190
|
+
-ms-hyphens: auto;
|
|
191
|
+
-moz-hyphens: auto;
|
|
192
|
+
hyphens: auto;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/// Resets list styles: removes bullets and spacing.
|
|
196
|
+
///
|
|
197
|
+
/// Useful for unstyled lists or when customizing lists from scratch.
|
|
198
|
+
///
|
|
199
|
+
/// @group Utilities
|
|
200
|
+
///
|
|
201
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
202
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
203
|
+
///
|
|
204
|
+
@mixin list-reset {
|
|
205
|
+
list-style: none;
|
|
206
|
+
margin: 0;
|
|
207
|
+
padding: 0;
|
|
208
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/// Adds flexible icon+label spacing to inline elements, only if both icon and text are present.
|
|
2
|
+
///
|
|
3
|
+
/// Applies `display: flex` and controlled `margin` on icon spans to create spacing.
|
|
4
|
+
/// Avoids using `gap` to ensure no unintended spacing when only one element is present.
|
|
5
|
+
///
|
|
6
|
+
/// Designed for icon-label patterns such as buttons, links or text blocks.
|
|
7
|
+
///
|
|
8
|
+
/// @group Utilities
|
|
9
|
+
///
|
|
10
|
+
/// @param {Map} $selectors-map - HTML elements to which the behavior should apply, with optional filters.
|
|
11
|
+
/// @param {Number} $margin - Margin between icon and text in rem units. Default: 10.
|
|
12
|
+
///
|
|
13
|
+
/// @example scss
|
|
14
|
+
/// @include flex-icon();
|
|
15
|
+
///
|
|
16
|
+
/// @example html
|
|
17
|
+
/// <a href="#">
|
|
18
|
+
/// <span class="icon icon-xyz"></span>
|
|
19
|
+
/// <span class="label">Open</span>
|
|
20
|
+
/// </a>
|
|
21
|
+
///
|
|
22
|
+
/// <button type="button">
|
|
23
|
+
/// <span class="icon icon-save"></span>
|
|
24
|
+
/// <span>Save</span>
|
|
25
|
+
/// </button>
|
|
26
|
+
///
|
|
27
|
+
/// <a class="flex-icon" href="#">
|
|
28
|
+
/// <span>Text only, but styled like icon-button</span>
|
|
29
|
+
/// </a>
|
|
30
|
+
///
|
|
31
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
32
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
33
|
+
///
|
|
34
|
+
|
|
35
|
+
@mixin flex-icon($selectors-map: (a: ':not(.link-wrap)', p: '', span: '', button: ''), $margin: 10) {
|
|
36
|
+
|
|
37
|
+
.flex-icon {
|
|
38
|
+
text-decoration: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@each $tag, $filter in $selectors-map {
|
|
42
|
+
#{$tag}#{$filter}:has(span.icon):has(span:not(.icon)) {
|
|
43
|
+
display: flex;
|
|
44
|
+
gap: 0;
|
|
45
|
+
align-items: center;
|
|
46
|
+
text-decoration: none;
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
text-decoration: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
span.icon:first-child:not(span.icon:last-child) {
|
|
53
|
+
margin-right: rem-calc($margin);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
span.icon:last-child:not(span.icon:first-child) {
|
|
57
|
+
margin-left: rem-calc($margin);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/// Adds dynamic toggle-icon behavior using `.icon` elements inside toggle containers.
|
|
65
|
+
///
|
|
66
|
+
/// Designed to work with buttons or elements that toggle state (e.g. accordions, lists, dropdowns).
|
|
67
|
+
/// This mixin assumes the presence of two `.icon` elements:
|
|
68
|
+
/// - `.icon.toggle-closed` (default visible)
|
|
69
|
+
/// - `.icon.toggle-opened` (visible only when `[aria-expanded="true"]`)
|
|
70
|
+
///
|
|
71
|
+
/// The `.icon` class enables consistent global styling. The icon must appear **after** the specific class
|
|
72
|
+
/// (e.g. `icon-plus icon`), so `.icon` is always last.
|
|
73
|
+
///
|
|
74
|
+
/// @group Toggle Controls
|
|
75
|
+
///
|
|
76
|
+
/// @param {String} $selector - The selector for the toggle element. Default: `.toggle`
|
|
77
|
+
///
|
|
78
|
+
/// @example scss
|
|
79
|
+
/// @include toggle-icon(); // applies to `.toggle`
|
|
80
|
+
/// @include toggle-icon('.faq-toggle'); // applies to `.faq-toggle`
|
|
81
|
+
///
|
|
82
|
+
/// @example html
|
|
83
|
+
/// <button class="toggle" aria-expanded="false">
|
|
84
|
+
/// <span class="icon icon-plus toggle-closed icon"></span>
|
|
85
|
+
/// <span class="icon icon-minus toggle-opened icon"></span>
|
|
86
|
+
/// <span>More Info</span>
|
|
87
|
+
/// </button>
|
|
88
|
+
///
|
|
89
|
+
/// @author
|
|
90
|
+
/// Steffen Kroggel <developer@steffenkroggel>
|
|
91
|
+
///
|
|
92
|
+
/// @license
|
|
93
|
+
/// GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
94
|
+
///
|
|
95
|
+
@mixin toggle-icon($selector: '.toggle') {
|
|
96
|
+
#{$selector}:has(.icon:first-child) {
|
|
97
|
+
line-height: 1; // icon-only toggle buttons
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
#{$selector}:has(.icon) {
|
|
101
|
+
background-color: transparent;
|
|
102
|
+
border: 0;
|
|
103
|
+
display: inline-block;
|
|
104
|
+
padding: 0;
|
|
105
|
+
|
|
106
|
+
.icon {
|
|
107
|
+
margin-left: 0 !important;
|
|
108
|
+
margin-right: 0 !important;
|
|
109
|
+
|
|
110
|
+
&.toggle-opened {
|
|
111
|
+
display: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&.toggle-closed {
|
|
115
|
+
display: inline-block;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&[aria-expanded="true"] {
|
|
120
|
+
.icon.toggle-opened {
|
|
121
|
+
display: inline-block;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.icon.toggle-closed {
|
|
125
|
+
display: none;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/* ==================================================
|
|
2
|
+
* Nav-block
|
|
3
|
+
* ==================================================*/
|
|
4
|
+
/// Creates a vertically stacked navigation menu with consistent styling.
|
|
5
|
+
///
|
|
6
|
+
/// Features configurable link colors for default and active states.
|
|
7
|
+
/// Links are left-aligned with optional underline on hover.
|
|
8
|
+
///
|
|
9
|
+
/// @group Navigation
|
|
10
|
+
///
|
|
11
|
+
/// @param {Color} $link-color - The color of the default (non-active) links. Defaults to `$color-secondary`.
|
|
12
|
+
/// @param {Color} $active-color - The color of active links. Defaults to `$color-primary`.
|
|
13
|
+
///
|
|
14
|
+
/// @example html
|
|
15
|
+
/// <nav class="nav-block">
|
|
16
|
+
/// <ul class="nav-block-list">
|
|
17
|
+
/// <li class="nav-block-item">
|
|
18
|
+
/// <a href="#" class="nav-block-link">Link 1</a>
|
|
19
|
+
/// </li>
|
|
20
|
+
/// <li class="nav-block-item">
|
|
21
|
+
/// <a href="#" class="nav-block-link active">Link 2</a>
|
|
22
|
+
/// </li>
|
|
23
|
+
/// </ul>
|
|
24
|
+
/// </nav>
|
|
25
|
+
///
|
|
26
|
+
/// @example scss
|
|
27
|
+
/// .nav-block {
|
|
28
|
+
/// @include nav-block($link-color: #888, $active-color: #000);
|
|
29
|
+
/// }
|
|
30
|
+
///
|
|
31
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
32
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
33
|
+
@mixin nav-block(
|
|
34
|
+
$link-color: $color-secondary,
|
|
35
|
+
$active-color: $color-primary
|
|
36
|
+
) {
|
|
37
|
+
|
|
38
|
+
&-list {
|
|
39
|
+
@include list-reset;
|
|
40
|
+
display: block;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&-link,
|
|
44
|
+
&-link:link,
|
|
45
|
+
&-link:visited,
|
|
46
|
+
&-link:hover {
|
|
47
|
+
color: $link-color;
|
|
48
|
+
text-decoration: none;
|
|
49
|
+
text-align: left;
|
|
50
|
+
|
|
51
|
+
&.active {
|
|
52
|
+
color: $active-color;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&-link:hover {
|
|
57
|
+
text-decoration: underline;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* ==================================================
|
|
62
|
+
* Nav-Inline
|
|
63
|
+
* ==================================================*/
|
|
64
|
+
/// Creates a horizontally aligned navigation using a flexbox layout.
|
|
65
|
+
///
|
|
66
|
+
/// Navigation items are displayed in a row with configurable spacing.
|
|
67
|
+
/// Links can have different styles for default and active states.
|
|
68
|
+
///
|
|
69
|
+
/// @group Navigation
|
|
70
|
+
///
|
|
71
|
+
/// @param {Length} $list-gap - The horizontal spacing (gap) between navigation items. Defaults to `$spacer`.
|
|
72
|
+
/// @param {Color} $link-color - The text color of default (inactive) links. Defaults to `$color-secondary`.
|
|
73
|
+
/// @param {Color} $link-active-color - The text color of active links. Defaults to `$color-primary`.
|
|
74
|
+
///
|
|
75
|
+
/// @example html
|
|
76
|
+
/// <nav class="nav-inline">
|
|
77
|
+
/// <ul class="nav-inline-list">
|
|
78
|
+
/// <li class="nav-inline-item">
|
|
79
|
+
/// <a class="nav-inline-link" href="#">Link</a>
|
|
80
|
+
/// </li>
|
|
81
|
+
/// <li class="nav-inline-item">
|
|
82
|
+
/// <a class="nav-inline-link active" href="#">Active Link</a>
|
|
83
|
+
/// </li>
|
|
84
|
+
/// </ul>
|
|
85
|
+
/// </nav>
|
|
86
|
+
///
|
|
87
|
+
/// @example scss
|
|
88
|
+
/// .nav-inline {
|
|
89
|
+
/// @include nav-inline($list-gap: 1rem, $link-color: #666, $link-active-color: #000);
|
|
90
|
+
/// }
|
|
91
|
+
///
|
|
92
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
93
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
94
|
+
///
|
|
95
|
+
@mixin nav-inline(
|
|
96
|
+
$list-gap: $spacer,
|
|
97
|
+
$link-color: $color-secondary,
|
|
98
|
+
$link-active-color: $color-primary
|
|
99
|
+
) {
|
|
100
|
+
&-list {
|
|
101
|
+
@include list-reset;
|
|
102
|
+
display: flex;
|
|
103
|
+
gap: rem-calc($list-gap);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&-link,
|
|
107
|
+
&-link:link,
|
|
108
|
+
&-link:visited,
|
|
109
|
+
&-link:hover {
|
|
110
|
+
color: $link-color;
|
|
111
|
+
text-decoration: none;
|
|
112
|
+
text-align: left;
|
|
113
|
+
|
|
114
|
+
&.active {
|
|
115
|
+
color: $link-active-color;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&-link:hover {
|
|
120
|
+
text-decoration: underline;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* ==================================================
|
|
125
|
+
* Nav-Pulldown
|
|
126
|
+
* ==================================================*/
|
|
127
|
+
/// Creates a dropdown navigation menu that appears below its trigger element.
|
|
128
|
+
///
|
|
129
|
+
/// Features configurable padding, spacing, colors and borders.
|
|
130
|
+
/// The menu is positioned relative to its container and
|
|
131
|
+
/// extends to fit its content width.
|
|
132
|
+
///
|
|
133
|
+
/// @group Navigation
|
|
134
|
+
///
|
|
135
|
+
/// @param {Length} $pad-x - Horizontal padding inside the dropdown container. Defaults to `$spacer`.
|
|
136
|
+
/// @param {Length} $pad-y - Vertical padding inside the dropdown container. Defaults to `0`.
|
|
137
|
+
/// @param {Length} $item-y - Vertical spacing between dropdown items. Defaults to `10`.
|
|
138
|
+
/// @param {Length} $item-gap - Horizontal spacing between content inside items. Defaults to `12`.
|
|
139
|
+
/// @param {Color} $bg-color - Background color of the dropdown. Defaults to `$color-primary`.
|
|
140
|
+
/// @param {Color} $text-color - Text color of the links. Defaults to `$color-white`.
|
|
141
|
+
/// @param {Color} $border-color - Border color of the dropdown container. Defaults to `$color-white`.
|
|
142
|
+
/// @param {Length} $border-width - Border width of the dropdown container. Defaults to `1px`.
|
|
143
|
+
///
|
|
144
|
+
/// @example html
|
|
145
|
+
/// <div class="nav-pulldown">
|
|
146
|
+
/// <ul class="nav-pulldown-list">
|
|
147
|
+
/// <li class="nav-pulldown-list-item">
|
|
148
|
+
/// <a href="#" class="nav-pulldown-link">Link</a>
|
|
149
|
+
/// </li>
|
|
150
|
+
/// </ul>
|
|
151
|
+
/// </div>
|
|
152
|
+
///
|
|
153
|
+
/// @example scss
|
|
154
|
+
/// .nav-pulldown {
|
|
155
|
+
/// @include nav-pulldown(
|
|
156
|
+
/// $pad-x: 1rem,
|
|
157
|
+
/// $pad-y: 0.5rem,
|
|
158
|
+
/// $item-y: 0.75rem,
|
|
159
|
+
/// $item-gap: 1rem,
|
|
160
|
+
/// $bg-color: #333,
|
|
161
|
+
/// $text-color: #fff,
|
|
162
|
+
/// $border-color: #ccc,
|
|
163
|
+
/// $border-width: 2px
|
|
164
|
+
/// );
|
|
165
|
+
/// }
|
|
166
|
+
///
|
|
167
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
168
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
169
|
+
///
|
|
170
|
+
@mixin nav-pulldown(
|
|
171
|
+
$pad-x: $spacer,
|
|
172
|
+
$pad-y: 0,
|
|
173
|
+
$item-y: 10,
|
|
174
|
+
$item-gap: 12,
|
|
175
|
+
$bg-color: $color-primary,
|
|
176
|
+
$text-color: $color-white,
|
|
177
|
+
$border-color: $color-white,
|
|
178
|
+
$border-width: 1px
|
|
179
|
+
) {
|
|
180
|
+
|
|
181
|
+
top: 100%;
|
|
182
|
+
right: rem-calc(($border-width * 2) * -1); // compensation for border
|
|
183
|
+
width: max-content;
|
|
184
|
+
|
|
185
|
+
padding: rem-calc($pad-y) rem-calc($pad-x);
|
|
186
|
+
background-color: $bg-color;
|
|
187
|
+
border: rem-calc($border-width) solid $border-color;
|
|
188
|
+
|
|
189
|
+
&-list {
|
|
190
|
+
@include list-reset;
|
|
191
|
+
|
|
192
|
+
&-item {
|
|
193
|
+
@include copy;
|
|
194
|
+
color: $text-color;
|
|
195
|
+
text-align: left;
|
|
196
|
+
margin-top: rem-calc($item-y);
|
|
197
|
+
margin-bottom: rem-calc($item-y);
|
|
198
|
+
|
|
199
|
+
& + & {
|
|
200
|
+
margin-top: rem-calc($item-gap);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&-link,
|
|
206
|
+
&-link:link,
|
|
207
|
+
&-link:visited,
|
|
208
|
+
&-link:hover {
|
|
209
|
+
color: $text-color;
|
|
210
|
+
text-decoration: none;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
&-link {
|
|
214
|
+
text-decoration: underline;
|
|
215
|
+
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* ==================================================
|
|
220
|
+
* Nav-Toggle
|
|
221
|
+
* ==================================================*/
|
|
222
|
+
/// Creates a button group container for navigation toggles.
|
|
223
|
+
///
|
|
224
|
+
/// Used to align toggle buttons and icons horizontally with spacing.
|
|
225
|
+
/// Useful in responsive navigation headers.
|
|
226
|
+
///
|
|
227
|
+
/// @group Navigation
|
|
228
|
+
///
|
|
229
|
+
/// @param {Length} $gap - The spacing between toggle elements. Defaults to `$spacer`.
|
|
230
|
+
///
|
|
231
|
+
/// @example html
|
|
232
|
+
/// <div class="nav-toggle-group">
|
|
233
|
+
/// <button class="nav-toggle" aria-expanded="false">
|
|
234
|
+
/// <i class="nav-toggle-icon icon-hamburger"></i>
|
|
235
|
+
/// </button>
|
|
236
|
+
/// </div>
|
|
237
|
+
///
|
|
238
|
+
/// @example scss
|
|
239
|
+
/// .nav-toggle-group {
|
|
240
|
+
/// @include nav-toggle-group($gap: 1rem);
|
|
241
|
+
/// }
|
|
242
|
+
///
|
|
243
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
244
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
245
|
+
///
|
|
246
|
+
@mixin nav-toggle-group(
|
|
247
|
+
$gap: $spacer
|
|
248
|
+
) {
|
|
249
|
+
display: flex;
|
|
250
|
+
align-items: center;
|
|
251
|
+
gap: rem-calc($gap);
|
|
252
|
+
height: 100%;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
/// Creates a button element for toggling navigation menus.
|
|
257
|
+
///
|
|
258
|
+
/// Features:
|
|
259
|
+
/// - Accessible button with `aria-expanded` state
|
|
260
|
+
/// - Icon switching based on toggle state (e.g., hamburger to close)
|
|
261
|
+
/// - Configurable icon size and colors
|
|
262
|
+
/// - No default background or borders for flexible styling
|
|
263
|
+
/// - Built-in accessibility outline
|
|
264
|
+
///
|
|
265
|
+
/// @group Navigation
|
|
266
|
+
///
|
|
267
|
+
/// @param {Length} $icon-size - Size of the icon (width/height). Defaults to `$spacer`.
|
|
268
|
+
/// @param {Color} $icon-color - Icon color (e.g., fill or text color). Defaults to `$color-primary`.
|
|
269
|
+
/// @param {Map} $icon-mappings - Map of icon toggle states (e.g., hamburger → close). Defaults to a predefined map.
|
|
270
|
+
///
|
|
271
|
+
/// @example html
|
|
272
|
+
/// <button class="nav-toggle" aria-expanded="false">
|
|
273
|
+
/// <i class="nav-toggle-icon icon-hamburger"></i>
|
|
274
|
+
/// </button>
|
|
275
|
+
///
|
|
276
|
+
/// @example scss
|
|
277
|
+
/// .nav-toggle {
|
|
278
|
+
/// @include nav-toggle(
|
|
279
|
+
/// $icon-size: 1.5rem,
|
|
280
|
+
/// $icon-color: #333,
|
|
281
|
+
/// $icon-mappings: (
|
|
282
|
+
/// "icon-hamburger": "icon-close",
|
|
283
|
+
/// "icon-plus": "icon-minus"
|
|
284
|
+
/// )
|
|
285
|
+
/// );
|
|
286
|
+
/// }
|
|
287
|
+
///
|
|
288
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
289
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
290
|
+
///
|
|
291
|
+
@mixin nav-toggle(
|
|
292
|
+
$icon-size: $spacer,
|
|
293
|
+
$icon-color: $color-primary,
|
|
294
|
+
$icon-mappings: (
|
|
295
|
+
"icon-hamburger": $icon-close,
|
|
296
|
+
"icon-plus": $icon-minus
|
|
297
|
+
)
|
|
298
|
+
) {
|
|
299
|
+
background-color: transparent;
|
|
300
|
+
border: 0;
|
|
301
|
+
margin: 0;
|
|
302
|
+
padding: 0;
|
|
303
|
+
|
|
304
|
+
// accessibility
|
|
305
|
+
@include accessibility-outline();
|
|
306
|
+
|
|
307
|
+
&:has(.nav-toggle-icon) {
|
|
308
|
+
display: flex;
|
|
309
|
+
align-items: center;
|
|
310
|
+
|
|
311
|
+
&[aria-expanded="true"] {
|
|
312
|
+
@each $icon-class, $content in $icon-mappings {
|
|
313
|
+
.#{$icon-class} {
|
|
314
|
+
&:before {
|
|
315
|
+
content: $content;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
&-icon {
|
|
323
|
+
font-size: rem-calc($icon-size);
|
|
324
|
+
width: rem-calc($icon-size);
|
|
325
|
+
color: $icon-color;
|
|
326
|
+
}
|
|
327
|
+
}
|