vonko1988

CSS_less_homework_task1.less

Mar 1st, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.59 KB | None | 0 0
  1. /*The usual resets*/
  2. body, header, nav, div, h1, h2, a, section, article, footer, p, span, ul, li, img, form, button, aside {
  3. margin: 0;
  4. padding: 0;
  5. }
  6.  
  7. header, nav, section, article, footer, aside {
  8. display: block;
  9. }
  10.  
  11. /*some variables*/
  12.  
  13. @default-text-color: white;
  14. @special-a-color:#d4a3f8;
  15. @border-reg-input: #603382;
  16. @radius-reg-input: 3em;
  17. @border-standart:1px solid black;
  18. @background-color-1:#D392FD;
  19. @background-color-2:#9215F2;
  20. @background-pos-1:20%;
  21. @background-pos-2:100%;
  22.  
  23. /*some mixins*/
  24. .gradient(@from-color,@to-color,@from-pos,@to-pos) {
  25. background:@from-color;
  26. background: -moz-linear-gradient(top, @from-color 0%, @from-color 0%, @to-color @from-pos, @to-color @to-pos);
  27. background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,@from-color), color-stop(0%,@from-color), color-stop(@from-pos,@to-color), color-stop(@to-pos,@to-color));
  28. background: -webkit-linear-gradient(top, @from-color 0%,@from-color 0%,@to-color @from-pos,@to-color @to-pos);
  29. background: -o-linear-gradient(top, @from-color 0%,@from-color 0%,@to-color @from-pos,@to-color @to-pos);
  30. background: -ms-linear-gradient(top, @from-color 0%,@from-color 0%,@to-color @from-pos,@to-color @to-pos);
  31. background: linear-gradient(to bottom, @from-color 0%,@from-color 0%,@to-color @from-pos,@to-color @to-pos);
  32. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@from-color', endColorstr='@to-color',GradientType=0 );
  33. }
  34.  
  35.  
  36.  
  37. .right {
  38. float: right;
  39. }
  40.  
  41. .left {
  42. float: left;
  43. }
  44.  
  45. .clearfixAfter {
  46. zoom: 1;
  47. &:after {
  48. display: block;
  49. content: "";
  50. height: 0;
  51. clear: both;
  52. }
  53. }
  54.  
  55. .clearfixBefore {
  56. zoom:1;
  57. &:before {
  58. content:"";
  59. height:0;
  60. clear:both;
  61. display:block;
  62. }
  63. }
  64.  
  65. /*The styling of the page using selector nesting*/
  66.  
  67. body {
  68. color: @default-text-color;
  69. .gradient(@background-color-1,@background-color-2,@background-pos-1,@background-pos-2);
  70.  
  71. & > header {
  72. padding: 2em 2em 0 1em;
  73.  
  74. div#header-container {
  75. .clearfixAfter;
  76.  
  77. div#logo-container {
  78. .left;
  79. }
  80.  
  81. div#reg-form-container {
  82. .right;
  83. margin-right: 3em;
  84.  
  85. input {
  86. background:#b35ef3;
  87. border-radius: @radius-reg-input;
  88. border: 1px solid @border-reg-input;
  89. margin-left: 0.5em;
  90.  
  91. &:first-of-type {
  92. margin-bottom: 0.5em;
  93. }
  94.  
  95. &:nth-of-type(2) {
  96. margin-left: 0.6em;
  97. }
  98. }
  99.  
  100.  
  101. button {
  102. background: #c381f4;
  103. color: @default-text-color;
  104. margin-top: 0.5em;
  105. border-radius: 0.6em;
  106. padding: 0.3em 0.8em 0.3em 0.8em;
  107. border: 1px outset @border-reg-input;
  108. }
  109. }
  110. }
  111.  
  112. nav {
  113. margin-top: 1.5em;
  114.  
  115. & > ul {
  116. list-style-type: none;
  117. border: @border-standart;
  118. border-radius: 0.8em;
  119. width: 75%;
  120. margin-left:1em;
  121.  
  122. li {
  123. display: inline-block;
  124. padding: 0.6em;
  125.  
  126. &:first-of-type {
  127. padding-left: 1.5em;
  128. }
  129.  
  130. a {
  131. color: @default-text-color;
  132. text-decoration: none;
  133.  
  134. &:hover {
  135. text-decoration: underline;
  136. }
  137. }
  138.  
  139.  
  140. ul {
  141. display: none;
  142. position: absolute;
  143. }
  144.  
  145. &:hover {
  146. & > ul {
  147. padding: 0 0.2em 0 0.2em;
  148. background: @background-color-2;
  149. z-index: 3;
  150. display: block;
  151. border-radius: 0.6em;
  152. border: 1px solid @border-reg-input;
  153.  
  154.  
  155. li {
  156. display: block;
  157. border-top: 1px solid @border-reg-input;
  158.  
  159. &:first-of-type {
  160. padding-left: 0.6em;
  161. border: none;
  162. }
  163. }
  164. }
  165. }
  166. }
  167. }
  168. }
  169. }
  170.  
  171. section {
  172. .left;
  173. width: 68%;
  174. margin-left: 1em;
  175.  
  176. article {
  177. border: @border-standart;
  178. margin-bottom: 1em;
  179. border-radius: 0.8em;
  180. padding: 1.5em 1.1em 1.5em 1.2em;
  181.  
  182. &:first-of-type {
  183. margin-top: 2em;
  184. }
  185.  
  186. h1 {
  187. margin:0 0 0.4em 0.5em;
  188. }
  189.  
  190. p {
  191. }
  192.  
  193. footer {
  194. text-align: right;
  195. margin-top:0.5em;
  196.  
  197. a {
  198. text-decoration: none;
  199. color: @special-a-color;
  200.  
  201. &:hover {
  202. text-decoration: underline;
  203. }
  204. }
  205. }
  206. }
  207. }
  208.  
  209. aside {
  210. .right;
  211. width: 25%;
  212. margin: 3em 2em 0 0;
  213.  
  214. & > ul > li {
  215. list-style-type: none;
  216. border: @border-standart;
  217. border-radius: 0.2em;
  218. margin-bottom: 0.8em;
  219. padding: 1em 1.2em 1em 1em;
  220.  
  221. h2 {
  222. margin-bottom:0.5em;
  223. }
  224.  
  225. p {
  226. margin-left:0.5em;
  227. }
  228.  
  229. ul {
  230. list-style-type:none;
  231.  
  232. li {
  233. padding-left:2em;
  234. background-image:url(images/li-dot.png);
  235. background-repeat:no-repeat;
  236. background-position:8px 5px;
  237. }
  238. }
  239.  
  240. a {
  241. text-decoration: none;
  242. color: @special-a-color;
  243. }
  244. }
  245. }
  246.  
  247. & > footer {
  248. .clearfixBefore;
  249. text-align: center;
  250. padding-bottom:1em;
  251. }
  252. }
Advertisement
Add Comment
Please, Sign In to add comment