@madj2k/fe-frontend-kit 2.0.28 → 2.0.29

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madj2k/fe-frontend-kit",
3
- "version": "2.0.28",
3
+ "version": "2.0.29",
4
4
  "description": "Shared frontend utilities, menus and mixins for projects",
5
5
  "main": "index.js",
6
6
  "style": "index.scss",
@@ -23,9 +23,12 @@
23
23
  ///
24
24
  /// @group Layout
25
25
  ///
26
+ /// @param {Map} $page-padding - A map of breakpoint names to padding values for responsive control. Defaults to predefined breakpoint-based paddings.
26
27
  /// @param {String} $page-wrap-class - The base class used to wrap the entire page (for context-aware styling). Defaults to `'.page'`.
27
28
  /// @param {String} $wrap-class - The base utility class prefix for full-width behavior. Defaults to `'.fullwidth'`.
28
29
  /// @param {Length} $default-padding - The default horizontal padding applied when full-width is active. Defaults to `16px`.
30
+ /// @param {String} $padding-class - The class prefix used for standalone padding utilities. Defaults to `$page-wrap-class`.
31
+ /// @param {Number} $version - Version number for compatibility handling. Defaults to `1`.
29
32
  ///
30
33
  /// @example html
31
34
  /// <!-- 1) Around a Bootstrap container -->
@@ -85,7 +88,9 @@
85
88
  ),
86
89
  $page-wrap-class: '.page',
87
90
  $wrap-class: '.fullwidth',
88
- $default-padding: 16px
91
+ $default-padding: 16px,
92
+ $padding-class: $page-wrap-class,
93
+ $version: 1,
89
94
  ) {
90
95
 
91
96
  #{$page-wrap-class} {
@@ -93,7 +98,12 @@
93
98
  /** default settings without breakpoints **/
94
99
  @include page-padding-only($default-padding);
95
100
 
96
- /** for usage as wrap around a container */
101
+ /** addition class which simply contains the normal padding */
102
+ #{$padding-class}-padding {
103
+ @include page-padding-only($default-padding, 'full');
104
+ }
105
+
106
+ /** for usage as wrap around a container */
97
107
  #{$wrap-class}-1 {
98
108
  @include page-padding-container($default-padding);
99
109
 
@@ -134,6 +144,11 @@
134
144
 
135
145
  @include media-breakpoint-up($breakpoint) {
136
146
 
147
+ /** addition class which simply contains the normal padding */
148
+ #{$padding-class}-padding {
149
+ @include page-padding-only($padding-x, 'full');
150
+ }
151
+
137
152
  /** for usage as wrap around a container */
138
153
  #{$wrap-class}-1 {
139
154
  @include page-padding-container($padding-x);
@@ -155,9 +170,9 @@
155
170
 
156
171
  /** reset */
157
172
  #{$wrap-class}-0,
158
- .row #{$wrap-class}-0{
173
+ .row #{$wrap-class}-0{
159
174
  @include page-padding-row-reset();
160
- }
175
+ }
161
176
 
162
177
  #{$wrap-class}-0 {
163
178
  #{$wrap-class}-inner{
@@ -179,8 +194,17 @@
179
194
 
180
195
  /** ensure dominance with body-prefix */
181
196
  body #{$page-wrap-class} {
182
- padding-left: $padding-x - math.div($grid-gutter-width, 2);
183
- padding-right: $padding-x - math.div($grid-gutter-width, 2);
197
+
198
+ // seems to be a bug in older version. But we keep it for compatibility
199
+ @if ($version < 2) {
200
+ padding-left: $padding-x - math.div($grid-gutter-width, 2);
201
+ padding-right: $padding-x - math.div($grid-gutter-width, 2);
202
+ }
203
+
204
+ /** addition class which simply contains the normal padding */
205
+ #{$padding-class}-#{$breakpoint}-padding {
206
+ @include page-padding-only($padding-x, 'full');
207
+ }
184
208
 
185
209
  /** for usage as wrap around a container */
186
210
  #{$wrap-class}-#{$breakpoint}-1 {
@@ -212,9 +236,14 @@
212
236
  }
213
237
  }
214
238
 
215
- @mixin page-padding-only ($padding-x) {
216
- padding-left: $padding-x - math.div($grid-gutter-width, 2);
217
- padding-right: $padding-x - math.div($grid-gutter-width, 2);
239
+ @mixin page-padding-only ($padding-x, $variant: 'default') {
240
+ @if ($variant == 'full') {
241
+ padding-left: $padding-x;
242
+ padding-right: $padding-x;
243
+ } @else {
244
+ padding-left: $padding-x - math.div($grid-gutter-width, 2);
245
+ padding-right: $padding-x - math.div($grid-gutter-width, 2);
246
+ }
218
247
  }
219
248
 
220
249
  @mixin page-padding-container ($padding-x) {
@@ -230,7 +259,6 @@
230
259
  margin-left: $padding-x * -1 + math.div($grid-gutter-width, 2);
231
260
  margin-right: $padding-x * -1 + math.div($grid-gutter-width, 2);
232
261
  overflow: hidden;
233
-
234
262
  /*
235
263
  $additionalWidth: $padding-x * 2;
236
264
  width: calc(100% + $additionalWidth);