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

How to best distribute the CSS file? #17

Open
severo opened this issue Jan 3, 2025 · 3 comments
Open

How to best distribute the CSS file? #17

severo opened this issue Jan 3, 2025 · 3 comments

Comments

@severo
Copy link
Contributor

severo commented Jan 3, 2025

The file Hightable.css is not distributed in the npm package. Users who want to use it have to copy it from the repository.

Should we include it in the package as a CSS module (see how Vite handles them: https://vite.dev/guide/features#css-modules - rollup also has some packages to handle them)?

@platypii
Copy link
Contributor

platypii commented Jan 6, 2025

We should definitely at least be distributing it in the package. I'm not as sure what the best way is to include it.

I like CSS Modules but I'm not sure how well supported that is yet, or what would be required tooling-wise for downstream users. Also when the class names get hashed, does it make it harder for users to customize?

My instinct here is to ship the CSS file directly. We might want to add ht (hightable) or some other prefix to the classnames so that we don't have conflicts with a user's site.

General question: would it work to do in javascript import 'HighTable.css'? I feel like that never works when I try it, but maybe you understand better how to import css? (other than as a <link> tag)

@platypii
Copy link
Contributor

FYI it is actually distributed in the npm package, in the src directory. But we should still figure out the best way to distribute CSS in general.

@severo severo changed the title Distribute the CSS file? How to best distribute the CSS file? Jan 13, 2025
@severo
Copy link
Contributor Author

severo commented Jan 15, 2025

In hyparam/hyperparam-cli#141 and hyparam/space#13, I do:

import 'hightable/src/HighTable.css'

and remove the duplicate (and outdated) HighTable.css files from these repos.

Two comments:

  1. maybe change hightable/src/HighTable.css to hightable/HighTable.css or hightable/style.css?
  2. should @hyparam/components redistribute the CSS file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants