Skip to content

Commit

Permalink
chore(): add globals for em font size
Browse files Browse the repository at this point in the history
  • Loading branch information
emilielr committed Apr 30, 2024
1 parent ed9bd53 commit a6c4d47
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
8 changes: 4 additions & 4 deletions next-tavla/src/Board/scenarios/Board/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { TBoard } from 'types/settings'
export function getFontScale(fontSize: TFontSize | undefined) {
switch (fontSize) {
case 'small':
return 'text-sm'
return 'em-text-sm'
case 'medium':
return 'text-base'
return 'em-text-base'
case 'large':
return 'text-lg'
return 'em-text-lg'
default:
return 'text-base'
return 'em-text-base'
}
}
export function defaultFontSize(board: TBoard) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ function TableColumn({
}) {
return (
<div className={`flex flex-col ${className}`}>
<div className="text-tertiary text-sm pb-2 ml-2 mr-2">{title}</div>
<div className="text-tertiary em-text-sm pb-2 ml-2 mr-2">
{title}
</div>
{children}
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function Time({
<div className="text-right font-semibold text-estimated-time text-[0.75em]">
Innstilt
</div>
<div className="text-right text-xs line-through">
<div className="text-right em-text-xs line-through">
{formatDateString(aimedDepartureTime)}
</div>
</>
Expand All @@ -62,7 +62,7 @@ function Time({
<div className="text-right font-semibold text-estimated-time">
{getRelativeTimeString(expectedDepartureTime)}
</div>
<div className="text-right text-xs line-through">
<div className="text-right em-text-xs line-through">
{formatDateString(aimedDepartureTime)}
</div>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function FormattedTime({ time }: { time: string }) {
{getRelativeTimeString(time)}
</div>
{!isDateStringToday(time) && (
<div className="text-right text-xs">{getDate(time)}</div>
<div className="text-right em-text-xs">{getDate(time)}</div>
)}
</>
)
Expand Down
12 changes: 6 additions & 6 deletions next-tavla/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ module.exports = {
container: {
padding: '2rem',
},
fontSize: {
xs: '0.5625em',
sm: '0.7em',
base: '1em',
lg: '1.3em',
},
extend: {
colors: {
'base-primary': 'var(--main-background-color)',
Expand All @@ -50,6 +44,12 @@ module.exports = {
borderRadius: {
DEFAULT: '0.5em',
},
fontSize: {
'em-text-xs': '0.5625em',
'em-text-sm': '0.7em',
'em-text-base': '1em',
'em-text-lg': '1.3em',
},
},
},
safelist: Object.keys(transportModes).map((key) => `bg-${key}`),
Expand Down

0 comments on commit a6c4d47

Please sign in to comment.