@ulu/frontend 0.6.22 → 0.6.24
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.
|
@@ -39,3 +39,49 @@
|
|
|
39
39
|
<p>Customize which alerts you receive via email, push notification, or SMS.</p>
|
|
40
40
|
</div>
|
|
41
41
|
</div>
|
|
42
|
+
|
|
43
|
+
<!-- @ulu-demo
|
|
44
|
+
title: Sticky Horizontal Tabs
|
|
45
|
+
description: Using the `tabs--sticky` modifier to keep the horizontal tab labels visible at the top of the viewport when scrolling through long panel content.
|
|
46
|
+
-->
|
|
47
|
+
<div class="tabs tabs--sticky">
|
|
48
|
+
<div role="tablist" data-ulu-tablist='{ "equalHeights": false }'>
|
|
49
|
+
<button role="tab" id="sh-tab-1" aria-selected="true" aria-controls="sh-panel-1">Section 1</button>
|
|
50
|
+
<button role="tab" id="sh-tab-2" aria-selected="false" aria-controls="sh-panel-2">Section 2</button>
|
|
51
|
+
<button role="tab" id="sh-tab-3" aria-selected="false" aria-controls="sh-panel-3">Section 3</button>
|
|
52
|
+
</div>
|
|
53
|
+
<div role="tabpanel" id="sh-panel-1" aria-labelledby="sh-tab-1">
|
|
54
|
+
<p>Scroll down to see the sticky behavior.</p>
|
|
55
|
+
<div style="height: 400px; background-image: repeating-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc), repeating-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc); background-position: 0 0, 10px 10px; background-size: 20px 20px; opacity: 0.1; margin-top: 1rem;"></div>
|
|
56
|
+
</div>
|
|
57
|
+
<div role="tabpanel" id="sh-panel-2" aria-labelledby="sh-tab-2" hidden>
|
|
58
|
+
<p>This is section 2 content.</p>
|
|
59
|
+
<div style="height: 400px; background-image: repeating-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc), repeating-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc); background-position: 0 0, 10px 10px; background-size: 20px 20px; opacity: 0.1; margin-top: 1rem;"></div>
|
|
60
|
+
</div>
|
|
61
|
+
<div role="tabpanel" id="sh-panel-3" aria-labelledby="sh-tab-3" hidden>
|
|
62
|
+
<p>This is section 3 content.</p>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<!-- @ulu-demo
|
|
67
|
+
title: Sticky Vertical Tabs
|
|
68
|
+
description: Using both `tabs--vertical` and `tabs--sticky` modifiers. On large screens, the tab labels stick within their grid column as you scroll the adjacent panel. On smaller screens, they behave like sticky horizontal tabs.
|
|
69
|
+
-->
|
|
70
|
+
<div class="tabs tabs--vertical tabs--sticky">
|
|
71
|
+
<div role="tablist" data-ulu-tablist='{ "vertical": true, "equalHeights": false }'>
|
|
72
|
+
<button role="tab" id="sv-tab-1" aria-selected="true" aria-controls="sv-panel-1">Chapter 1</button>
|
|
73
|
+
<button role="tab" id="sv-tab-2" aria-selected="false" aria-controls="sv-panel-2">Chapter 2</button>
|
|
74
|
+
<button role="tab" id="sv-tab-3" aria-selected="false" aria-controls="sv-panel-3">Chapter 3</button>
|
|
75
|
+
</div>
|
|
76
|
+
<div role="tabpanel" id="sv-panel-1" aria-labelledby="sv-tab-1">
|
|
77
|
+
<p>Scroll down to see the vertical tablist stick to the top.</p>
|
|
78
|
+
<div style="height: 400px; background-image: repeating-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc), repeating-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc); background-position: 0 0, 10px 10px; background-size: 20px 20px; opacity: 0.1; margin-top: 1rem;"></div>
|
|
79
|
+
</div>
|
|
80
|
+
<div role="tabpanel" id="sv-panel-2" aria-labelledby="sv-tab-2" hidden>
|
|
81
|
+
<p>This is chapter 2 content.</p>
|
|
82
|
+
<div style="height: 400px; background-image: repeating-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc), repeating-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc); background-position: 0 0, 10px 10px; background-size: 20px 20px; opacity: 0.1; margin-top: 1rem;"></div>
|
|
83
|
+
</div>
|
|
84
|
+
<div role="tabpanel" id="sv-panel-3" aria-labelledby="sv-tab-3" hidden>
|
|
85
|
+
<p>This is chapter 3 content.</p>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
@use "sass:meta";
|
|
8
8
|
|
|
9
9
|
@use "../utils";
|
|
10
|
+
@use "../cssvar";
|
|
10
11
|
@use "../color";
|
|
11
12
|
@use "../selector";
|
|
12
13
|
@use "../breakpoint";
|
|
@@ -61,6 +62,10 @@ $-fallbacks: (
|
|
|
61
62
|
/// @prop {Boolean} horizontal-tab-wrap [false] Set to true to allow line wrapping when the tabs are in horizontal orientation, vertical is always allowed to wrap
|
|
62
63
|
/// @prop {Color} full-width-tablist-background-color [null] Optional background color for full-width tabs tablist
|
|
63
64
|
/// @prop {Color} full-width-tabpanel-background-color [transparent] Optional background color for full-width tabs tabpanel
|
|
65
|
+
/// @prop {Dimension} sticky-top [cssvar.use-ulu("sticky-offset-top")] The top offset when the sticky modifier is applied
|
|
66
|
+
/// @prop {Dimension} sticky-vertical-top [cssvar.add(cssvar.use-ulu("sticky-offset-top"), 1em)] The top offset when the sticky modifier is applied in vertical layout
|
|
67
|
+
/// @prop {Color} sticky-background-color [background] The background color for the tablist when sticky
|
|
68
|
+
/// @prop {Number} sticky-z-index [2] The z-index for the tablist when sticky
|
|
64
69
|
|
|
65
70
|
$config: (
|
|
66
71
|
"margin" : (2rem 0),
|
|
@@ -93,6 +98,10 @@ $config: (
|
|
|
93
98
|
"horizontal-tab-wrap" : false,
|
|
94
99
|
"full-width-tablist-background-color" : null,
|
|
95
100
|
"full-width-tabpanel-background-color" : transparent,
|
|
101
|
+
"sticky-top" : cssvar.use-ulu("sticky-offset-top"),
|
|
102
|
+
"sticky-vertical-top" : cssvar.add(cssvar.use-ulu("sticky-offset-top"), 1em),
|
|
103
|
+
"sticky-background-color" : "background",
|
|
104
|
+
"sticky-z-index" : 2,
|
|
96
105
|
) !default;
|
|
97
106
|
|
|
98
107
|
/// Change modules $config
|
|
@@ -211,6 +220,15 @@ $config: (
|
|
|
211
220
|
}
|
|
212
221
|
}
|
|
213
222
|
|
|
223
|
+
#{ $prefix }--sticky {
|
|
224
|
+
[role="tablist"] {
|
|
225
|
+
position: sticky;
|
|
226
|
+
top: get("sticky-top");
|
|
227
|
+
z-index: get("sticky-z-index");
|
|
228
|
+
background-color: color.get(get("sticky-background-color"));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
214
232
|
@include breakpoint.min(get("vertical-breakpoint")) {
|
|
215
233
|
#{ $prefix }--vertical {
|
|
216
234
|
display: grid;
|
|
@@ -240,6 +258,12 @@ $config: (
|
|
|
240
258
|
grid-column: 2; // needed for equalHeights in vertical
|
|
241
259
|
}
|
|
242
260
|
}
|
|
261
|
+
#{ $prefix }--sticky#{ $prefix }--vertical {
|
|
262
|
+
[role="tablist"] {
|
|
263
|
+
top: get("sticky-vertical-top");
|
|
264
|
+
align-self: start;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
243
267
|
}
|
|
244
268
|
|
|
245
269
|
#{ $prefix }--transparent {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ulu/frontend",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.24",
|
|
4
4
|
"description": "A framework-agnostic frontend toolkit providing a modular, tree-shakable library of accessible components and utilities. Designed for seamless integration, it features a highly configurable SCSS system for any environment and vanilla JavaScript modules optimized for traditional websites and content management systems.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|