项目作者: cyrildewit

项目描述 :
My personal CSS boilerplate/framework written in Sass
高级语言: CSS
项目地址: git://github.com/cyrildewit/perceptor.git
创建时间: 2017-08-09T15:33:38Z
项目社区:https://github.com/cyrildewit/perceptor

开源协议:

下载


Perceptor

Modern Sass starter kit that requires you to keep your CSS organized and clean.

Overview

Perceptor is my personal SCSS boilerplate. It’s the result of 4 years of finding the right structure that I can use for my personal projects.

Need an compiler? See Perceptor Studio!

Features

  • Organized component structure
  • Bootstrap 4 grid included
  • Sanitize included
  • BEM helper mixins (element & modifier)

Note: This project is currently under development. If you have any ideas or tips, please feel free to report that at the issue tracker.

Rules / Conventions

Summary of: https://css-tricks.com/abem-useful-adaptation-bem/

ABEM

  1. [a/m/o]-blockName__elementName -modifierName

camelCase

  1. /* classic + atomic prefix */
  2. .o-subscribe-form__field-item {}
  3. /* camelCase + atomic prefix */
  4. .o-subscribeForm__fieldItem {}

Seperated modifier

  1. /* classic */
  2. .block-name__element-name--green {
  3. background: green;
  4. color: white;
  5. }
  6. /* seperated modifier */
  7. .a-blockName__elementName.-green {
  8. background: green;
  9. color: white;
  10. }

Utilities

  1. u-utilityName

No Sass placeholders

Don’t use Sass placeholder! Instead use mixins.

https://www.sitepoint.com/avoid-sass-extend/

Example SCSS structure

  1. .
  2. ├── 00_abstracts
  3. | ├── mixins
  4. | ├── _bem.scss
  5. | ├── _clearfix.scss
  6. | ├── _hover.scss
  7. | ├── _functions.scss
  8. | ├── _variables.scss
  9. ├── 01_base
  10. | ├── _fonts.scss
  11. | ├── _generic.scss
  12. | ├── _sanitize.scss
  13. ├── 02_atoms
  14. | ├── _button.scss
  15. | ├── _card.scss
  16. | ├── _panel.scss
  17. ├── 03_molecules
  18. | ├── _typography.scss
  19. | ├── _lists.scss
  20. | ├── _image.scss
  21. ├── 04_organisms
  22. | ├── _bootstrap-grid.scss
  23. | ├── _site-header.scss
  24. | ├── _section.scss
  25. | ├── _site-footer.scss
  26. ├── 05_templates
  27. | ├── _home.scss
  28. | ├── _week-action.scss
  29. ├── 06_pages
  30. | ├── _home.scss
  31. | ├── _week-action.scss
  32. ├── 07_utilities
  33. | ├── _clearfix.scss
  34. ├── 08_vendor
  35. | ├── _clearfix.scss

Organizing

  • 00_abstracts
    • Sass tools, helpers, global variables, functions, mixins.
  • 01_base
    • Boilerplate code; reset, global typographic rules, generic standard styles.
  • 02_atoms
  • 03_molecules
  • 04_organisms
  • 05_templates
  • 06_pages
  • 07_utilities
  • 08_vendor

To do

Read:

Credits

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.