spoko-design-system 1.7.0 → 1.8.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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [1.8.0](https://github.com/polo-blue/sds/compare/v1.7.0...v1.8.0) (2025-10-29)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **Headline:** add responsive design support and advanced features ([254d5d3](https://github.com/polo-blue/sds/commit/254d5d30f8eff673a48343270f0f23eb39ab7f95))
|
|
6
|
+
|
|
1
7
|
## [1.7.0](https://github.com/polo-blue/sds/compare/v1.6.0...v1.7.0) (2025-10-29)
|
|
2
8
|
|
|
3
9
|
### Features
|
package/package.json
CHANGED
|
@@ -1,85 +1,90 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
fontFamily: {
|
|
30
|
-
type: String as PropType<'head' | 'text' | 'novamono' | 'mono'>,
|
|
31
|
-
required: false,
|
|
32
|
-
default: 'head',
|
|
33
|
-
},
|
|
34
|
-
fontWeight: {
|
|
35
|
-
type: String as PropType<'light' | 'regular' | 'bold' | 'light-bold' | 'light-thin'>,
|
|
36
|
-
required: false,
|
|
37
|
-
default: 'regular',
|
|
38
|
-
},
|
|
39
|
-
underline: {
|
|
40
|
-
type: [Boolean, String] as PropType<boolean | 'center'>,
|
|
41
|
-
required: false,
|
|
42
|
-
default: false,
|
|
43
|
-
},
|
|
2
|
+
import { computed, useAttrs } from 'vue';
|
|
3
|
+
|
|
4
|
+
const attrs = useAttrs();
|
|
5
|
+
|
|
6
|
+
interface HeadlineProps {
|
|
7
|
+
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'span';
|
|
8
|
+
class?: string;
|
|
9
|
+
fontFamily?: 'head' | 'text' | 'novamono' | 'mono';
|
|
10
|
+
fontWeight?: 'light' | 'regular' | 'bold' | 'light-bold' | 'light-thin';
|
|
11
|
+
underline?: boolean | 'center';
|
|
12
|
+
defaultSize?: string;
|
|
13
|
+
noFlexLayout?: boolean;
|
|
14
|
+
noMargin?: boolean;
|
|
15
|
+
noLeading?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const props = withDefaults(defineProps<HeadlineProps>(), {
|
|
19
|
+
as: 'span',
|
|
20
|
+
class: '',
|
|
21
|
+
fontFamily: 'head',
|
|
22
|
+
fontWeight: 'regular',
|
|
23
|
+
underline: false,
|
|
24
|
+
defaultSize: 'text-inherit',
|
|
25
|
+
noFlexLayout: false,
|
|
26
|
+
noMargin: false,
|
|
27
|
+
noLeading: false,
|
|
44
28
|
});
|
|
45
29
|
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
const family = props.fontFamily;
|
|
49
|
-
const weight = props.fontWeight;
|
|
30
|
+
const typographyClass = computed(() => {
|
|
31
|
+
const { fontFamily, fontWeight } = props;
|
|
50
32
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return `font-${family}`;
|
|
33
|
+
if (fontFamily === 'novamono' || fontFamily === 'mono') {
|
|
34
|
+
return `font-${fontFamily}`;
|
|
54
35
|
}
|
|
55
36
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
37
|
+
if (fontFamily === 'head') {
|
|
38
|
+
const weightMap = {
|
|
39
|
+
light: 'headline-light',
|
|
40
|
+
bold: 'headline-bold',
|
|
41
|
+
'light-bold': 'headline-light-bold',
|
|
42
|
+
'light-thin': 'headline-light-thin',
|
|
43
|
+
regular: 'headline',
|
|
44
|
+
};
|
|
45
|
+
return weightMap[fontWeight] || 'headline';
|
|
63
46
|
}
|
|
64
47
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return `font-text${weight}`;
|
|
48
|
+
if (fontFamily === 'text') {
|
|
49
|
+
return `font-text${fontWeight}`;
|
|
68
50
|
}
|
|
69
51
|
|
|
70
|
-
// Default fallback
|
|
71
52
|
return 'headline';
|
|
72
|
-
};
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const underlineClass = computed(() => {
|
|
56
|
+
if (props.underline === true) return 'headline--underline';
|
|
57
|
+
if (props.underline === 'center') return 'headline--underline-center';
|
|
58
|
+
return '';
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const layoutClass = computed(() => {
|
|
62
|
+
// Centered underline needs block + text-center
|
|
63
|
+
if (props.underline === 'center') return 'block text-center';
|
|
73
64
|
|
|
74
|
-
|
|
65
|
+
// Default flex layout for icon alignment (unless disabled)
|
|
66
|
+
if (!props.noFlexLayout) {
|
|
67
|
+
return 'flex sm:block md:flex items-center';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return '';
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const computedClasses = computed(() => {
|
|
74
|
+
const baseClasses = [];
|
|
75
|
+
|
|
76
|
+
// Conditionally add base classes
|
|
77
|
+
if (!props.noMargin) baseClasses.push('mb-2.5');
|
|
78
|
+
if (!props.noLeading) baseClasses.push('leading-none');
|
|
79
|
+
|
|
80
|
+
const sizeClasses = props.class || props.defaultSize;
|
|
81
|
+
|
|
82
|
+
return `${baseClasses.join(' ')} ${typographyClass.value} ${sizeClasses} ${underlineClass.value} ${layoutClass.value}`.trim();
|
|
83
|
+
});
|
|
75
84
|
</script>
|
|
76
85
|
|
|
77
86
|
<template>
|
|
78
|
-
<component
|
|
79
|
-
:is="props.as"
|
|
80
|
-
class="mb-2.5 leading-none"
|
|
81
|
-
:class="`${typographyClass} ${props.textSize ? `text-${props.textSize}` : 'text-xl'} ${props.underline === true ? 'headline--underline' : ''} ${props.underline === 'center' ? 'headline--underline-center block text-center' : 'flex sm:block md:flex items-center'}`"
|
|
82
|
-
>
|
|
87
|
+
<component :is="as" :class="computedClasses" v-bind="attrs">
|
|
83
88
|
<slot />
|
|
84
89
|
</component>
|
|
85
90
|
</template>
|
|
@@ -92,14 +97,14 @@ const typographyClass = getTypographyClass();
|
|
|
92
97
|
@apply content-empty absolute left-0 bottom-0;
|
|
93
98
|
height: 3px;
|
|
94
99
|
width: 55px;
|
|
95
|
-
background-color: var(--clr-primary-400);
|
|
100
|
+
background-color: var(--headline-underline-accent, var(--clr-primary-400));
|
|
96
101
|
}
|
|
97
102
|
|
|
98
103
|
&:before {
|
|
99
104
|
@apply content-empty absolute left-0 bottom-px h-px;
|
|
100
105
|
width: 95%;
|
|
101
106
|
max-width: 255px;
|
|
102
|
-
background-color: #64748b;
|
|
107
|
+
background-color: var(--headline-underline-base, #64748b);
|
|
103
108
|
}
|
|
104
109
|
}
|
|
105
110
|
|
|
@@ -110,7 +115,7 @@ const typographyClass = getTypographyClass();
|
|
|
110
115
|
@apply content-empty absolute left-1/2 bottom-px h-px;
|
|
111
116
|
width: 95%;
|
|
112
117
|
max-width: 255px;
|
|
113
|
-
background-color: #64748b;
|
|
118
|
+
background-color: var(--headline-underline-base, #64748b);
|
|
114
119
|
transform: translateX(-50%);
|
|
115
120
|
}
|
|
116
121
|
|
|
@@ -118,7 +123,7 @@ const typographyClass = getTypographyClass();
|
|
|
118
123
|
@apply content-empty absolute bottom-0;
|
|
119
124
|
height: 3px;
|
|
120
125
|
width: 55px;
|
|
121
|
-
background-color: var(--clr-primary-400);
|
|
126
|
+
background-color: var(--headline-underline-accent, var(--clr-primary-400));
|
|
122
127
|
left: calc(50% - min(47.5%, 127.5px));
|
|
123
128
|
}
|
|
124
129
|
}
|
|
@@ -24,113 +24,313 @@ Thanks to this, I can make a header that always looks the same, regardless of wh
|
|
|
24
24
|
import Headline from 'spoko-design-system/src/components/Headline.vue';
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
###
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
### Props
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
interface HeadlineProps {
|
|
31
|
+
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'span';
|
|
32
|
+
// default: 'span'
|
|
33
|
+
|
|
34
|
+
class?: string;
|
|
35
|
+
// default: ''
|
|
36
|
+
// Use any UnoCSS/Tailwind classes including responsive variants
|
|
37
|
+
// Examples: 'text-4xl', 'text-2xl md:text-4xl lg:text-6xl'
|
|
38
|
+
|
|
39
|
+
fontFamily?: 'head' | 'text' | 'novamono' | 'mono';
|
|
40
|
+
// default: 'head'
|
|
41
|
+
|
|
42
|
+
fontWeight?: 'light' | 'regular' | 'bold' | 'light-bold' | 'light-thin';
|
|
43
|
+
// default: 'regular'
|
|
44
|
+
|
|
45
|
+
underline?: boolean | 'center';
|
|
46
|
+
// default: false
|
|
47
|
+
// true: left-aligned underline, 'center': centered underline
|
|
48
|
+
|
|
49
|
+
defaultSize?: string;
|
|
50
|
+
// default: 'text-inherit'
|
|
51
|
+
// Used when no class prop is provided
|
|
52
|
+
|
|
53
|
+
noFlexLayout?: boolean;
|
|
54
|
+
// default: false
|
|
55
|
+
// Disables the default flex layout behavior
|
|
56
|
+
|
|
57
|
+
noMargin?: boolean;
|
|
58
|
+
// default: false
|
|
59
|
+
// Disables default mb-2.5 margin
|
|
60
|
+
|
|
61
|
+
noLeading?: boolean;
|
|
62
|
+
// default: false
|
|
63
|
+
// Disables default leading-none line height
|
|
39
64
|
}
|
|
65
|
+
```
|
|
40
66
|
|
|
67
|
+
### HTML Attributes Support
|
|
68
|
+
|
|
69
|
+
The component supports all standard HTML attributes via `v-bind="$attrs"`:
|
|
70
|
+
|
|
71
|
+
```vue
|
|
72
|
+
<Headline
|
|
73
|
+
as="h1"
|
|
74
|
+
class="text-4xl"
|
|
75
|
+
id="main-title"
|
|
76
|
+
data-section="hero"
|
|
77
|
+
aria-label="Main headline"
|
|
78
|
+
>
|
|
79
|
+
Accessible Headline
|
|
80
|
+
</Headline>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### CSS Custom Properties
|
|
84
|
+
|
|
85
|
+
Customize underline colors using CSS variables:
|
|
86
|
+
|
|
87
|
+
```css
|
|
88
|
+
/* Override underline colors globally */
|
|
89
|
+
:root {
|
|
90
|
+
--headline-underline-accent: #0066cc; /* Main underline color */
|
|
91
|
+
--headline-underline-base: #999999; /* Thin line color */
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Or scope to specific headlines */
|
|
95
|
+
.custom-headline {
|
|
96
|
+
--headline-underline-accent: #ff6600;
|
|
97
|
+
--headline-underline-base: #cccccc;
|
|
98
|
+
}
|
|
41
99
|
```
|
|
42
100
|
|
|
43
101
|
|
|
44
102
|
## Examples
|
|
45
103
|
|
|
104
|
+
### Basic Usage
|
|
105
|
+
|
|
46
106
|
<div class="component-preview flex-wrap flex-col justify-start !items-start">
|
|
47
107
|
<ul class="list-decimal list-outside">
|
|
48
|
-
<li class="px-4 pb-4"><Headline as="h1" font-family="head" font-weight="regular">Regular Headline</Headline></li>
|
|
49
|
-
<li class="px-4 pb-4"><Headline as="h2" font-family="head" font-weight="light">Light Headline</Headline></li>
|
|
50
|
-
<li class="px-4 pb-4"><Headline as="
|
|
51
|
-
<li class="px-4 pb-4"><Headline as="
|
|
52
|
-
<li class="px-4 pb-4"><Headline as="
|
|
53
|
-
<li class="px-4 pb-4"><Headline as="
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<li class="px-4 pb-4"><Headline as="
|
|
62
|
-
<li class="px-4 pb-4"><Headline as="
|
|
108
|
+
<li class="px-4 pb-4"><Headline as="h1" font-family="head" font-weight="regular" class="text-xl">Regular Headline</Headline></li>
|
|
109
|
+
<li class="px-4 pb-4"><Headline as="h2" font-family="head" font-weight="light" class="text-lg">Light Headline</Headline></li>
|
|
110
|
+
<li class="px-4 pb-4"><Headline as="h3" font-family="head" font-weight="bold" class="text-2xl">Bold Headline</Headline></li>
|
|
111
|
+
<li class="px-4 pb-4"><Headline as="h4" font-family="head" font-weight="light-bold" class="text-base">Light Bold Headline</Headline></li>
|
|
112
|
+
<li class="px-4 pb-4"><Headline as="h5" font-family="head" font-weight="light-thin" class="text-sm">Light Thin Headline</Headline></li>
|
|
113
|
+
<li class="px-4 pb-4"><Headline as="p" font-family="text" class="text-base">Default Text (inherits size)</Headline></li>
|
|
114
|
+
</ul>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
### Responsive Typography
|
|
118
|
+
|
|
119
|
+
<div class="component-preview flex-wrap flex-col justify-start !items-start">
|
|
120
|
+
<ul class="list-decimal list-outside">
|
|
121
|
+
<li class="px-4 pb-4"><Headline as="h1" class="text-2xl md:text-4xl lg:text-6xl">Responsive Hero</Headline></li>
|
|
122
|
+
<li class="px-4 pb-4"><Headline as="h2" font-weight="bold" class="text-xl md:text-3xl lg:text-5xl">Bold Responsive</Headline></li>
|
|
123
|
+
<li class="px-4 pb-4"><Headline as="h3" class="text-base sm:text-lg md:text-xl lg:text-2xl xl:text-3xl">Multi-breakpoint</Headline></li>
|
|
124
|
+
<li class="px-4 pb-4"><Headline as="h2" font-weight="light-bold" class="text-lg md:text-2xl lg:text-4xl 3xl:text-6xl">Extra large screens</Headline></li>
|
|
125
|
+
</ul>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
### Font Families & Weights
|
|
129
|
+
|
|
130
|
+
<div class="component-preview flex-wrap flex-col justify-start !items-start">
|
|
131
|
+
<ul class="list-decimal list-outside">
|
|
132
|
+
<li class="px-4 pb-4"><Headline as="p" font-family="text" font-weight="light" class="text-base">Light Text</Headline></li>
|
|
133
|
+
<li class="px-4 pb-4"><Headline as="p" font-family="text" font-weight="bold" class="text-base">Bold Text</Headline></li>
|
|
134
|
+
<li class="px-4 pb-4"><Headline as="code" font-family="novamono" class="text-sm">Nova Mono Code</Headline></li>
|
|
135
|
+
<li class="px-4 pb-4"><Headline as="code" font-family="mono" class="text-sm">Mono Code</Headline></li>
|
|
136
|
+
</ul>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
### With Underline
|
|
140
|
+
|
|
141
|
+
<div class="component-preview flex-wrap flex-col justify-start !items-start">
|
|
142
|
+
<ul class="list-decimal list-outside">
|
|
143
|
+
<li class="px-4 pb-4"><Headline as="h2" font-weight="light-thin" class="text-3xl" underline>Underlined Headline</Headline></li>
|
|
144
|
+
<li class="px-4 pb-4"><Headline as="h2" font-weight="bold" class="text-2xl md:text-4xl" underline="center">Centered Underline</Headline></li>
|
|
145
|
+
</ul>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
### With Icons
|
|
149
|
+
|
|
150
|
+
<div class="component-preview flex-wrap flex-col justify-start !items-start">
|
|
151
|
+
<ul class="list-decimal list-outside">
|
|
152
|
+
<li class="px-4 pb-4"><Headline as="h3" font-weight="bold" class="text-2xl">
|
|
63
153
|
<Icon name="ph:cat-thin" class="inline-block mr-4" />
|
|
64
154
|
Headline with Icon
|
|
65
155
|
</Headline></li>
|
|
66
|
-
<li class="px-4 pb-4"><Headline as="h1"
|
|
67
|
-
<li class="px-4 pb-4"><Headline as="h1" font-family="head" font-weight="light-bold" text-size="4xl" underline>
|
|
156
|
+
<li class="px-4 pb-4"><Headline as="h1" font-weight="light-bold" class="text-xl md:text-3xl lg:text-5xl" underline>
|
|
68
157
|
<Icon name="ph:cat-thin" class="inline-block mr-4" />
|
|
69
|
-
|
|
158
|
+
Responsive with Icon & Underline
|
|
70
159
|
</Headline></li>
|
|
71
160
|
</ul>
|
|
72
161
|
</div>
|
|
73
162
|
|
|
74
|
-
|
|
75
|
-
/* 1 */
|
|
76
|
-
<Headline as="h1" font-family="head" font-weight="regular">Regular Headline</Headline>
|
|
163
|
+
## Code Examples
|
|
77
164
|
|
|
78
|
-
|
|
79
|
-
|
|
165
|
+
### Basic Usage
|
|
166
|
+
```vue
|
|
167
|
+
<!-- Simple headline with defaults (inherits font size) -->
|
|
168
|
+
<Headline as="h1">Default Headline</Headline>
|
|
80
169
|
|
|
81
|
-
|
|
82
|
-
<Headline as="
|
|
170
|
+
<!-- With explicit size -->
|
|
171
|
+
<Headline as="h1" class="text-xl">Regular Headline</Headline>
|
|
83
172
|
|
|
84
|
-
|
|
85
|
-
<Headline as="
|
|
173
|
+
<!-- Font family and weight -->
|
|
174
|
+
<Headline as="h2" font-weight="light" class="text-lg">Light Headline</Headline>
|
|
175
|
+
<Headline as="h3" font-weight="bold" class="text-2xl">Bold Headline</Headline>
|
|
176
|
+
```
|
|
86
177
|
|
|
87
|
-
|
|
88
|
-
|
|
178
|
+
### Responsive Typography
|
|
179
|
+
```vue
|
|
180
|
+
<!-- Hero headline - small on mobile, large on desktop -->
|
|
181
|
+
<Headline as="h1" class="text-2xl md:text-4xl lg:text-6xl">
|
|
182
|
+
Responsive Hero
|
|
183
|
+
</Headline>
|
|
89
184
|
|
|
90
|
-
|
|
91
|
-
<Headline as="
|
|
185
|
+
<!-- Progressive scaling across all breakpoints -->
|
|
186
|
+
<Headline as="h2" class="text-base sm:text-lg md:text-xl lg:text-2xl xl:text-3xl">
|
|
187
|
+
Multi-breakpoint Headline
|
|
188
|
+
</Headline>
|
|
92
189
|
|
|
93
|
-
|
|
94
|
-
<Headline as="
|
|
190
|
+
<!-- Extra large screens support -->
|
|
191
|
+
<Headline as="h2" font-weight="light-bold" class="text-lg md:text-2xl lg:text-4xl 3xl:text-6xl">
|
|
192
|
+
Scales up to 3xl breakpoint
|
|
193
|
+
</Headline>
|
|
194
|
+
```
|
|
95
195
|
|
|
96
|
-
|
|
97
|
-
|
|
196
|
+
### Font Families
|
|
197
|
+
```vue
|
|
198
|
+
<!-- Heading font (default) -->
|
|
199
|
+
<Headline as="h1" font-weight="regular" class="text-xl">
|
|
200
|
+
Regular Headline
|
|
201
|
+
</Headline>
|
|
98
202
|
|
|
99
|
-
|
|
100
|
-
<Headline as="p" font-family="text" font-weight="light-
|
|
203
|
+
<!-- Text font for body content -->
|
|
204
|
+
<Headline as="p" font-family="text" font-weight="light" class="text-base">
|
|
205
|
+
Light Text Content
|
|
206
|
+
</Headline>
|
|
101
207
|
|
|
102
|
-
|
|
103
|
-
<Headline as="
|
|
208
|
+
<!-- Monospace fonts -->
|
|
209
|
+
<Headline as="code" font-family="novamono" class="text-sm">
|
|
210
|
+
Nova Mono Code
|
|
211
|
+
</Headline>
|
|
104
212
|
|
|
105
|
-
|
|
106
|
-
|
|
213
|
+
<Headline as="code" font-family="mono" class="text-sm">
|
|
214
|
+
Mono Code
|
|
215
|
+
</Headline>
|
|
216
|
+
```
|
|
107
217
|
|
|
108
|
-
|
|
109
|
-
|
|
218
|
+
### With Underline
|
|
219
|
+
```vue
|
|
220
|
+
<!-- Left-aligned underline -->
|
|
221
|
+
<Headline as="h2" class="text-3xl" underline>
|
|
222
|
+
Underlined Headline
|
|
223
|
+
</Headline>
|
|
110
224
|
|
|
111
|
-
|
|
112
|
-
<Headline as="
|
|
225
|
+
<!-- Centered underline with responsive sizing -->
|
|
226
|
+
<Headline as="h2" font-weight="bold" class="text-2xl md:text-4xl" underline="center">
|
|
227
|
+
Centered Underline
|
|
228
|
+
</Headline>
|
|
229
|
+
```
|
|
113
230
|
|
|
114
|
-
|
|
115
|
-
|
|
231
|
+
### With Icons
|
|
232
|
+
```vue
|
|
233
|
+
<!-- Icon with responsive sizing -->
|
|
234
|
+
<Headline as="h1" font-weight="light-bold" class="text-xl md:text-3xl lg:text-5xl" underline>
|
|
235
|
+
<Icon name="ph:cat-thin" class="inline-block mr-4" />
|
|
236
|
+
Complete Example
|
|
237
|
+
</Headline>
|
|
116
238
|
|
|
117
|
-
|
|
118
|
-
<Headline as="h3" font-
|
|
119
|
-
<Icon name="ph:cat-thin" class="inline-block mr-4
|
|
239
|
+
<!-- Simple icon headline -->
|
|
240
|
+
<Headline as="h3" font-weight="bold" class="text-2xl">
|
|
241
|
+
<Icon name="ph:cat-thin" class="inline-block mr-4" />
|
|
120
242
|
Headline with Icon
|
|
121
243
|
</Headline>
|
|
244
|
+
```
|
|
122
245
|
|
|
123
|
-
|
|
124
|
-
|
|
246
|
+
### Custom Styling
|
|
247
|
+
```vue
|
|
248
|
+
<!-- Combine with any UnoCSS/Tailwind utilities -->
|
|
249
|
+
<Headline as="h1" class="text-4xl md:text-6xl text-blue-600 dark:text-blue-400">
|
|
250
|
+
Colored Headline
|
|
251
|
+
</Headline>
|
|
125
252
|
|
|
126
|
-
|
|
127
|
-
<Headline
|
|
128
|
-
|
|
129
|
-
|
|
253
|
+
<!-- Responsive colors and sizes -->
|
|
254
|
+
<Headline
|
|
255
|
+
as="h2"
|
|
256
|
+
font-weight="bold"
|
|
257
|
+
class="text-2xl md:text-4xl text-slate-700 md:text-blue-600"
|
|
258
|
+
>
|
|
259
|
+
Responsive Color & Size
|
|
260
|
+
</Headline>
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Advanced Features
|
|
264
|
+
|
|
265
|
+
#### Remove Default Spacing
|
|
266
|
+
```vue
|
|
267
|
+
<!-- No bottom margin -->
|
|
268
|
+
<Headline as="h1" class="text-4xl" no-margin>
|
|
269
|
+
Headline without margin
|
|
270
|
+
</Headline>
|
|
271
|
+
|
|
272
|
+
<!-- No line height adjustment -->
|
|
273
|
+
<Headline as="h2" class="text-2xl" no-leading>
|
|
274
|
+
Headline with normal line height
|
|
130
275
|
</Headline>
|
|
131
276
|
|
|
277
|
+
<!-- Remove both -->
|
|
278
|
+
<Headline as="h3" class="text-xl" no-margin no-leading>
|
|
279
|
+
Fully custom spacing
|
|
280
|
+
</Headline>
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
#### Disable Flex Layout
|
|
284
|
+
```vue
|
|
285
|
+
<!-- By default, headlines without underline use flex layout for icon alignment -->
|
|
286
|
+
<!-- Disable it with noFlexLayout -->
|
|
287
|
+
<Headline as="h2" class="text-2xl" no-flex-layout>
|
|
288
|
+
Block-level headline
|
|
289
|
+
</Headline>
|
|
290
|
+
```
|
|
132
291
|
|
|
292
|
+
#### Custom Underline Colors
|
|
293
|
+
```vue
|
|
294
|
+
<!-- In your component or style tag -->
|
|
295
|
+
<style>
|
|
296
|
+
.custom-underline-headline {
|
|
297
|
+
--headline-underline-accent: #ff6600;
|
|
298
|
+
--headline-underline-base: #cccccc;
|
|
299
|
+
}
|
|
300
|
+
</style>
|
|
301
|
+
|
|
302
|
+
<Headline
|
|
303
|
+
as="h1"
|
|
304
|
+
class="text-4xl custom-underline-headline"
|
|
305
|
+
underline
|
|
306
|
+
>
|
|
307
|
+
Custom colored underline
|
|
308
|
+
</Headline>
|
|
309
|
+
```
|
|
133
310
|
|
|
311
|
+
#### Accessibility Features
|
|
312
|
+
```vue
|
|
313
|
+
<!-- Add ARIA attributes for screen readers -->
|
|
314
|
+
<Headline
|
|
315
|
+
as="h1"
|
|
316
|
+
class="text-4xl"
|
|
317
|
+
id="page-title"
|
|
318
|
+
role="heading"
|
|
319
|
+
aria-level="1"
|
|
320
|
+
aria-label="Welcome to our website"
|
|
321
|
+
>
|
|
322
|
+
Welcome
|
|
323
|
+
</Headline>
|
|
324
|
+
|
|
325
|
+
<!-- Add data attributes for tracking or testing -->
|
|
326
|
+
<Headline
|
|
327
|
+
as="h2"
|
|
328
|
+
class="text-2xl"
|
|
329
|
+
data-testid="section-heading"
|
|
330
|
+
data-analytics="hero-title"
|
|
331
|
+
>
|
|
332
|
+
Section Title
|
|
333
|
+
</Headline>
|
|
134
334
|
```
|
|
135
335
|
|
|
136
336
|
|
package/uno-config/index.ts
CHANGED
|
@@ -165,6 +165,8 @@ export function createSdsConfig(customConfig: CustomConfig = {}) {
|
|
|
165
165
|
// All peer selectors from the list (needed for floating labels)
|
|
166
166
|
...peerSelectorClasses,
|
|
167
167
|
],
|
|
168
|
+
// Disable default extractors to prevent false positives from JavaScript code
|
|
169
|
+
extractorDefault: false,
|
|
168
170
|
// Optimized extractors for static Astro builds
|
|
169
171
|
extractors: [
|
|
170
172
|
{
|
|
@@ -207,7 +209,7 @@ export function createSdsConfig(customConfig: CustomConfig = {}) {
|
|
|
207
209
|
presetAttributify(),
|
|
208
210
|
presetIcons({
|
|
209
211
|
scale: 1.2,
|
|
210
|
-
warn: true,
|
|
212
|
+
warn: true, // Show warnings for actual missing icons
|
|
211
213
|
prefix: 'i-',
|
|
212
214
|
extraProperties: {
|
|
213
215
|
'display': 'inline-block',
|
|
@@ -7,7 +7,7 @@ import { breakpoints } from './../breakpoints';
|
|
|
7
7
|
|
|
8
8
|
export const jumbotronShortcuts = [
|
|
9
9
|
// Default variant
|
|
10
|
-
['jumbotron-header-base', 'relative mx-auto my-auto
|
|
10
|
+
['jumbotron-header-base', 'relative mx-auto my-auto w-full text-center py-8'],
|
|
11
11
|
['jumbotron-container-small', 'md:min-h-xs sm:py-12 md:py-14 lg:py-16 xl:py-20'],
|
|
12
12
|
['jumbotron-container-large', 'md:min-h-md sm:py-16 md:py-20 lg:py-28 xl:py-32'],
|
|
13
13
|
['jumbotron-title-default', 'text-3xl headline-light text-white sm:(text-4xl pt-0) md:text-5xl lg:text-6xl'],
|