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

Load tailwind CSS classes when they are used within directives and page content #1617

Open
choldgraf opened this issue Nov 1, 2024 · 0 comments
Labels
enhancement New feature or request User Interface Enhancements or bugs with the default theme user-interface.

Comments

@choldgraf
Copy link
Collaborator

There are some directives that can have CSS classes attached directly to them. For example:

:::{div}
:class: someclass
:::

We build the default MyST themes with TailwindCSS which means that we should be able to use the Tailwind CSS classes by attaching them to directives and page content like the above.

However, the relevant CSS classes are only loaded based on the HTML theme / config, and this means that classes defined purely in page content won't be detected and loaded.

Suggested enhancement

When building HTML assets, take a pass through the page content and see if any HTML classes have been added there. If they are, load the relevant classes from Tailwind at build time so that they work.

@choldgraf choldgraf added enhancement New feature or request User Interface Enhancements or bugs with the default theme user-interface. labels Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request User Interface Enhancements or bugs with the default theme user-interface.
Projects
None yet
Development

No branches or pull requests

1 participant