Skip to content

Commit

Permalink
Merge pull request #36 from danskernesdigitalebibliotek/DDFBRA-177-ma…
Browse files Browse the repository at this point in the history
…ke-a-story-for-all-fonts

feat: add Fonts component and Storybook stories for typography display and test
  • Loading branch information
ThomasGross authored Nov 11, 2024
2 parents 47e9519 + 7eed3e0 commit 8ef0d8c
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
25 changes: 25 additions & 0 deletions components/shared/fonts/Fonts.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { Meta, StoryObj } from "@storybook/react"

import { darkModeDecorator } from "@/.storybook/decorators"

import Fonts from "./Fonts"

// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
const meta = {
title: "components/Fonts",
component: Fonts,
parameters: {
layout: "centered",
},
tags: ["autodocs"],
} satisfies Meta<typeof Fonts>

export default meta
type Story = StoryObj<typeof meta>

// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
export const Default: Story = {}

export const FontsDarkMode: Story = {
decorators: [darkModeDecorator],
}
28 changes: 28 additions & 0 deletions components/shared/fonts/Fonts.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react"

const Fonts = () => {
return (
<div className="space-y-10">
<h1 className="text-typo-huge">text-typo-huge</h1>
<h1 className="text-typo-heading-1">text-typo-heading-1</h1>
<h2 className="text-typo-heading-2">text-typo-heading-2</h2>
<h3 className="text-typo-heading-3">text-typo-heading-3</h3>
<h4 className="text-typo-heading-4">text-typo-heading-4</h4>
<h5 className="text-typo-heading-5">text-typo-heading-5</h5>
<p className="text-typo-subtitle-lg">text-typo-subtitle-lg</p>
<p className="text-typo-subtitle-md">text-typo-subtitle-md</p>
<p className="text-typo-subtitle-sm">text-typo-subtitle-sm</p>
<p className="text-typo-body-lg">text-typo-body-lg</p>
<p className="text-typo-body-md">text-typo-body-md</p>
<p className="text-typo-body-sm">text-typo-body-sm</p>
<p className="text-typo-button-lg">text-typo-button-lg</p>
<p className="text-typo-button-sm">text-typo-button-sm</p>
<p className="text-typo-link">text-typo-link</p>
<p className="text-typo-tag-lg">text-typo-tag-lg</p>
<p className="text-typo-tag-sm">text-typo-tag-sm</p>
<p className="text-typo-caption">text-typo-caption</p>
</div>
)
}

export default Fonts

0 comments on commit 8ef0d8c

Please sign in to comment.