项目作者: TaylorPzreal

项目描述 :
A library for basic style write with scss
高级语言: CSS
项目地址: git://github.com/TaylorPzreal/primary-style.git
创建时间: 2017-08-15T01:51:21Z
项目社区:https://github.com/TaylorPzreal/primary-style

开源协议:MIT License

下载


primary-style

Browser basic styles and useful class.

Installation And Usage

  1. yarn add primary-style
  1. import 'primary-style';

Features

  • Page defaults

From Bootstrap

  1. The <html> and <body> elements are updated to provide better page-wide defaults. More specifically:
  2. * The box-sizing is globally set on every elementincluding *::before and *::after, to border-box. This ensures that the declared width of element is never exceeded due to padding or border.
  3. * No base font-size is declared on the <html>, but 16px is assumed (the browser default). font-size: 1rem is applied on the <body> for easy responsive type-scaling via media queries while respecting user preferences and ensuring a more accessible approach.
  4. * The <body> also sets a global font-family, line-height, and text-align. This is inherited later by some form elements to prevent font inconsistencies.
  5. * For safety, the <body> has a declared background-color, defaulting to #fff.
  1. html {
  2. box-sizing: border-box;
  3. line-height: 1.15; // Correct the line height in all browsers.
  4. height: 100%; // make full height
  5. -webkit-text-size-adjust: 100%; // 4
  6. -ms-text-size-adjust: 100%; // 4
  7. -ms-overflow-style: scrollbar; // 5
  8. -webkit-tap-highlight-color: rgba(0, 0, 0, 0); // 6
  9. }
  10. *,
  11. *::before,
  12. *::after {
  13. box-sizing: inherit;
  14. }
  15. // 1. Set an explicit initial text-align value so that we can later use the
  16. // the `inherit` value on things like `<th>` elements.
  17. body {
  18. background-color: #fff;
  19. color: #34374c;
  20. display: flex;
  21. flex-direction: column;
  22. font-family: 'Microsoft Yahei', Arial, Helvetica, sans-serif;
  23. font-size: 1rem;
  24. height: 100%;
  25. margin: 0;
  26. text-align: left; // 1
  27. }
  • Font size

Use class font-10, the font size is 10px.
The size also could be oneof [10, 12, 14, 16, 18, 20, 22, 24, 28, 30, 32, 36, 48, 64, 72];

  • Layout

${size} is oneOf

  1. [1, 2, 4, 5, 6, 8, 10, 12, 15, 16, 18, 20, 22, 24, 26, 28, 32, 48, 64, 72, 100, 120]

Support:

  1. .pl-${size} {
  2. padding-left: #{$size}px;
  3. }
  4. /* Others like this */
  5. /*
  6. pr-${size}
  7. pt-${size}
  8. pb-${size}
  9. mr-${size}
  10. ml-${size}
  11. mt-${size}
  12. mb-${size}
  13. */
  14. .no-padding {
  15. padding: 0;
  16. }
  17. .no-margin {
  18. margin: 0;
  19. }
  20. .full-width {
  21. width: 100%;
  22. }
  23. .full-height {
  24. height: 100%;
  25. }
  • Definate Scrollbar default style

Plan

  • Add colors
  • Could extention by scss variable