Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client/tailwind.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* @import "tailwindcss/base"; */
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
4 changes: 4 additions & 0 deletions src/rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export async function bundleStyles({
});
let text = result.outputFiles[0].text;
if (path === getClientPath("stdlib/inputs.css")) text = rewriteInputsNamespace(text);
// dirty patch for tailwind: remove margin:0 and styles resets for headers
// etc. It should probably be a tailwind plugin instead.
if (path === getClientPath("tailwind.css"))
text = text.replaceAll(/}[^{]*h1,\n*h2,\n*h3,\n*h4,\n*h5,\n*h6[^}]+}\s*/g, "}");
Copy link
Member

Choose a reason for hiding this comment

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

You want the typography plugin and prose class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe, but there are other resets that wreck our page, and we might want to find a way to remove the resets independently of adding /prose/ (this works already, anyway). I was thinking maybe a custom plugin we'd inline.

Copy link
Member

Choose a reason for hiding this comment

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

We may need to commit to Tailwind and rewrite any of our own styles accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that's a good possibility. For now I'm merely taking stock of the things that change.

The other big change I've noticed are the grid-cols-* classes, which I have to block for now because they are quite different. Ours is responsive to width, tailwind's responsiveness is based on a breakpoint modifier (e.g. lg:grid-cols-3).

blocklist: ["grid", "grid-cols-2", "grid-cols-3", "grid-cols-4"],


return text;
}
Expand Down
Loading