@madj2k/fe-frontend-kit 2.0.38 → 2.0.40

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.
@@ -57,6 +57,33 @@
57
57
  /// @include section-spacing();
58
58
  /// }
59
59
  ///
60
+ /// Also generates Bootstrap-style utility classes for vertical spacing
61
+ /// using the `section-spacing()` mixin.
62
+ ///
63
+ /// Class naming convention follows:
64
+ /// `.mt-[breakpoint]-[block|section-class]`, `.pt-[breakpoint]-[section-class]`, etc.
65
+ ///
66
+ /// Supports both `margin` and `padding` for `top` and `bottom`.
67
+ ///
68
+ /// Breakpoint-specific classes are generated using `media-breakpoint-up`
69
+ /// for all breakpoints above `xs`. The `xs` breakpoint outputs base utility classes
70
+ /// without any breakpoint suffix.
71
+ ///
72
+ /// Utility classes are generated dynamically from a configurable map:
73
+ ///
74
+ /// @example scss
75
+ /// $utility-prefixes: (
76
+ /// 'pt': 'padding-top',
77
+ /// 'pb': 'padding-bottom',
78
+ /// 'mt': 'margin-top',
79
+ /// 'mb': 'margin-bottom'
80
+ /// );
81
+ ///
82
+ /// @example html
83
+ /// <div class="pt-csp-section mb-lg-csp-block">
84
+ /// [...]
85
+ /// </div>
86
+ ///
60
87
  /// @author Steffen Kroggel <developer@steffenkroggel>
61
88
  /// @license GNU General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.en.html
62
89
  ///
@@ -64,7 +91,7 @@
64
91
  $section-class: 'csp-section',
65
92
  $block-class: 'csp-block',
66
93
  $not-last-class: 'csp-not-last',
67
- $utility-append-class: 'sp',
94
+ $utility-append-class: 'sp', // deprecated
68
95
  $padding-append-class: 'padding',
69
96
  $csp-blocks: (
70
97
  'text',
@@ -73,8 +100,8 @@
73
100
  ),
74
101
  $content-spacers: (
75
102
  'xs': (
76
- 'section': 48px, // space between different sections
77
- 'block': 16px // space between content blocks
103
+ 'section': 48px,
104
+ 'block': 16px
78
105
  ),
79
106
  'sm': (
80
107
  'section': 48px,
@@ -97,14 +124,31 @@
97
124
  'block': 16px
98
125
  )
99
126
  ),
127
+ $utility-prefixes: (
128
+ 'pt': 'padding-top',
129
+ 'pb': 'padding-bottom',
130
+ 'mt': 'margin-top',
131
+ 'mb': 'margin-bottom'
132
+ )
100
133
  ) {
101
134
  @each $breakpoint, $values in $grid-breakpoints {
102
135
  $spacer-section: map-get(map-get($content-spacers, $breakpoint), 'section');
103
136
  $spacer-block: map-get(map-get($content-spacers, $breakpoint), 'block');
104
137
 
105
- // section-spacing
106
138
  @include with-media($breakpoint) {
139
+ @each $prefix, $property in $utility-prefixes {
140
+ // Section Utilities
141
+ .#{$prefix}#{if($breakpoint != xs, '-#{$breakpoint}', '')}-#{$section-class} {
142
+ #{$property}: rem-calc($spacer-section) !important;
143
+ }
144
+
145
+ // Block Utilities
146
+ .#{$prefix}#{if($breakpoint != xs, '-#{$breakpoint}', '')}-#{$block-class} {
147
+ #{$property}: rem-calc($spacer-block) !important;
148
+ }
149
+ }
107
150
 
151
+ // Section defaults
108
152
  .#{$section-class},
109
153
  .#{$section-class}-#{$utility-append-class} {
110
154
  margin-bottom: rem-calc($spacer-section);
@@ -122,18 +166,15 @@
122
166
  padding-top: rem-calc($spacer-section);
123
167
  padding-bottom: rem-calc($spacer-section);
124
168
  }
125
- }
126
-
127
- // block-spacing
128
- @include with-media($breakpoint) {
129
169
 
170
+ // Block defaults
130
171
  .#{$block-class}:not(.#{$section-class}),
131
172
  .#{$block-class}-#{$utility-append-class} {
132
173
  margin-bottom: rem-calc($spacer-block);
133
174
  }
134
175
 
135
176
  .#{$block-class}.#{$not-last-class}:not(.#{$section-class}):not(:has(+ .#{$block-class})),
136
- .#{$block-class}-#{$utility-append-class}.#{$not-last-class}:not(:has(+ .#{$block-class})){
177
+ .#{$block-class}-#{$utility-append-class}.#{$not-last-class}:not(:has(+ .#{$block-class})) {
137
178
  margin-bottom: 0;
138
179
  }
139
180
 
@@ -146,6 +187,7 @@
146
187
  }
147
188
  }
148
189
 
190
+
149
191
  // Helper for media-breakpoint-up
150
192
  @mixin with-media($breakpoint) {
151
193
  @if $breakpoint == 'xs' {
@@ -20,6 +20,8 @@
20
20
  /// @param {Color} $font-color-active - Font color for active items. Defaults to `$color-primary`.
21
21
  /// @param {Length} $icon-size - Size of the icon element or pseudo-element. Defaults to `30px`.
22
22
  /// @param {String} $icon-style - Icon identifier or class (e.g., arrow icon). Defaults to `$icon-arrow-right`.
23
+ /// @param {Color} $icon-color - Color of the icon in default state. Defaults to `$font-color`.
24
+ /// @param {Color} $icon-color-active - Color of the icon in active state. Defaults to `$font-color-active`.
23
25
  ///
24
26
  /// @example html
25
27
  /// <!-- With icon span -->
@@ -27,7 +29,7 @@
27
29
  /// <div class="toggle-list-item">
28
30
  /// <div class="toggle-list-link">
29
31
  /// <span>Toggle Item</span>
30
- /// <span class="icon"></span>
32
+ /// <span class="toggle-icon"></span>
31
33
  /// </div>
32
34
  /// </div>
33
35
  /// </div>
@@ -61,8 +63,13 @@
61
63
  $border-size: 1px,
62
64
  $font-color: var(--bs-secondary),
63
65
  $font-color-active: var(--bs-primary),
66
+ $font-color-hover: $font-color-active,
64
67
  $icon-size: 30px,
65
- $icon-style: ''
68
+ $icon-style: '',
69
+ $icon-color: $font-color,
70
+ $icon-color-active: $font-color-active,
71
+ $icon-color-hover: $icon-color-active,
72
+
66
73
  ) {
67
74
  @include list-reset();
68
75
  display: flex;
@@ -90,25 +97,30 @@
90
97
  text-decoration: none !important;
91
98
  }
92
99
 
100
+ &::after,
93
101
  .icon {
94
102
  font-size: rem-calc($icon-size);
95
- color: $font-color;
103
+ color: $icon-color;
96
104
  }
97
105
 
98
- &:hover,
99
106
  &.active,
100
107
  &[aria-expanded="true"] {
101
108
  color: $font-color-active;
102
109
 
103
- &::after {
104
- color: $font-color-active;
110
+ &::after,
111
+ .icon {
112
+ color: $icon-color-active;
105
113
  }
114
+ }
106
115
 
116
+ &:hover{
117
+ color: $font-color-hover;
118
+
119
+ &::after,
107
120
  .icon {
108
- color: $font-color-active;
121
+ color: $icon-color-hover;
109
122
  }
110
123
  }
111
-
112
124
  }
113
125
 
114
126
  & > li {
@@ -121,10 +133,12 @@
121
133
  & > .link {
122
134
  @extend .toggle-list-link;
123
135
 
124
- &::after {
125
- @extend .icomoon;
126
- font-size: rem-calc($icon-size);
127
- content: $icon-style;
136
+ @if $icon-style != '' {
137
+ &::after {
138
+ @extend .icomoon;
139
+ font-size: rem-calc($icon-size);
140
+ content: $icon-style;
141
+ }
128
142
  }
129
143
  }
130
144
  }
@@ -135,6 +135,14 @@
135
135
  color: $icon-color;
136
136
  }
137
137
 
138
+ #{$icon-selector}:not(:has(svg)) {
139
+ width: max-content;
140
+ }
141
+
142
+ #{$icon-selector}:before {
143
+ width: max-content;
144
+ }
145
+
138
146
  #{$icon-selector} svg {
139
147
  height: 100%;
140
148
  }