vonko1988

CSS_sass_homework_task1.scss

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