Time-boxed exploration of trying to upgrade to the latest USWDS. Currently we use an outdated USWDS gem that hasn't been updated in 2 years. We should see if we can import the NPM package directly, instead of through the gem so that we can receive regular updates. Let's keep this exploration to two days and see what happens. After that time, when we understand the difficulties of migrating, we can make a decision on which way to go.
Broken the level of effort needed to upgrade USWDS into four parts. (Difficulty 1-5)
Attempted to import and run the package in the client side using webpack and add styles to load on all pages. Breaks UI in some pages, and some style guide components like table, accordion, and navigation header.
We will also need to explore adding some kind of style linter.
There was two issues here I found.
_caseflow-commons gem can not be used with out also importing USWDS gem_
There are style mixing and variables that caseflow common needs to work independently, this would essentially mean removing imported USWD style overrides.
_Consider deprecating Casflow-commons_
Most of styles can just be imported directly in the sass file or just adding it local to our project and eventually removing most of these styles because we are moving in the direction of inline javascript styles.
All of styleguide does not render at all without USWDS. We should consider react based library like Storybook or pattern lab - easy to manage as we move to inline Javascript styled component.
Although every step will require some kind of visual regression test for UI in steps 3-4, this can be done. (LOE 4 = full sprint)
Some questions:
and it needs the USWDS gem also installed for it to run in caseflow. I didn鈥檛 explore this much.
When you say it needs the USWDS gem installed, what does that mean. Aren't we just using this as a conduit for including USWDS? If we install it via NPM don't we get the same thing?
There are non style issues in some global components. Javascript errors rendering some components, including ones imported from caseflow-frontend toolkit
What do non-style issues look like? Do you have some examples?
this would essentially mean removing imported USWD style overrides.
You may not know this, but why did we decide to override so many USWDS?
All of styleguide does not render at all without USWDS
If we pull in USWDS from NPM, doesn't it still have access to those styles?
caseflow-commons gem can not be used with out also importing USWDS gem, Its not just a not a conduit for USWDS. Essentially we are importing USWDS gem twice, one as a dependency of caseflow commons with some overrides and global caseflow styles. I didn't explore installing commons via NPM. I am hoping we do not have a need for caseflow-commons.
Non style issues include a lot of javascript console errors. But mostly its that click interactions like accordion, dropdown does not work, having to do with updated behaviors
compared to old
In regards USWDS style overrides, from what it looks like we built our own grid styles as opposed to relying what USWDS has. This may or may not have been there 2 years ago.
If we pull in USWDS from NPM styleguide also has access to new styles but styleguide container UI is broken. Display issues, nothing is floating correctly mostly having to do with container styles
I was just talking with Sunil and he had an interesting suggestion. What if we try to bring in the same version of USWDS that we are currently using in gem form? Then we can upgrade at a later point. We still get the advantage of cleaning up how we include css, and make upgrading later easier.
Hi team (+ @department-of-veterans-affairs/caseflow-designers)
What will this USWDS upgrade impact?
Will it update our UI styles, and how can we get prepared for the changes?
Can someone speak to the background context/rationale for overriding things like USWDS grids? Where else do we have overrides?
1) Not sure yet all the things that updating USWDS will impact. Nolawi outlined some things, but there are likely many more that will be affected.
2) It will update our styles, we haven't explored yet how to prepare for it.
3) I'm not sure why we had overrides for a lot of these styles. @shanear might have a better sense.
@mdbenjam @mkhandekar Not a lot of override styles but some.. the deviation from the styleguide is not significant. Although it exist
Once all four done, will merge with master together. @mdbenjam
Now that we have cleaned up some of styles issues; went ahead and attempted to use the latest version of USWDS styles, and it still seems to be backward compatible enough that we should consider jumping into the latest release v1.6.3. We were on v0.10, which is over 2 years old.
I am still auditing, there are a few components that look somewhat different: You can walk through the latest updates here




Fonts appear to be slightly bigger, will be noticeable but not significant enough to worry about.
Almost everything in focus will have dotted line

@nolawi Overall, awesome! Couple small comments, as I compare these changes to the current USWDS components:
I don't see any horizontal tabs in USWDS -- am I just not seeing them?
Also, doesn't the USWDS use Source Sans Pro (almost) everywhere? The screenshots above have what looks like Helvetica or another sans serif font. Not saying this need to change - just checking.
It would be nice to get a full walkthrough (in person / video chat with the team) to see what's been changed and where!
@mkhandekar
1, Some components are created _by us for us_. Global styles will overwrite some features of the tabs.
2, True, but still exists. See some of the changes here Essentially they make use of Source sans less.
3, Absolutely I can do a full demo for those that are interested, at somepoint.
My attempt to import node modules directly into the asset-pipeline hit a bit of a snag. The USWDS package has to be built and served by webpack this way all the dependencies attached.
Attempting that approach now.
Resolving path. https://github.com/uswds/uswds#set-the-base-asset-path-fonts-and-images
Related to the issue we are having
Essentially there is an updated https://github.com/jgarber623/uswds-rails rails gem we can use instead. If we can't resolve the issues via npm package.
Most helpful comment
@mkhandekar
1, Some components are created _by us for us_. Global styles will overwrite some features of the tabs.
2, True, but still exists. See some of the changes here Essentially they make use of Source sans less.
3, Absolutely I can do a full demo for those that are interested, at somepoint.