Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/x-design-system/demo/shims-vue.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
declare module '*.vue' {
import type { DefineComponent } from 'vue'
// eslint-disable-next-line ts/no-empty-object-type
const component: DefineComponent<{}, {}, any>
const component: DefineComponent<object, object, unknown>
export default component
}

Expand Down
2 changes: 2 additions & 0 deletions packages/x-design-system/demo/src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<Input />
<ProgressBar />
<Integration />
<Typography />
</template>

<script setup lang="ts">
Expand All @@ -18,4 +19,5 @@ import Icon from './components/icon.vue'
import Input from './components/input.vue'
import Integration from './components/integration.vue'
import ProgressBar from './components/progress-bar.vue'
import Typography from './components/typography.vue'
</script>
1 change: 0 additions & 1 deletion packages/x-design-system/demo/src/components/icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ const rows = [
'background-color',
'sharp',
'stroke-width',
'icon-offset',
'combinations',
]

Expand Down
31 changes: 31 additions & 0 deletions packages/x-design-system/demo/src/components/typography.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<template>
<Wrapper feature="Typography" :rows="rows">
<template v-for="row in rows" :key="row" #[row]>
<p
class="xds:whitespace-normal"
:class="[row.includes('-') ? `xds:${row.split('-')[0]}` : '', `xds:${row}`]"
>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce gravida posuere nisi, sed
porttitor sem semper ac. Aliquam erat volutpat
</p>
</template>
</Wrapper>
</template>

<script setup lang="ts">
import Wrapper from './wrapper.vue'

/*
Tailwind safelist classes:
xds:text1 xds:text1-sm xds:text1-md xds:text1-lg
xds:text2 xds:text2-sm xds:text2-md xds:text2-lg
xds:title1 xds:title1-sm xds:title1-md xds:title1-lg
xds:title2 xds:title2-sm xds:title2-md xds:title2-lg
xds:title3 xds:title3-sm xds:title3-md xds:title3-lg
xds:title4 xds:title4-sm xds:title4-md xds:title4-lg
*/

const utilities = ['text1', 'text2', 'title1', 'title2', 'title3', 'title4']
const sizes = ['sm', 'md', 'lg']
const rows = utilities.map(utility => [utility, ...sizes.map(size => `${utility}-${size}`)]).flat()
</script>
1 change: 1 addition & 0 deletions packages/x-design-system/lib/components/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
@import './icon.css';
@import './input.css';
@import './progress-bar.css';
@import './typography.css';
89 changes: 89 additions & 0 deletions packages/x-design-system/lib/components/typography.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/* text1 */
@utility text1 {
@apply xds:font-family-main xds:font-regular;
@apply xds:text1-md;
}
@utility text1-sm {
@apply xds:text-xs/(--xds-line-height-lg);
Copy link
Contributor

@Turito Turito Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If in theme.css we would use spacing-lg instead of line-height-lg then we could use xds:leading-lg (https://tailwindcss.com/docs/line-height#customizing-your-theme).

WDYT?

}
@utility text1-md {
@apply xds:text-sm/(--xds-line-height-md);
}
@utility text1-lg {
@apply xds:text-md;
}

/* text2 */
@utility text2 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text1 and test2 has the same styles. Why don't we reduce them and use just one?

WDYT? If yes, maybe in other PR

@apply xds:font-family-main xds:font-regular;
@apply xds:text2-md;
}
@utility text2-sm {
@apply xds:text-xs/(--xds-line-height-lg);
}
@utility text2-md {
@apply xds:text-sm/(--xds-line-height-md);
}
@utility text2-lg {
@apply xds:text-md;
}

/* title1 */
@utility title1 {
@apply xds:font-family-main xds:font-bold;
@apply xds:title1-md;
}
@utility title1-sm {
@apply xds:text-xl/(--xds-line-height-md);
}
@utility title1-md {
@apply xds:text-2xl/(--xds-line-height-sm);
}
@utility title1-lg {
@apply xds:text-4xl;
}

/* title2 */
@utility title2 {
@apply xds:font-family-main xds:font-bold;
@apply xds:title2-md;
}
@utility title2-sm {
@apply xds:text-lg;
}
@utility title2-md {
@apply xds:text-xl/(--xds-line-height-md);
}
@utility title2-lg {
@apply xds:text-3xl/(--xds-line-height-sm);
}

/* title3 */
@utility title3 {
@apply xds:font-family-main xds:font-bold;
@apply xds:title3-md;
}
@utility title3-sm {
@apply xds:text-sm;
}
@utility title3-md {
@apply xds:text-md/(--xds-line-height-md);
}
@utility title3-lg {
@apply xds:text-xl;
}

/* title4 */
@utility title4 {
@apply xds:font-family-main xds:font-bold;
@apply xds:title4-md;
}
@utility title4-sm {
@apply xds:text-xs;
}
@utility title4-md {
@apply xds:text-sm/(--xds-line-height-md);
}
@utility title4-lg {
@apply xds:text-lg;
}
Loading