devnacho / mountain_view

Living styleguide for Rails
MIT License
273 stars 29 forks source link

Styleguide global assets, like js and scss outside of components? #62

Open jonathanrbowman opened 7 years ago

jonathanrbowman commented 7 years ago

First, thanks for making this! It seems like it could be really helpful if I can get if figured out.

Loading the styleguide to view a component shows the css and javascript that goes along with that component, but what about other javascript and css, not contained within the component folder?

For example, a component that relies on styles not kept within its own stylesheet. Like, a card that uses .o-heading objects. I have a css file for headings, but that doesn't belong with the card component. This means it doesn't get loaded on the styleguide page, though. It would only pull it in if I @import all my scss at the top of every component? I'm sure I'm missing something there.

Also, say the card uses another, separate js file like some custom functions to interact with an API. These functions are used elsewhere, not just with this component so they don't belong in the component folder. How do you get that included on the styleguide page, as well?

kitop commented 7 years ago

Hi @jonathanrbowman, thanks for your words!

Regarding the external CSS in the stylesheet, there's a configuration option for including that: https://github.com/devnacho/mountain_view#global-stylesheets Hope that helps, and do not hesitate to ask if any further questions.

Regarding JS, there's currently no option for that. But seems like it could be a good idea to add one. Happy to accept a PR if you wanna take on it!