DS style barrel, Storybook style entry, and consumption docs#618
DS style barrel, Storybook style entry, and consumption docs#618flacoman91 wants to merge 8 commits into
Conversation
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
|
| @@ -1,3 +1,4 @@ | |||
| import '@cfpb/cfpb-design-system/src/components/cfpb-typography/slug-header.scss'; | |||
There was a problem hiding this comment.
I noticed in other components you don't generally drill this deep into the DS scss. Does this line seem right?
There was a problem hiding this comment.
You're right. I tested this branch in a boilerplate repo here (yarn install; yarn start)
https://github.com/cfpb/dsr-test
None of the DS/DSR styles are coming through.
I just did
https://github.com/cfpb/dsr-test/blob/main/src/App.tsx#L33-L34
import { Button, Heading } from "@cfpb/design-system-react";
<Button label="Click me" />
<Heading type={"slug"}>Slug type</Heading>
I'm not sure if the expectation is you can just do a component export into a template and just call it a day, or more configuration is supposed to done regarding the included scss files?
We should update the readme with instructions on the correct way to set up DSR to get it to work in an app.
There was a problem hiding this comment.
Ok, i did some more digging and found out why the styles aren't coming through.
If the consuming app includes all of DS, it will work, but if all you need is a simple button or minimal changes we shouldn't be importing everything.
Here's a PR in that repo I made:
cfpb/dsr-test#2
This points to the current DSR without this fix. We should also note that this scss include pattern also exists in the pagination component
https://github.com/cfpb/design-system-react/blame/main/src/components/Pagination/pagination.tsx#L1

Redo of #613 to get the automatic tests and preview to run.
Thanks arpitjain099
this resolves #578
Go to slug preview link to validate:
https://cfpb.github.io/design-system-react/pr-previews/pr-618/?path=/story/components-verified-headings--slug&globals=responsivePreview:all