question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reorganize Scss folder structure

See original GitHub issue

Our current scss file and folder architecture is a bit unclear. We have a _variables.scss file on the same level as the components. There’s also a _mixins.scss file which includes the mixins in another folder. There might be some room for reorganisation.

We could come up with our own folder structure but it might be interesting to have a look at existing solutions. Maybe ITCSS could help us out.

ITCSS has been discussed already in https://github.com/twbs/bootstrap/issues/18233 but this was also about splitting our variables file, I wouldn’t do that for now. Just reorganising the files into folders would be a great start.

Feel free to spread your thoughts on this here

/CC @twbs/css-review

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:5
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

6reactions
MartijnCuppenscommented, Apr 3, 2019

I guess a folder structure like this would be the result in the end:

bootstrap/
└── scss/
    β”œβ”€β”€ settings/
    β”‚   └── variables.scss
    β”œβ”€β”€ tools/
    β”‚   β”œβ”€β”€ functions.scss
    β”‚   └── mixins
    β”‚       └── ... All mixin files here
    β”œβ”€β”€ generic/
    β”‚   β”œβ”€β”€ reboot.scss
    β”‚   └── root.scss
    β”œβ”€β”€ elements/
    β”‚   └── type.scss
    β”œβ”€β”€ objects/
    β”‚   β”œβ”€β”€ images.scss
    β”‚   β”œβ”€β”€ code.scss
    β”‚   β”œβ”€β”€ grid.scss
    β”‚   └── transitions.scss
    β”œβ”€β”€ components/
    β”‚   β”œβ”€β”€ tables.scss
    β”‚   β”œβ”€β”€ forms.scss
    β”‚   β”œβ”€β”€ buttons.scss
    β”‚   β”œβ”€β”€ dropdown.scss
    β”‚   β”œβ”€β”€ button-group.scss
    β”‚   β”œβ”€β”€ input-group.scss
    β”‚   β”œβ”€β”€ custom-forms.scss
    β”‚   β”œβ”€β”€ nav.scss
    β”‚   β”œβ”€β”€ navbar.scss
    β”‚   β”œβ”€β”€ card.scss
    β”‚   β”œβ”€β”€ breadcrumb.scss
    β”‚   β”œβ”€β”€ pagination.scss
    β”‚   β”œβ”€β”€ badge.scss
    β”‚   β”œβ”€β”€ alert.scss
    β”‚   β”œβ”€β”€ progress.scss
    β”‚   β”œβ”€β”€ list-group.scss
    β”‚   β”œβ”€β”€ close.scss
    β”‚   β”œβ”€β”€ toasts.scss
    β”‚   β”œβ”€β”€ modal.scss
    β”‚   β”œβ”€β”€ tooltip.scss
    β”‚   β”œβ”€β”€ popover.scss
    β”‚   β”œβ”€β”€ carousel.scss
    β”‚   └── spinners.scss
    β”œβ”€β”€ utilities/
    β”‚   └── utilities.scss
    β”œβ”€β”€ bootstrap.scss
    β”œβ”€β”€ bootstrap-grid.scss
    └── bootstrap-reboot.scss

In each folder some files could be grouped into folders if needed (like the form stuff).

5reactions
GeoSotcommented, Apr 11, 2019

@mdo @MartijnCuppens

May I propose and a split on the variables.scss?

It has being too big… Or Maybe One main File with the main variables and a second which will have all the inherited variables

Read more comments on GitHub >

github_iconTop Results From Across the Web

2 Smartest Ways to Structure Sass - Webdesigner Depot
All you need to do is organize the partials in 7 different folders, and one single file (app.sass) should sit at the root...
Read more >
How To Organize And Structure Your SASS Code - LinkedIn
Our folders would typically contain the following like abstracts contains tools, helpers, variables, mixins etc. Base contains boilerplate codeΒ ...
Read more >
Practical way to organize your Sass files | by Bruno Leite
Key takeaways. We can view the website by it's components and sections like navigation bar, footer, header… 7–1 architecture (7 folders- 1Β ...
Read more >
How I organize Sass projects - Prototypr
The first thing I do whenever I start a new project is to first create the folders where the code will live, then...
Read more >
Ask DN: How do you structure your SASS files in a large project?
I'm working with about 10000 lines of (desktop and mobile web) SCSS/CSS, which I'm aiming to minify and restructure. How do you structure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found