Skip to content

Commit

Permalink
feat(tailwind)!: remove fontSize config from tailwind.config.ts
Browse files Browse the repository at this point in the history
- remove exported config
- remove usages of 'text-h1' in Slider stories
  • Loading branch information
booc0mtaco committed Mar 4, 2024
1 parent 3b3d5e7 commit 39fd73b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 29 deletions.
16 changes: 10 additions & 6 deletions src/components/Slider/Slider.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,15 @@ export const WithHighlightedContent: Story = {
onChange={({ target }) => setSliderValue(Number(target.value))}
value={sliderValue}
/>
<div className="text-h1">
<Text as="span" preset="body-xl">
{moodData.map((mood, index) => {
return (
sliderValue === mood.value && (
<span key={`mood-emoji-${mood.emoji}`}>{mood.emoji}</span>
)
);
})}
</div>
</Text>
</div>
<Text className="py-3 text-center" id="mood-description">
Current mood:{' '}
Expand Down Expand Up @@ -340,15 +340,15 @@ export const WithVisualLabel: Story = {
id="slider-label"
text="Mood Slider"
/>
<div className="w-1/2 py-4 text-center text-h1">
<Text as="span" className="w-1/2 py-4 text-center" preset="body-xl">
{moodData.map((mood) => {
return (
sliderValue === mood.value && (
<span key={`mood-emoji-${mood.emoji}`}>{mood.emoji}</span>
)
);
})}
</div>
</Text>
<Slider
aria-label="Mood Slider"
aria-labelledby="slider-label"
Expand Down Expand Up @@ -383,7 +383,11 @@ export const WithMultipleVisualLabels: Story = {
id="slider-label"
text="Mood Slider"
/>
<div className="flex w-1/2 justify-between py-4 text-center text-h1">
<Text
as="span"
className="flex w-1/2 justify-between py-4 text-center"
preset="body-xl"
>
{moodData.map((mood, index) => {
return (
<div
Expand All @@ -398,7 +402,7 @@ export const WithMultipleVisualLabels: Story = {
</div>
);
})}
</div>
</Text>
<Slider
aria-label="Mood Slider"
aria-labelledby="slider-label"
Expand Down
18 changes: 9 additions & 9 deletions src/components/Slider/__snapshots__/Slider.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,13 @@ exports[`<Slider /> WithHighlightedContent story renders snapshot 1`] = `
class="slider__thumb-proxy"
/>
</div>
<div
class="text-h1"
<span
class="text text--body-xl"
>
<span>
😐
</span>
</div>
</span>
</div>
<p
class="text text--body-md py-3 text-center"
Expand Down Expand Up @@ -609,8 +609,8 @@ exports[`<Slider /> WithMultipleVisualLabels story renders snapshot 1`] = `
Mood Slider
</label>
<div
class="flex w-1/2 justify-between py-4 text-center text-h1"
<span
class="text text--body-xl flex w-1/2 justify-between py-4 text-center"
>
<div
class=""
Expand All @@ -637,7 +637,7 @@ exports[`<Slider /> WithMultipleVisualLabels story renders snapshot 1`] = `
>
😍
</div>
</div>
</span>
<div
class="slider w-1/2"
>
Expand Down Expand Up @@ -707,13 +707,13 @@ exports[`<Slider /> WithVisualLabel story renders snapshot 1`] = `
Mood Slider
</label>
<div
class="w-1/2 py-4 text-center text-h1"
<span
class="text text--body-xl w-1/2 py-4 text-center"
>
<span>
😐
</span>
</div>
</span>
<div
class="slider w-1/2"
>
Expand Down
1 change: 1 addition & 0 deletions src/components/Toggle/Toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Switch } from '@headlessui/react';
import clsx from 'clsx';
import React from 'react';
import type { EitherInclusive, ExtractProps } from '../../util/utility-types';

import styles from './Toggle.module.css';

type ToggleLabelProps = {
Expand Down
14 changes: 0 additions & 14 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,6 @@ export default {
...textColorTokens,
},
},
fontSize: {
// provide values for both font-size and line-height
body: [edsTokens['font-size']['16'], '1.5'],
h1: [edsTokens['font-size']['40'], '1.2'],
h2: [edsTokens['font-size']['32'], '1.25'],
h3: [edsTokens['font-size']['24'], '1.333'],
h4: [edsTokens['font-size']['18'], '1.333'],
h5: [edsTokens['font-size']['16'], '1.5'],
h6: [edsTokens['font-size']['14'], '1.57'],
h7: [edsTokens['font-size']['12'], '1.666'],
sm: [edsTokens['font-size']['14'], '1.57'],
xs: [edsTokens['font-size']['12'], '1.666'],
caption: [edsTokens['font-size']['12'], '1.666'],
},
fontWeight: {
normal: edsTokens['font-weight'].light,
medium: edsTokens['font-weight'].medium,
Expand Down

0 comments on commit 39fd73b

Please sign in to comment.