Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
H
Hello Gargan
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • arturo
  • Hello Gargan
  • Wiki
    • 3—sass usage
  • 3.1—SASS files

3.1—SASS files

Last edited by arturo Jun 14, 2021
Page history

Compiling SASS assets

  • as writing CSS for an application can quickly become a tedious task, this project follows some opinionated guidelines (see next chapter)
  • overall, structuring the main CSS file will follow this pattern:
  ├─┬─ assets/sass
  │ ├──┬─ main
  │ │  ├──── abstract: containing members (ie. functions, mixins, variables) and variables, so SASS logic
  │ │  ├──── base    : all the cascading styles building the main files, accessed globally and purely CSS logic
  │ │  └──── modules : other isolated SASS logics, have to be imported (`@use`) when needed
  │ │
  │ └──── ~

  • Bootstrap customisation clean up
  • distinguish old and new SASS API (ie. SASS modules and lack of Bootstrap compliancy)
  • add CSS sourcemaps
  • provide directory shortcut: "~" (relative to the /src/...) ; "@" (relative to the root project /, eg. for accessing node modules)

Automations

  • in the same manner as NuxtJS does with its files, every components/pages/layouts of the project can have a dedicated style (just name a .sass or .scss with the same name, within the same folder)
  • each style will be automatically imported to generate the main CSS file
  • each style will be automatically re-writed with an import of all the main variables (ie. if we set a $green-color in the main variables, it will be accessible within the file ; other custom SASS logic, eg. in the modules folder needs to be manually added)

Scoped feature

  • provide a native solution for style scope feature, such as NuxtJS or Svelte
  • scope feature works extremely great with SASS + BEM

  • POC opened in milestones for this scoped feature

« 2.3 — Store structure             3.2 — CSS integration model »
Clone repository
  • 1—Application structure
  • 2—Components
    • 2.1—Component structure
    • 2.2—Page and Layout structure
    • 2.3—Store structure
  • 3—SASS-usage
    • 3.1—SASS files
    • 3.2—CSS integration model
  • 4—UI library
  • 5—Form validation
  • 6—Component Cookbook
  • 7—Miscellaneous
  • 8—Milestones
  • Home
More Pages

New Wiki Page

Tip: You can specify the full path for the new file. We will automatically create any missing directories.