markdown 如何构建Sass项目

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 如何构建Sass项目相关的知识,希望对你有一定的参考价值。

# How to structure a Sass project :

  ### Basic directory structure :
  
    stylesheets/
    |
    |-- modules/              # Common modules
    |   |-- _all.scss         # Include to get all modules
    |   |-- _utility.scss     # Module name
    |   |-- _colors.scss      # Etc...
    |   ...
    |
    |-- partials/             # Partials
    |   |-- _base.sass        # imports for all mixins + global project variables
    |   |-- _buttons.scss     # buttons
    |   |-- _figures.scss     # figures
    |   |-- _grids.scss       # grids
    |   |-- _typography.scss  # typography
    |   |-- _reset.scss       # reset
    |   ...
    |
    |-- vendor/               # CSS or Sass from other projects
    |   |-- _colorpicker.scss
    |   |-- _jquery.ui.core.scss
    |   ...
    |
    `-- main.scss            # primary Sass file
    
  ### Primary stylesheet :
  
    // Modules and Variables
    @import "partials/base";

    // Partials
    @import "partials/reset";
    @import "partials/typography";
    @import "partials/buttons";
    @import "partials/figures";
    @import "partials/grids";
    // ...

    // Third-party
    @import "vendor/colorpicker";
    @import "vendor/jquery.ui.core";
     
  
   As you can see this divides my project into three basic types of files. Modules, partials, 
   
   and vendored stylesheets.
   
 ### Module : 
    
   The modules directory is reserved for Sass code that doesn't cause Sass to actually output CSS. Things like mixin 
   
   declarations, functions, and variables.
   
 ### Partials :
 
  The partials directory is where the meat of my CSS is constructed. A lot of folks like to break their stylesheets into 
  
  header, content, sidebar, and footer components (and a few others). As I'm more of a SMACSS guy myself, I like to break 
  
  things down into much finer categories (typography, buttons, textboxes, selectboxes, etc…).
  
 ### Vendors : 
 
 The vendor directory is for third-party CSS. This is handy when using prepackaged components developed by other people (or
 
 for your own components that are maintained in another project). jQuery UI and a color picker are examples of CSS that you 
 
 might want to place in the vendor directory.
 
 ### One step further :
 
     stylesheets/
    |
    |-- admin/           # Admin sub-project
    |   |-- modules/
    |   |-- partials/
    |   `-- _base.scss
    |
    |-- account/         # Account sub-project
    |   |-- modules/
    |   |-- partials/
    |   `-- _base.scss
    |
    |-- site/            # Site sub-project
    |   |-- modules/
    |   |-- partials/
    |   `-- _base.scss
    |
    |-- vendor/          # CSS or Sass from other projects
    |   |-- _colorpicker-1.1.scss
    |   |-- _jquery.ui.core-1.9.1.scss
    |   ...
    |
    |-- admin.scss       # Primary stylesheets for each project
    |-- account.scss
    `-- site.scss
 
   

以上是关于markdown 如何构建Sass项目的主要内容,如果未能解决你的问题,请参考以下文章

markdown 如何构建Sass项目

markdown 如何构建Sass项目

markdown Angular Cli新项目,包括Sass和Bootstrap + Angular Cli Snippets

markdown 如何最终使用纱线重新安装fkn'node-sass并且不破坏包结构.md

项目构建node-sass源码报错 SyntaxError:Unexpectedtoken"?"

一款基于vue.js 和node构建个人博客项目