patrickcate / vue-uswds

A Vue 3 implementation of the USWDS.
https://patrickcate.github.io/vue-uswds/
MIT License
9 stars 3 forks source link

Adding USWDS CSS to Existing Vue3 Project #555

Closed jlkravitz closed 1 year ago

jlkravitz commented 1 year ago

Not an issue per say, but any chance someone has an example of setting up USWDS CSS files with node on an existing Vue3 project? I'm having trouble getting it to work, and the "compiler" module that USWDS doesn't seem relevant for my use-case (though I might be wrong). Any pointers appreciated!

patrickcate commented 1 year ago

This is beyond the scope of this library since there are so many different ways to implement this depending on your build system and requirements. That said, here's some ideas that might help.

I assume since you mentioned the USWDS compile library that you want to compile from the USWDS Sass files and not just use the default compiled library CSS.

Something like:

// /src/App.vue 

<style lang="scss">
@import '../assets/styles.scss';
</style>
jlkravitz commented 1 year ago

Got it! I couldn't figure out how to get the Sass files to work but for now, the default CSS should be ok - which is working!

Relatedly, is there a way to view the code for the examples in the documentation?

On Sat, Jan 28, 2023 at 11:15 AM Patrick Cate @.***> wrote:

This is beyond the scope of this library since there are so many different ways to implement this depending on your build system and requirements. That said, here's some ideas that might help.

I assume since you mentioned the USWDS compile library https://github.com/uswds/uswds-compile that you want to compile from the USWDS Sass files and not just use the default compiled library CSS.

Something like:

// /src/App.vue <style @.*** '../assets/styles.scss';

— Reply to this email directly, view it on GitHub https://github.com/patrickcate/vue-uswds/issues/555#issuecomment-1407430947, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWWZK2EG27FDE7GKSYRIIDWUVA35ANCNFSM6AAAAAAUI56WZY . You are receiving this because you authored the thread.Message ID: @.***>

-- Sent from iPhone

patrickcate commented 1 year ago

Relatedly, is there a way to view the code for the examples in the documentation?

Yes, the documentation uses Storybook. In the repo's /src/components/ folder, each component is in its own folder. In those folders there is a *.stories.js files with the Storybook code for that component.