Skip to content

Commit

Permalink
add desktop-only and mobile-only global classes
Browse files Browse the repository at this point in the history
  • Loading branch information
arzafran committed Feb 21, 2025
1 parent 970b105 commit 170ce73
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions styles/css/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@
@variant dt { font-size: calc(((24 * 100) / var(--device-width)) * 1vw); }
}

@utility desktop-only {
@media (--mobile) {
display: none;
}
}

@utility mobile-only {
@media (--desktop) {
display: none;
}
}

@utility design-grid {
display: grid;
grid-template-columns: repeat(var(--columns), 1fr);
Expand Down
12 changes: 12 additions & 0 deletions styles/scripts/generate-tailwind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ ${Object.entries(typography)
)
.join('\n')}
@utility desktop-only {
@media (--mobile) {
display: none;
}
}
@utility mobile-only {
@media (--desktop) {
display: none;
}
}
@utility design-grid {
display: grid;
grid-template-columns: repeat(var(--columns), 1fr);
Expand Down

1 comment on commit 170ce73

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡️ Lighthouse report for the changes in this commit:

🟠 Performance: 67
🟠 Accessibility: 85
🟢 Best practices: 96
🟠 SEO: 63

Lighthouse ran on https://satus-osj3u9c1g-darkroom-engineering.vercel.app/

Please sign in to comment.