Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !29451

v5: Sass file structure idea

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Mark Otto requested to merge scss-structure-idea into main Sep 27, 2019
  • Overview 0
  • Commits 2
  • Pipelines 0
  • Changes 3

Spiking out an idea to bring some clarity to our Sass files, specifically around the growing number of variables, functions, and settings. This is meant to invite further conversation, and shouldn't be reviewed yet.

Context

My idea here is that there can be greater clarity around the layers of Sass code. We have a few features to how we build this project, including:

  • Several global settings (via $enable- variables)
  • An entire color system (soon to be expanding with #)
  • Layout and component settings (via our breakpoints, grid configuration, spacer ranges, etc)
  • And lastly, more typical variables for nearly every property: value pairing we want to support customization for

Putting all that in _variables.scss makes for a conflated and potentially confusing file.

Changes

This PR stubs out at least two changes:

  • Adds a new _colors.scss file for our growing list of color variables
  • Adds a new _settings.scss file for our $enable- variables for global configuration

I'm thinking our other configuration variables can go in _settings.scss) as well (e.g., breakpoints, grids, containers, spacers, escaped characters). The rest of our variables, including the additional Sass map here and there, can remain in the original file as they support our components.

Minimizing requirements for other builds

Our grid dist files currently bring in the entire Sass file, as mentioned in #29428 (closed). This fix would only require _settings.scss, _functions.scss, and _mixins.scss. This is a considerable reduction and more specific, while not overly complicated.

Split it all?

I've thought about this for a bit and believe we shouldn't split the variables files by every component. This makes our lives more difficult (looking across more files if variables are reusing other variables), and takes away the option of generating or reading from a single file (a la several customizers out there).


Thoughts? Alternate ideas? Additional concerns?

TODOs

  • Fix imports
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: scss-structure-idea