-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: ✨ chip and tag * refactor(chip): ♻️ align styles with md3
- Loading branch information
Showing
6 changed files
with
72 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts"> | ||
import type { Hst } from '@histoire/plugin-svelte' | ||
import style from 'shiraha-ve/dist/typography/chip/global.css?inline' | ||
export let Hst: Hst | ||
let text = 'Chip' | ||
</script> | ||
|
||
<Hst.Story title="Chip"> | ||
<Hst.Variant title="default"> | ||
<svelte:element this={'style'}>{style}</svelte:element> | ||
{#each { length: 5 } as _} | ||
<!-- svelte-ignore a11y-invalid-attribute --> | ||
<a href="#" rel="chip">{@html text}</a> | ||
{/each} | ||
</Hst.Variant> | ||
|
||
<svelte:fragment slot="controls"> | ||
<Hst.Text bind:value={text} title="Chip Text" /> | ||
</svelte:fragment> | ||
</Hst.Story> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { globalStyle } from '@vanilla-extract/css' | ||
|
||
import * as styles from './styles' | ||
|
||
globalStyle(':where(a[rel="chip"])', styles.chip) | ||
|
||
globalStyle(':where(a[rel="chip"]):hover', styles.chipHover) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { ComplexStyleRule } from '@vanilla-extract/css' | ||
|
||
import { vars } from '../../vars.css' | ||
|
||
export const chip = { | ||
backgroundColor: vars.color.surfaceContainerLow, | ||
borderRadius: '8px', | ||
color: vars.color.onSurface, | ||
display: 'inline-block', | ||
fontSize: '14px', | ||
fontWeight: 500, | ||
marginRight: '4px', | ||
paddingBlock: '4px', | ||
paddingInline: '12px', | ||
} as const satisfies ComplexStyleRule | ||
|
||
export const chipHover = { | ||
backgroundColor: vars.color.secondaryContainer, | ||
} as const satisfies ComplexStyleRule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters