Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailwind integration #595

Open
mbostock opened this issue Jan 23, 2024 · 4 comments
Open

Tailwind integration #595

mbostock opened this issue Jan 23, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@mbostock
Copy link
Member

What if we included Tailwind CSS by default, and generated an optimized bundle during build? That seems useful.

@mbostock mbostock added the enhancement New feature or request label Jan 23, 2024
@mbostock mbostock mentioned this issue Jan 23, 2024
@mbostock
Copy link
Member Author

Bumping this. Would be really handy.

@plasmak11
Copy link

Would love this. At the minimum, even getting the grid / flexbox system. (like bootstrap grid)

The current grid system works well for desktops, but for mobile, hard to get more than linear layout.

@tgy
Copy link

tgy commented Jun 4, 2024

This is really missing. Tailwind is so handy. It would be great to be able to completely change the layout, and integrate Observable Framework as a first-class citizen within a tailwind-based application.

One issue I'm seeing is that tailwind needs to parse HTML and CSS assets in order to generate its minimal CSS file, based on the classes actually used by the project. So, maybe the tailwind command should be ran after the HTML generation in ./dist? Also tailwind is able to watch for changes, but does that mean that we need to both run npm run dev and another tailwind command to watch for changes? Or can tailwind be ran directly as part of the Observable Framework build process?

P.S. tailwind distributes a binary, which is pretty handy

@mbostock
Copy link
Member Author

mbostock commented Jun 9, 2024

You can paste this into your Markdown and use Tailwind’s “Play CDN” approach:

<script src="https://cdn.tailwindcss.com"></script>

But, agreed, a proper implementation requires Tailwind running at preview/build time to generate the appropriate stylesheet on the fly. And also we have to deal with Tailwind breaking all of Framework’s default styles as described in #596.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
3 participants