KittyGiraudel / ama

Ask me anything!
43 stars 4 forks source link

Sass 7-1 architecture #110

Closed onosendi closed 4 years ago

onosendi commented 4 years ago

Where would one put .content p .content ul, etc.?

See https://stackoverflow.com/questions/59595687/styling-classless-content-elements-using-sass-7-1-architecture

KittyGiraudel commented 4 years ago

Hello!

That is a good question. I would say you could have a _content.scss file in the components directory maybe? It’s not quite defined, so I would recommend you pick what feels more natural without stressing it too much. :)

onosendi commented 4 years ago

Hugo,

Thanks for your reply. I ended up omitting the parent .content class, and made each <p> and <ul> tag its own component. Honestly, I'm not a fan of this approach either. It would be okay if it was just <ul>, <ol>, <dl> etc., but the <p> tags is what really bothers me, since there's so many of them. It becomes a little tedious styling each one, and it just doesn't feel correct.

Your thoughts on this are greatly appreciated, and maybe even some alternate suggestions?

KittyGiraudel commented 4 years ago

Hello!

If you can in fact make them individual components, that is a good idea as this preserves encapsulation. However I agree it can become cumbersome, depending on how the frontend is built.

Another approach would be to consider them generic styles and to put them in the base folder maybe? I’m not too sure either to be honest.