@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,261 @@
|
|
|
1
|
+
/**! ==================================================
|
|
2
|
+
* Mixin page padding
|
|
3
|
+
* ================================================== */
|
|
4
|
+
@use 'sass:math';
|
|
5
|
+
|
|
6
|
+
/// Adds utility classes for enabling full-width containers with responsive page paddings.
|
|
7
|
+
///
|
|
8
|
+
/// This mixin generates classes that allow a container to break out of the standard Bootstrap layout
|
|
9
|
+
/// while maintaining the grid system and applying consistent horizontal paddings based on breakpoints.
|
|
10
|
+
///
|
|
11
|
+
/// The generated utility classes follow this logic:
|
|
12
|
+
/// - `fullwidth-{breakpoint}-{value}`
|
|
13
|
+
/// - `fullwidth-{value}`
|
|
14
|
+
///
|
|
15
|
+
/// Possible values:
|
|
16
|
+
/// - `0` disables full-width behavior (default layout)
|
|
17
|
+
/// - `1` enables full-width behavior (stretched content with padding)
|
|
18
|
+
///
|
|
19
|
+
/// Use cases include:
|
|
20
|
+
/// - Wrapping containers
|
|
21
|
+
/// - Creating full-width sections inside grid columns
|
|
22
|
+
/// - Layered structures for positioning background images or additional layout control
|
|
23
|
+
///
|
|
24
|
+
/// @group Layout
|
|
25
|
+
///
|
|
26
|
+
/// @param {String} $page-wrap-class - The base class used to wrap the entire page (for context-aware styling). Defaults to `'.page'`.
|
|
27
|
+
/// @param {String} $wrap-class - The base utility class prefix for full-width behavior. Defaults to `'.fullwidth'`.
|
|
28
|
+
/// @param {Length} $default-padding - The default horizontal padding applied when full-width is active. Defaults to `16px`.
|
|
29
|
+
///
|
|
30
|
+
/// @example html
|
|
31
|
+
/// <!-- 1) Around a Bootstrap container -->
|
|
32
|
+
/// <div class="fullwidth-1 fullwidth-md-0 fullwidth-xl-1">
|
|
33
|
+
/// <div class="container-xxl">
|
|
34
|
+
/// [...]
|
|
35
|
+
/// </div>
|
|
36
|
+
/// </div>
|
|
37
|
+
///
|
|
38
|
+
/// @example html
|
|
39
|
+
/// <!-- 1.1) With inner fullwidth container (e.g. for background images) -->
|
|
40
|
+
/// <div class="fullwidth-1 fullwidth-md-0 fullwidth-xl-1">
|
|
41
|
+
/// <div class="fullwidth-inner">
|
|
42
|
+
/// <img src="..." alt="">
|
|
43
|
+
/// </div>
|
|
44
|
+
/// <div class="container-xxl">
|
|
45
|
+
/// [...]
|
|
46
|
+
/// </div>
|
|
47
|
+
/// </div>
|
|
48
|
+
///
|
|
49
|
+
/// @example html
|
|
50
|
+
/// <!-- 1.2) Inside a positioned element with padding wrapper -->
|
|
51
|
+
/// <div class="fullwidth-1 fullwidth-md-0 fullwidth-xl-1">
|
|
52
|
+
/// <div class="fullwidth-inner position-relative">
|
|
53
|
+
/// <div class="position-absolute">
|
|
54
|
+
/// <div class="fullwidth-padding">
|
|
55
|
+
/// <div class="container-xxl">
|
|
56
|
+
/// [...]
|
|
57
|
+
/// </div>
|
|
58
|
+
/// </div>
|
|
59
|
+
/// </div>
|
|
60
|
+
/// </div>
|
|
61
|
+
/// </div>
|
|
62
|
+
///
|
|
63
|
+
/// @example html
|
|
64
|
+
/// <!-- 2) Inside a column (e.g. col-12) -->
|
|
65
|
+
/// <div class="container-xxl">
|
|
66
|
+
/// <div class="row">
|
|
67
|
+
/// <div class="col-12 col-lg-7 order-lg-3">
|
|
68
|
+
/// <div class="fullwidth-1 fullwidth-md-0 fullwidth-xl-1">
|
|
69
|
+
/// [...]
|
|
70
|
+
/// </div>
|
|
71
|
+
/// </div>
|
|
72
|
+
/// </div>
|
|
73
|
+
/// </div>
|
|
74
|
+
///
|
|
75
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
76
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
77
|
+
///
|
|
78
|
+
@mixin page-padding(
|
|
79
|
+
$page-wrap-class: '.page',
|
|
80
|
+
$wrap-class: '.fullwidth',
|
|
81
|
+
$default-padding: 16px
|
|
82
|
+
) {
|
|
83
|
+
|
|
84
|
+
#{$page-wrap-class} {
|
|
85
|
+
|
|
86
|
+
/** default settings without breakpoints **/
|
|
87
|
+
@include page-padding-only($default-padding);
|
|
88
|
+
|
|
89
|
+
/** for usage as wrap around a container */
|
|
90
|
+
#{$wrap-class}-1 {
|
|
91
|
+
@include page-padding-container($default-padding);
|
|
92
|
+
|
|
93
|
+
#{$wrap-class}-inner {
|
|
94
|
+
@include page-padding-inner($default-padding);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** addition class for usage with position:absolute */
|
|
98
|
+
#{$wrap-class}-padding {
|
|
99
|
+
@include page-padding-only($default-padding);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** for usage as inner wrap of a col */
|
|
104
|
+
.row #{$wrap-class}-1 {
|
|
105
|
+
@include page-padding-row($default-padding);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** reset */
|
|
109
|
+
#{$wrap-class}-0,
|
|
110
|
+
.row #{$wrap-class}-0{
|
|
111
|
+
@include page-padding-row-reset();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
#{$wrap-class}-0 {
|
|
115
|
+
#{$wrap-class}-inner{
|
|
116
|
+
@include page-padding-inner-reset();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** addition class for usage with position:absolute */
|
|
120
|
+
#{$wrap-class}-padding {
|
|
121
|
+
@include page-padding-only-reset();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** default settings without breakpoint in class-name, but with different paddings/margins depending on breakpoint */
|
|
126
|
+
@each $breakpoint, $padding-x in $page-padding {
|
|
127
|
+
|
|
128
|
+
@include media-breakpoint-up($breakpoint) {
|
|
129
|
+
|
|
130
|
+
/** for usage as wrap around a container */
|
|
131
|
+
#{$wrap-class}-1 {
|
|
132
|
+
@include page-padding-container($padding-x);
|
|
133
|
+
|
|
134
|
+
#{$wrap-class}-inner {
|
|
135
|
+
@include page-padding-inner($padding-x);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** addition class for usage with position:absolute */
|
|
139
|
+
#{$wrap-class}-padding {
|
|
140
|
+
@include page-padding-only($default-padding);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** for usage as inner wrap of a col */
|
|
145
|
+
.row #{$wrap-class}-1 {
|
|
146
|
+
@include page-padding-row($padding-x);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** reset */
|
|
150
|
+
#{$wrap-class}-0,
|
|
151
|
+
.row #{$wrap-class}-0{
|
|
152
|
+
@include page-padding-row-reset();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
#{$wrap-class}-0 {
|
|
156
|
+
#{$wrap-class}-inner{
|
|
157
|
+
@include page-padding-inner-reset();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** addition class for usage with position:absolute */
|
|
161
|
+
#{$wrap-class}-padding {
|
|
162
|
+
@include page-padding-only-reset();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** specific settings for classes with breakpoints in names. Has to be dominant */
|
|
170
|
+
@each $breakpoint, $padding-x in $page-padding {
|
|
171
|
+
@include media-breakpoint-up($breakpoint) {
|
|
172
|
+
|
|
173
|
+
/** ensure dominance with body-prefix */
|
|
174
|
+
body #{$page-wrap-class} {
|
|
175
|
+
padding-left: $padding-x - math.div($grid-gutter-width, 2);
|
|
176
|
+
padding-right: $padding-x - math.div($grid-gutter-width, 2);
|
|
177
|
+
|
|
178
|
+
/** for usage as wrap around a container */
|
|
179
|
+
#{$wrap-class}-#{$breakpoint}-1 {
|
|
180
|
+
@include page-padding-container($padding-x);
|
|
181
|
+
|
|
182
|
+
#{$wrap-class}-inner {
|
|
183
|
+
@include page-padding-inner($padding-x);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** for usage as inner wrap of a col */
|
|
188
|
+
.row #{$wrap-class}-#{$breakpoint}-1 {
|
|
189
|
+
@include page-padding-row($padding-x);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** reset */
|
|
193
|
+
#{$wrap-class}-#{$breakpoint}-0,
|
|
194
|
+
.row #{$wrap-class}-#{$breakpoint}-0 {
|
|
195
|
+
@include page-padding-row-reset();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
#{$wrap-class}-#{$breakpoint}-0 {
|
|
199
|
+
#{$wrap-class}-inner{
|
|
200
|
+
@include page-padding-inner-reset();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@mixin page-padding-only ($padding-x) {
|
|
209
|
+
padding-left: $padding-x - math.div($grid-gutter-width, 2);
|
|
210
|
+
padding-right: $padding-x - math.div($grid-gutter-width, 2);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
@mixin page-padding-container ($padding-x) {
|
|
214
|
+
padding-left: $padding-x - math.div($grid-gutter-width, 2);
|
|
215
|
+
padding-right: $padding-x - math.div($grid-gutter-width, 2);
|
|
216
|
+
margin-left: (($padding-x - math.div($grid-gutter-width, 2)) * -1);
|
|
217
|
+
margin-right: (($padding-x - math.div($grid-gutter-width, 2)) * -1);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@mixin page-padding-inner ($padding-x) {
|
|
221
|
+
$additionalWidth: $padding-x * 2 - $grid-gutter-width;
|
|
222
|
+
width: calc(100% + $additionalWidth);
|
|
223
|
+
margin-left: $padding-x * -1 + math.div($grid-gutter-width, 2);
|
|
224
|
+
margin-right: $padding-x * -1 + math.div($grid-gutter-width, 2);
|
|
225
|
+
overflow: hidden;
|
|
226
|
+
|
|
227
|
+
/*
|
|
228
|
+
$additionalWidth: $padding-x * 2;
|
|
229
|
+
width: calc(100% + $additionalWidth);
|
|
230
|
+
margin-left: $padding-x * -1 - math.div($grid-gutter-width, 2);
|
|
231
|
+
margin-right: $padding-x * -1;
|
|
232
|
+
padding-left: $grid-gutter-width;
|
|
233
|
+
overflow: hidden;
|
|
234
|
+
*/
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
@mixin page-padding-row ($padding-x) {
|
|
238
|
+
padding-left: $padding-x;
|
|
239
|
+
padding-right: $padding-x;
|
|
240
|
+
margin-left: $padding-x * -1;
|
|
241
|
+
margin-right: $padding-x * -1;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
@mixin page-padding-only-reset () {
|
|
245
|
+
padding-left: initial;
|
|
246
|
+
padding-right: initial;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@mixin page-padding-row-reset () {
|
|
250
|
+
padding-left: initial;
|
|
251
|
+
padding-right: initial;
|
|
252
|
+
margin-left: initial;
|
|
253
|
+
margin-right: initial;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@mixin page-padding-inner-reset () {
|
|
257
|
+
width: initial;
|
|
258
|
+
margin-left: initial;
|
|
259
|
+
margin-right: initial;
|
|
260
|
+
padding-left: initial;
|
|
261
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* ==================================================
|
|
2
|
+
Section
|
|
3
|
+
* ================================================== */
|
|
4
|
+
/// Controls spacing between content sections and blocks.
|
|
5
|
+
///
|
|
6
|
+
/// Provides vertical spacing for common layout patterns such as standard content sections
|
|
7
|
+
/// and blocks within them. Designed to work with modifier classes and utility spacing.
|
|
8
|
+
///
|
|
9
|
+
/// Useful for defining global spacing scales, reusable layout patterns, and utility classes.
|
|
10
|
+
///
|
|
11
|
+
/// @group Spacing
|
|
12
|
+
///
|
|
13
|
+
/// @param {String} $section-class - The base class name for content sections. Defaults to `'csp-section'`.
|
|
14
|
+
/// @param {String} $block-class - The class name for sub-content blocks within sections. Defaults to `'csp-block'`.
|
|
15
|
+
/// @param {String} $utility-append-class - Utility suffix used for generating helper classes. Defaults to `'sp'`.
|
|
16
|
+
/// @param {Map} $csp-blocks - Map defining custom spacing for block types (e.g., `text`, `image`, etc.). Defaults to `$content-spacers-blocks`.
|
|
17
|
+
/// @param {Map} $content-spacers - Global content spacing map (e.g., small, medium, large spacing values). Defaults to `$content-spacers`.
|
|
18
|
+
///
|
|
19
|
+
/// @example html
|
|
20
|
+
/// <!-- Basic content sections -->
|
|
21
|
+
/// <div class="csp-section">
|
|
22
|
+
/// [...]
|
|
23
|
+
/// </div>
|
|
24
|
+
/// <div class="csp-section">
|
|
25
|
+
/// [...]
|
|
26
|
+
/// </div>
|
|
27
|
+
///
|
|
28
|
+
/// @example html
|
|
29
|
+
/// <!-- With reduced space between sections with same content type -->
|
|
30
|
+
/// <div class="csp-section csp-block text">
|
|
31
|
+
/// [...]
|
|
32
|
+
/// </div>
|
|
33
|
+
/// <div class="csp-section csp-block text">
|
|
34
|
+
/// [...]
|
|
35
|
+
/// </div>
|
|
36
|
+
///
|
|
37
|
+
/// @example html
|
|
38
|
+
/// <!-- With reduced space between regular blocks -->
|
|
39
|
+
/// <div class="csp-block">
|
|
40
|
+
/// [...]
|
|
41
|
+
/// </div>
|
|
42
|
+
/// <div class="csp-block">
|
|
43
|
+
/// [...]
|
|
44
|
+
/// </div>
|
|
45
|
+
///
|
|
46
|
+
/// @example scss
|
|
47
|
+
/// .layout-default {
|
|
48
|
+
/// @include section-spacing();
|
|
49
|
+
/// }
|
|
50
|
+
///
|
|
51
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
52
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
53
|
+
///
|
|
54
|
+
@mixin section-spacing(
|
|
55
|
+
$section-class: 'csp-section',
|
|
56
|
+
$block-class: 'csp-block',
|
|
57
|
+
$not-last-class: 'csp-not-last',
|
|
58
|
+
$utility-append-class: 'sp',
|
|
59
|
+
$csp-blocks: $content-spacers-blocks,
|
|
60
|
+
$content-spacers: $content-spacers
|
|
61
|
+
) {
|
|
62
|
+
@each $breakpoint, $values in $grid-breakpoints {
|
|
63
|
+
$spacer-section: map-get(map-get($content-spacers, $breakpoint), 'section');
|
|
64
|
+
$spacer-block: map-get(map-get($content-spacers, $breakpoint), 'block');
|
|
65
|
+
|
|
66
|
+
// section-spacing
|
|
67
|
+
@include with-media($breakpoint) {
|
|
68
|
+
|
|
69
|
+
.#{$section-class},
|
|
70
|
+
.#{$section-class}-#{$utility-append-class} {
|
|
71
|
+
margin-bottom: rem-calc($spacer-section);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.#{$section-class}.#{$not-last-class}:not(:has(+ .#{$section-class})),
|
|
75
|
+
.#{$section-class}-#{$utility-append-class}.#{$not-last-class}:not(:has(+ .#{$section-class})) {
|
|
76
|
+
margin-bottom: 0;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// block-spacing
|
|
81
|
+
@include with-media($breakpoint) {
|
|
82
|
+
|
|
83
|
+
.#{$block-class}:not(.#{$section-class}),
|
|
84
|
+
.#{$block-class}-#{$utility-append-class} {
|
|
85
|
+
margin-bottom: rem-calc($spacer-block);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.#{$block-class}.#{$not-last-class}:not(.#{$section-class}):not(:has(+ .#{$block-class})),
|
|
89
|
+
.#{$block-class}-#{$utility-append-class}.#{$not-last-class}:not(:has(+ .#{$block-class})){
|
|
90
|
+
margin-bottom: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@each $csp-block in $csp-blocks {
|
|
94
|
+
.#{$section-class}.#{$block-class}.#{$csp-block} + .#{$section-class}.#{$block-class}.#{$csp-block} {
|
|
95
|
+
margin-top: rem-calc((strip-unit($spacer-section) - strip-unit($spacer-block)) * -1);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Helper for media-breakpoint-up
|
|
103
|
+
@mixin with-media($breakpoint) {
|
|
104
|
+
@if $breakpoint == 'xs' {
|
|
105
|
+
@content;
|
|
106
|
+
} @else {
|
|
107
|
+
@include media-breakpoint-up($breakpoint) {
|
|
108
|
+
@content;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/* ==================================================
|
|
2
|
+
* Toggle-list
|
|
3
|
+
* ==================================================*/
|
|
4
|
+
/// Creates a vertically stacked list with toggleable items.
|
|
5
|
+
///
|
|
6
|
+
/// Can be used for accordion-like navigation or collapsible sections.
|
|
7
|
+
/// Supports both semantic HTML lists and custom div-based structures.
|
|
8
|
+
///
|
|
9
|
+
/// Features:
|
|
10
|
+
/// - Custom padding and border styling
|
|
11
|
+
/// - Different font colors for default and active states
|
|
12
|
+
/// - Icon support via inline `<span>` or pseudo-element (`::after`)
|
|
13
|
+
///
|
|
14
|
+
/// @group Navigation
|
|
15
|
+
///
|
|
16
|
+
/// @param {Length} $padding-y - Vertical padding for list items. Defaults to `$spacer`.
|
|
17
|
+
/// @param {Color} $border-color - Color of the item borders. Defaults to `$color-primary`.
|
|
18
|
+
/// @param {Length} $border-size - Thickness of the bottom border. Defaults to `1px`.
|
|
19
|
+
/// @param {Color} $font-color - Default font color for links. Defaults to `$color-secondary`.
|
|
20
|
+
/// @param {Color} $font-color-active - Font color for active items. Defaults to `$color-primary`.
|
|
21
|
+
/// @param {Length} $icon-size - Size of the icon element or pseudo-element. Defaults to `30px`.
|
|
22
|
+
/// @param {String} $icon-style - Icon identifier or class (e.g., arrow icon). Defaults to `$icon-arrow-right`.
|
|
23
|
+
///
|
|
24
|
+
/// @example html
|
|
25
|
+
/// <!-- With icon span -->
|
|
26
|
+
/// <div class="toggle-list">
|
|
27
|
+
/// <div class="toggle-list-item">
|
|
28
|
+
/// <div class="toggle-list-link">
|
|
29
|
+
/// <span>Toggle Item</span>
|
|
30
|
+
/// <span class="icon"></span>
|
|
31
|
+
/// </div>
|
|
32
|
+
/// </div>
|
|
33
|
+
/// </div>
|
|
34
|
+
///
|
|
35
|
+
/// @example html
|
|
36
|
+
/// <!-- With ::after icon when used via WYSIWYG editor -->
|
|
37
|
+
/// <ul class="toggle-list">
|
|
38
|
+
/// <li>
|
|
39
|
+
/// <a href="#">
|
|
40
|
+
/// Toggle Item
|
|
41
|
+
/// </a>
|
|
42
|
+
/// </li>
|
|
43
|
+
/// </ul>
|
|
44
|
+
///
|
|
45
|
+
/// @example scss
|
|
46
|
+
/// .toggle-list {
|
|
47
|
+
/// @include toggle-list(
|
|
48
|
+
/// $padding-y: 1rem,
|
|
49
|
+
/// $border-color: #ccc,
|
|
50
|
+
/// $font-color-active: #000,
|
|
51
|
+
/// $icon-size: 1.25rem
|
|
52
|
+
/// );
|
|
53
|
+
/// }
|
|
54
|
+
///
|
|
55
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
56
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
57
|
+
///
|
|
58
|
+
@mixin toggle-list(
|
|
59
|
+
$padding-y: $spacer,
|
|
60
|
+
$border-color: $color-primary,
|
|
61
|
+
$border-size: 1px,
|
|
62
|
+
$font-color: $color-secondary,
|
|
63
|
+
$font-color-active: $color-primary,
|
|
64
|
+
$icon-size: 30px,
|
|
65
|
+
$icon-style: $icon-arrow-right
|
|
66
|
+
) {
|
|
67
|
+
@include list-reset;
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
|
|
71
|
+
&-item {
|
|
72
|
+
border-bottom: rem-calc($border-size) solid $border-color;
|
|
73
|
+
margin: 0;
|
|
74
|
+
padding: rem-calc($padding-y) 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&-link {
|
|
78
|
+
color: $font-color;
|
|
79
|
+
text-align: left;
|
|
80
|
+
|
|
81
|
+
display: flex;
|
|
82
|
+
justify-content: space-between;
|
|
83
|
+
align-items: center;
|
|
84
|
+
text-decoration: none;
|
|
85
|
+
width: 100%;
|
|
86
|
+
|
|
87
|
+
&:link,
|
|
88
|
+
&:visited,
|
|
89
|
+
&:hover {
|
|
90
|
+
text-decoration: none !important;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.icon {
|
|
94
|
+
font-size: rem-calc($icon-size);
|
|
95
|
+
color: $font-color;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:hover,
|
|
99
|
+
&.active,
|
|
100
|
+
&[aria-expanded="true"] {
|
|
101
|
+
color: $font-color-active;
|
|
102
|
+
|
|
103
|
+
&::after {
|
|
104
|
+
color: $font-color-active;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.icon {
|
|
108
|
+
color: $font-color-active;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
& > li {
|
|
115
|
+
@extend .toggle-list-item;
|
|
116
|
+
|
|
117
|
+
// editor adds span elements
|
|
118
|
+
& > span > a,
|
|
119
|
+
& > span > .link,
|
|
120
|
+
& > a,
|
|
121
|
+
& > .link {
|
|
122
|
+
@extend .toggle-list-link;
|
|
123
|
+
|
|
124
|
+
&::after {
|
|
125
|
+
@extend .icomoon;
|
|
126
|
+
font-size: rem-calc($icon-size);
|
|
127
|
+
content: $icon-style;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
3
|
+
/// Removes the unit from a given number (e.g. px, em, rem).
|
|
4
|
+
///
|
|
5
|
+
/// Useful when performing mathematical operations on values with units.
|
|
6
|
+
/// If the input is already unitless, it returns the value unchanged.
|
|
7
|
+
///
|
|
8
|
+
/// @group Functions
|
|
9
|
+
///
|
|
10
|
+
/// @param {Number} $number - A numeric value with or without a unit.
|
|
11
|
+
/// @return {Number} - A unitless number.
|
|
12
|
+
///
|
|
13
|
+
/// @example scss
|
|
14
|
+
/// strip-unit(16px); // 16
|
|
15
|
+
/// strip-unit(2rem); // 2
|
|
16
|
+
/// strip-unit(10); // 10
|
|
17
|
+
///
|
|
18
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
19
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
20
|
+
///
|
|
21
|
+
@function strip-unit($number) {
|
|
22
|
+
@if type-of($number) == 'number' and not unitless($number) {
|
|
23
|
+
@return math.div($number, $number * 0 + 1);
|
|
24
|
+
}
|
|
25
|
+
@return $number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/// Converts a pixel value into `rem` units based on a 16px base font size.
|
|
30
|
+
///
|
|
31
|
+
/// This function strips the unit and divides by 16. Useful for fluid, scalable type and layout systems.
|
|
32
|
+
///
|
|
33
|
+
/// Depends on `strip-unit()` for unit handling.
|
|
34
|
+
///
|
|
35
|
+
/// @group Functions
|
|
36
|
+
///
|
|
37
|
+
/// @param {Number} $size - A pixel value to convert (e.g. `16px`, `32`).
|
|
38
|
+
/// @return {String} - A `rem` string with the converted value (e.g. `1rem`).
|
|
39
|
+
///
|
|
40
|
+
/// @example scss
|
|
41
|
+
/// rem-calc(16); // 1rem
|
|
42
|
+
/// rem-calc(24px); // 1.5rem
|
|
43
|
+
///
|
|
44
|
+
/// @author Steffen Kroggel <developer@steffenkroggel>
|
|
45
|
+
/// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
46
|
+
///
|
|
47
|
+
@function rem-calc($size) {
|
|
48
|
+
$size: strip-unit($size);
|
|
49
|
+
$rem-size: math.div($size, 16);
|
|
50
|
+
@return #{$rem-size}rem;
|
|
51
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* ==================================================
|
|
2
|
+
* Basic variables
|
|
3
|
+
* ================================================== */
|
|
4
|
+
$color-map: (
|
|
5
|
+
'red': #ff0000,
|
|
6
|
+
'primary': #00ff00,
|
|
7
|
+
'secondary': #0000ff,
|
|
8
|
+
) !default;
|
|
9
|
+
|
|
10
|
+
// some basic variables
|
|
11
|
+
$color-white: #fff !default;
|
|
12
|
+
$color-black: #000000 !default;
|
|
13
|
+
$color-primary: map-get($color-map, 'primary') !default;
|
|
14
|
+
$color-secondary: map-get($color-map, 'secondary') !default;
|
|
15
|
+
$color-text: map-get($color-map, 'secondary') !default;
|
|
16
|
+
$color-error: map-get($color-map, 'primary') !default;
|
|
17
|
+
$color-outline: map-get($color-map, 'primary') !default;
|