toddmotto / angularjs-styleguide

AngularJS styleguide for teams
https://ultimateangular.com
5.96k stars 700 forks source link

SCSS / CSS and Images: Best place to store them ? #92

Closed iangregsondev closed 8 years ago

iangregsondev commented 8 years ago

Hi,

I was wondering what everyone is doing with regards to storing scss / css and images within the components?

Has anyone added a directory structure ?

I am using webpack so I am importing styles sheets using the es 2015 import command.

The other question I had was in regards to images, if images are to be re-used then these can be stored at a global level under assets/images for example. What is anybodies take on if the image is specific to the component, store under the component ?

Again, i am using webpack so I am using Import ES 2015 and importing the image.

I was thinking of creating a styles directory before the specific component directory but maybe as I am planning to have one scss file per component then a subdirectory isn't necessary.

Would love to hear anybody else's ideas around this.

Thanks!

stepquick commented 8 years ago

What I've been doing is creating folders for images and css directly within each component folder. The folder organization is a little messy when those components have component dependencies, but it seems to work fine. Global images/scss are in a base folder. Webpack does a good job of importing them appropriately.

The only downside I can see this having with scss is if you have to import a global scss for reusable stuff. Depending on how deep your folder hierarchy is it can get messy.

toddmotto commented 8 years ago

Will add assets/ into the next update :) thanks for the input.

ViieeS commented 6 years ago

@toddmotto any progress with this? :)