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
Make USWDS v3 version the default for all web components except va-file-input #1082
Conversation
@@ -87,6 +90,14 @@ export class VaButton { | |||
}) | |||
componentLibraryAnalytics: EventEmitter; | |||
|
|||
componentDidLoad() { | |||
// check if the element has a class named uswds-false added from parent | |||
if (this.el.classList.contains('uswds-false')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@it-harrison Do you mind adding some details here as a PR comment about why you're needing to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jamigibbs sure - there is a bug with Stencil in which an attribute set on a child component inside a parent does not get added to the rendered HTML. For instance, if we want the v1 version of va-button-pair
and we set uswds="false"
on VaButtonPair
then, although the uswds
prop is added to the child va-button
components inside va-button-pair
, when rendered the va-button
elements will not have uswds="false"
. So it is necessary to add this attribute manually. When all v1 components have been decommissioned we can remove this code where it occurs.
@jamigibbs there was a v1 version of statement-of-truth that should not be included - I removed it and tweaked the v3 story so it should be ok now |
Chromatic
https://2405-iii--65a6e2ed2314f7b8f98609d8.chromatic.com
Description
This PR sets the default value for the
uswds
prop to true for all components with a v3 variant. It also makes adjustments to components that used composition with other components so that the correct version is used. Finally, it updates stories and moves up v3 stories to the top of the sidebar in Storybook.Closes 2405
QA Checklist
Screenshots
Acceptance criteria
Definition of done