Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.25 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Mājasdarbs</title>
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
  8. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
  9. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  10. </head>
  11. <body>
  12. <div class="container-fluid">
  13. <div class="row">
  14. <div class="col-sm-1"></div>
  15. <div class="col-sm-2">
  16. <h2>Contents</h2>
  17. <p><a href="#mi">Major implementations</a></p>
  18. <p><a href="#feat">Features</a></p>
  19. <p><a href="#var">Variables</a></p>
  20. <p><a href="#nes">Nesting</a></p>
  21. <p><a href="#si">Selector inheritance</a></p>
  22. <p><a href="#ide">IDE intergation</a></p>
  23. <p><a href="#vid">Video</a></p>
  24. </div>
  25. <div class="col-sm-7 text-justify">
  26. <h1>Sass</h1>
  27. <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/9/96/Sass_Logo_Color.svg/220px-Sass_Logo_Color.svg.png" class="rounded float-right" alt="Sass logo">
  28. <h5 class="font-weight-light"><i>Sass</i> (short for <i>syntactically awesome style sheets</i>) is a style sheet language initially designed by Hampton Catlin and developed by Natalie Weizenbaum. After its initial versions, Weizenbaum and Chris Eppstein have continued to extend Sass with SassScript, a simple scripting language used in Sass files.</h5>
  29. <p>Sass is a preprocessor scripting language that is interpreted or compiled into Cascading Style Sheets (CSS). SassScript is the scripting language itself. Sass consists of two syntaxes. The original syntax, called "the indented syntax," uses a syntax similar to Haml. It uses indentation to separate code blocks and newline characters to separate rules. The newer syntax, "SCSS" (Sassy CSS), uses block formatting like that of CSS. It uses braces to denote code blocks and semicolons to separate lines within a block. The indented syntax and SCSS files are traditionally given the extensions .sass and .scss, respectively.</p>
  30. <p>CSS3 consists of a series of selectors and pseudo-selectors that group rules that apply to them. Sass (in the larger context of both syntaxes) extends CSS by providing several mechanisms available in more traditional programming languages, particularly object-oriented languages, but that are not available to CSS3 itself. When SassScript is interpreted, it creates blocks of CSS rules for various selectors as defined by the Sass file. The Sass interpreter translates SassScript into CSS. Alternatively, Sass can monitor the .sass or .scss file and translate it to an output .css file whenever the .sass or .scss file is saved.</p>
  31. <p>CSS3 supports external style sheets. This technique allows you to define a style sheet as a separate document and import it into your web pages using a <link> tag.</p>
  32. <h2 id="mi">Major implementations</h2>
  33. SassScript was implemented in multiple languages, the noteworthy implementations are:
  34.  
  35. The original open-source Ruby implementation created in 2006, since deprecated due to the lack of maintainers and reached End-of-Life in March 2019.
  36. The official open-source Dart implementation.
  37. libSass, the official open-source C++ implementation.
  38. the official JavaScript implementation, published as "sass" module on npm.
  39. JSass, an unofficial Java implementation.
  40. phamlp, an unofficial SASS/SCSS implementation in PHP.
  41. Vaadin has a Java implementation of Sass.
  42. Firebug, a Firefox XUL ("legacy") extension for web development. It has been since deprecated in favor of developer tools integrated into Firefox itself. It stopped working since Firefox 57 dropped support for XUL extensions.
  43. <h2 id="feat">Features</h2>
  44. <h2 id="var">Variables</h2>
  45. Sass allows variables to be defined. Variables begin with a dollar sign ($). Variable assignment is done with a colon (:).
  46.  
  47. SassScript supports four data types:
  48.  
  49. Numbers (including units)
  50. Strings (with quotes or without)
  51. Colors (name, or names)
  52. Booleans
  53. Variables can be arguments to or results from one of several available functions. During translation, the values of the variables are inserted into the output CSS document.
  54.  
  55. In SCSS style
  56.  
  57. $primary-color: #3bbfce;
  58. $margin: 16px;
  59.  
  60. .content-navigation {
  61. border-color: $primary-color;
  62. color: darken($primary-color, 10%);
  63. }
  64.  
  65. .border {
  66. padding: $margin / 2;
  67. margin: $margin / 2;
  68. border-color: $primary-color;
  69. }
  70. Would compile to:
  71.  
  72. .content-navigation {
  73. border-color: #3bbfce;
  74. color: #2b9eab;
  75. }
  76.  
  77. .border {
  78. padding: 8px;
  79. margin: 8px;
  80. border-color: #3bbfce;
  81. }
  82. <h2 id="nes">Nesting</h2>
  83. CSS does support logical nesting, but the code blocks themselves are not nested. Sass allows the nested code to be inserted within each other.
  84.  
  85. In SCSS style
  86.  
  87. table.hl {
  88. margin: 2em 0;
  89. td.ln {
  90. text-align: right;
  91. }
  92. }
  93.  
  94. li {
  95. font: {
  96. family: serif;
  97. weight: bold;
  98. size: 1.3em;
  99. }
  100. }
  101. Would compile to:
  102.  
  103. table.hl {
  104. margin: 2em 0;
  105. }
  106. table.hl td.ln {
  107. text-align: right;
  108. }
  109.  
  110. li {
  111. font-family: serif;
  112. font-weight: bold;
  113. font-size: 1.3em;
  114. }
  115. Loops
  116. Sass allows for iterating over variables using @for, @each and @while, which can be used to apply different styles to elements with similar classes or ids.
  117.  
  118. $squareCount: 4
  119. @for $i from 1 through $squareCount
  120. #square-#{$i}
  121. background-color: red
  122. width: 50px * $i
  123. height: 120px / $i
  124. The above example would compile to:
  125.  
  126. #square-1 {
  127. background-color: red;
  128. width: 50px;
  129. height: 120px;
  130. }
  131.  
  132. #square-2 {
  133. background-color: red;
  134. width: 100px;
  135. height: 60px;
  136. }
  137.  
  138. #square-3 {
  139. background-color: red;
  140. width: 150px;
  141. height: 40px;
  142. }
  143. <h2 id="si">Selector inheritance</h2>
  144. While CSS3 supports the Document Object Model (DOM) hierarchy, it does not allow selector inheritance. In Sass, inheritance is achieved by inserting a line inside of a code block that uses the @extend keyword and references another selector. The extended selector's attributes are applied to the calling selector.
  145.  
  146. .error
  147. border: 1px #f00
  148. background: #fdd
  149.  
  150. .error.intrusion
  151. font-size: 1.3em
  152. font-weight: bold
  153.  
  154. .badError
  155. @extend .error
  156. border-width: 3px
  157. Would compile to:
  158.  
  159. .error, .badError {
  160. border: 1px #f00;
  161. background: #fdd;
  162. }
  163.  
  164. .error.intrusion,
  165. .badError.intrusion {
  166. font-size: 1.3em;
  167. font-weight: bold;
  168. }
  169.  
  170. .badError {
  171. border-width: 3px;
  172. }
  173. <h2 id="ide">IDE integration</h2>
  174. IDE Software website
  175. Adobe Dreamweaver CC 2017 https://blogs.adobe.com/creativecloud/getting-started-with-css-preprocessors-less-and-sass/
  176. Eclipse
  177. Emacs SCSS Mode https://github.com/antonj/scss-mode/
  178. JetBrains IntelliJ IDEA (Ultimate Edition) https://www.jetbrains.com/idea/
  179. JetBrains PhpStorm http://www.jetbrains.com/phpstorm/
  180. Microsoft Visual Studio Mindscape http://www.mindscapehq.com/products/web-workbench
  181. Vim haml.zip http://www.vim.org/scripts/script.php?script_id=1433
  182. <h2 id="vid">Video</h2>
  183. Before you start working with Sass, it's worth watching an online tutorial about it. The tutorial was published on Youtube.
  184.  
  185.  
  186. Credits
  187. This homework was created by [put your name here] on [put current date and time here].
  188. </div>
  189. <div class="col-sm-2"></div>
  190. </div>
  191. </div>
  192.  
  193.  
  194.  
  195. </body>
  196. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement