docs: update css import lists #1385
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
I had broken styles after updating from an old version.
Cause
Because I'm using next.js, I have to manually import the stylesheets listed in the documentation. These are outdated.
Solution
I went through all rmwc packages by hand and assured that all files imported by
packages/<package>/src/styles.ts
are mentioned in the documentation.I was a little unsure what to do with
list-collapsible
. The component itself is located within thelist
directory. There existscollapsible-list.ts
andstyles.ts
containing style imports. However,collapsible-list.ts
is a subset ofstyles.ts
,styles.ts
importscollapsible-list.ts
,collapsible-list.ts
.I decided to reflect
styles.ts
as in the other list pages, but you should take a look at this one.In a personal project I wasn't able to import '@rmwc/list/list-item.css from the list component, so this probably needs correction. (After further investigation it seems these styles end up in
styles.css
, I just don't know why).In the snackbar component it reads:
while in all other components the following is used:
I decided to leave this change up to you. But if adapted, the docs need to be updated accordingly.
There is a docs page
touch-target.tsx
that I was unable to find in the web interface. I still adapted it to reflect the componentsstyles.ts
.Further discussion
Doing this manually took quite some time. Ideally, it would be possible to express the dependencies in a way that docs and code would be generated from it. This would prevent them becoming out of sync, although I don't know if/how this is possible.
Even if it can't be autogenerated, a notice in
CONTRIBUTING.md
might be added to draw the attention to the fact the docs must be updated when css imports are changed. I would even consider this type of change breaking(!) and mark it as such, since it requires code changes by the user.