Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. [ Install Sass ]
  2. gem install sass
  3.  
  4. [ Watch directory for sass ]
  5. sass ---watch scss:css
  6.  
  7. [ SCSS Partials ]
  8. Partial files are scaffolded out into folders that contain bits of css or sass coupled with a index.scss file that
  9.  
  10. /components
  11. _butons.scss
  12. _icons.scss
  13. _index.scss ( always need this file and should have a import method to call in all the components into this index flie by way of )
  14. @import 'buttons';
  15.  
  16. in the main scss file you will then import all the indexs into the main file via the importa method.
  17.  
  18. [ Extending / Placeholder ]
  19. Create a extends.scss file and for example for rules that will be common in a element you can create an extender
  20. //This will align text within a given element
  21.  
  22. In the extends.scss file:
  23.  
  24. //Center
  25. %centered {
  26. text-align: centered;
  27. }
  28.  
  29. In the file you want the extend to be invoked
  30.  
  31. .main-header {
  32.  
  33. @extend %centered;
  34. font: Helvitica;
  35. background-color: fff;
  36. }
  37.  
  38. [ SCSS Nesting ]
  39. a {
  40. //Within this space replce any type of rule for the anchor tag with the ampersand followed by the rules.
  41. &:hover {
  42. color: fff;
  43. text-align: center;
  44. }
  45. &:active {
  46. color: 000;
  47. text-style: bold;
  48. }
  49. }
  50.  
  51. [ Variables in SCSS ]
  52. //Basic color variable
  53. $white: #ffffff;
  54.  
  55. //Basic color function
  56. $content-text: $white;
  57.  
  58. [ Mixins ]
  59. //In a _mixins file
  60. //Text Mixin
  61.  
  62. @mixin text($size, $l-heigh: null , $weight: null, $color:null) {
  63. //setting the values to null will leave the rules set to blank unless we set them in the mixin call
  64. font-size: $size;
  65. line-height: $l-height;
  66. font-weight: $weight;
  67. color: $color;
  68. }
  69.  
  70. /// To use/include in your SCSS file
  71. @include text (1em, 1.5, $color: $body-color) {
  72. margin: 0;
  73. font-family: $stack-helevtica;
  74. }
  75.  
  76.  
  77. ======[ Flexbox ]===========
  78.  
  79. -- In the parent container always invoke the flex display rule with the following command
  80.  
  81. //Make child elements flex compatiable
  82. display: flex;
  83.  
  84. -- Within the element set the size of how big you want the element to flex
  85. flex: [ enter numerical value ]
  86.  
  87. -- Within the container you can also set the alignment with
  88. align-items: ( center ) ;
  89. justify-content: ( center, start-end , start )
  90.  
  91. -- To set width the flex way
  92. flex-basis: ( numerical percentage ) ;
  93.  
  94. -- To make a row of items wrap
  95. flex-wrap: ( wrap or no wrap ) ;
  96.  
  97. -- Center something in a block level element when you don't know the size
  98. display:flex; //in the parent container
  99. margin: auto; // to center the item/element/content
  100.  
  101. -- Change the the direction elements flex ( horizontal or vertical )
  102. flex-direction: ( row , column ) ;
  103.  
  104. -- Good rule of thumb when dealing with inline-boxes is to set the box-sizing rule
  105. box-sizing: border-box;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement