Skip to content

Commit

Permalink
chore(tailwind): config and pulse class
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindgrutle committed May 22, 2024
1 parent fdd99e3 commit 37fbdd8
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
4 changes: 4 additions & 0 deletions next-tavla/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@
border-radius: 0.5em;
}

.pulse {
@apply inline-flex rounded-full bg-success h-em-0.75 w-em-0.75 left-[calc(50%-(0.75em/2))] bottom-[calc(50%-(0.75em/2))];
}

/* For Tavla using pages */

.root {
Expand Down
2 changes: 1 addition & 1 deletion next-tavla/src/Board/scenarios/Board/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function Board({ board, style }: { board: TBoard; style?: CSSProperties }) {

return (
<div
className={`grid grid-cols-auto-fit-minmax gap-[10px] h-full overflow-hidden supports-[not(display:grid)]:flex supports-[not(display:grid)]:*:m-[10px] ${getFontScale(
className={`grid grid-cols-auto-fit-minmax gap-2.5 h-full overflow-hidden supports-[not(display:grid)]:flex supports-[not(display:grid)]:*:m-2.5 ${getFontScale(
board.meta?.fontSize || defaultFontSize(board),
)} `}
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Line() {
<TableColumn title="Linje">
{lines.map((line) => (
<TableRow key={line.key}>
<div className="flex gap-2 justify-start items-center p-r-2 w-full">
<div className="flex gap-2 justify-start items-center pr-2 w-full">
<TravelTag
transportMode={line.transportMode}
transportSubmode={line.transportSubmode}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ function Situation({
<div className="fill-warning flex items-center mr-[0.1em] text-[1.8em]">
<ValidationExclamation />
</div>
<div className="overflow-hidden text-ellipsis whitespace-nowrap">
{situationText}
</div>
<div className="truncate">{situationText}</div>
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function StopPlaceDeviation({
if (!situations || numberOfSituations === 0) return null

return (
<div className="pb-[0.5em]">
<div className="pb-em-0.5">
<Situation situation={situations[index % numberOfSituations]} />
</div>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function TableRow({ children }: { children: React.ReactNode }) {
return (
<div className="flex items-center h-em-3 border-t border-solid border-t-secondary">
<div className="w-full mx-[0.25em]">{children}</div>
<div className="w-full mx-em-0.25">{children}</div>
</div>
)
}
Expand Down
4 changes: 2 additions & 2 deletions next-tavla/src/Shared/components/Pulse/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function Pulse() {
return (
<div className="relative flex h-full w-full">
<span className="animate-ping-slow absolute inline-flex rounded-full bg-success h-[0.75em] w-[0.75em] left-[calc(50%-(0.75em/2))] bottom-[calc(50%-(0.75em/2))]"></span>
<span className="relative inline-flex rounded-full bg-success h-[0.75em] w-[0.75em] left-[calc(50%-(0.75em/2))] bottom-[calc(50%-(0.75em/2))]"></span>
<span className="animate-ping-slow absolute pulse"></span>
<span className="relative pulse"></span>
</div>
)
}
Expand Down
6 changes: 3 additions & 3 deletions next-tavla/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ module.exports = {
'em-lg': '1.3em',
},
spacing: {
'em-0.25': '0.25em',
'em-0.5': '0.5em',
'em-0.75': '0.75em',
'em-1': '1em',
'em-2': '2em',
'em-3': '3em',
},
gridTemplateColumns: {
'auto-fit-minmax': 'repeat(auto-fit, minmax(60vmin, 1fr))',
},
content: {
content: ' ',
},
animation: {
'ping-slow': 'ping 8s infinite',
},
Expand Down

0 comments on commit 37fbdd8

Please sign in to comment.