Created
March 23, 2012 06:49
-
-
Save Termina1/2167808 to your computer and use it in GitHub Desktop.
The worst SCSS code, I've ever seen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "compass"; | |
@mixin pagefont($size, $color, $fontweight){ | |
font: $size Helvetica, Arial, sans-serif; | |
color: $color; | |
font-weight: $fontweight; | |
} | |
@mixin button($selector, $sprite, $color){ | |
#{$selector}{ | |
display: block; | |
overflow: hidden; | |
padding: 0; | |
background: $color sprite($sprite, normal) no-repeat; | |
cursor:pointer; | |
} | |
#{$selector}:hover{ | |
background-position: sprite-position($sprite, hover); | |
background-color: darken( $color, 20% ); | |
} | |
} | |
@mixin inputfield($selector, $width, $type, $float){ | |
#{$selector}{ | |
height: 27px; | |
margin-bottom: 5px; | |
width: $width + 10px; | |
position: relative; | |
@if $float == 1 { | |
float:left; | |
margin-right: 5px; | |
} | |
#{$selector}left{ | |
width: 5px; | |
height: 27px; | |
background: sprite($inputfield,left); | |
position: absolute; | |
} | |
#{$selector}right{ | |
width: 5px; | |
height: 27px; | |
background: sprite($inputfield,right); | |
position: absolute; | |
left: $width + 5px; | |
} | |
#{$selector}center{ | |
height: 17px; | |
width: $width; | |
padding: 5px 0px 5px 0px; | |
margin: 0px; | |
position: absolute; | |
left: 5px; | |
background: sprite($inputfield,center); | |
input{ | |
margin: 0px; | |
position: absolute; | |
height: 17px; | |
padding: 0px 5px 0px 5px; | |
@if $type == 1 { | |
width: $width - 64px; | |
} | |
@else if $type == 2 { | |
width: $width - 26px; | |
} | |
@else { | |
width: $width - 10px; | |
} | |
line-height: 17px; | |
@include pagefont(9px, #5f6a71, 400); | |
float:left; | |
border: 0px; | |
background: White; | |
} | |
@if $type == 1 { | |
@include button('.browsebutton', $browsebutton, #262626); | |
.browse{ | |
@extend .browsebutton; | |
width: 48px; | |
height: 15px; | |
position: absolute; | |
text-align: center; | |
top: 6px; | |
left: $width - 49px; | |
@include pagefont(8px, White, 400); | |
@include text-shadow(rgba(Black, 0.8) -0.5px -0.5px 0px); | |
line-height: 15px; | |
} | |
} | |
@else if $type == 2 { | |
.arrow{ | |
width: 16px; | |
height: 15px; | |
padding-top: 2px; | |
position: absolute; | |
text-align: center; | |
left: $width - 16px; | |
@include pagefont(8px, #5f6a71, 400); | |
line-height: 15px; | |
background: White; | |
cursor: pointer; | |
} | |
} | |
} | |
} | |
} | |
@mixin dropdown( $selector , $width, $height, $top, $left ){ | |
#{$selector}{ | |
display: none; | |
position:absolute; | |
top: $top; | |
left: $left; | |
bottom:0; | |
padding-top: 4px; | |
padding-left: 4px; | |
width: $width+6px; | |
height: $height; | |
background: White; | |
@include border-radius(2px); | |
@include box-shadow(black 1px 1px 2px); | |
.customScrollBox{ | |
position:relative; | |
height:100%; | |
overflow:hidden; | |
.uparrow{ | |
position: absolute; | |
text-align:center; | |
height: 17px; | |
width: 18px; | |
left: $width - 16px; | |
top: 0px; | |
@include pagefont(9px, #5f6a71, 600); | |
line-height: 17px; | |
cursor: pointer; | |
} | |
.container{ | |
position:relative; | |
width: $width - 22px; | |
padding-right: 10px; | |
top:0; | |
float:left; | |
.line{ | |
width: $width - 28px; | |
padding-left: 6px; | |
height:19px; | |
background: White; | |
@include pagefont(8px, #5f6a71, 400); | |
line-height: 19px; | |
cursor: pointer; | |
} | |
.line:hover{ | |
background: #d7f0f5; | |
} | |
} | |
} | |
.dragger_container{ | |
position: relative; | |
width:8px; | |
height: $height - 35px; | |
float: left; | |
margin-top: 30px; | |
margin-bottom: 5px; | |
} | |
.dragger{ | |
position:absolute; | |
width:8px; | |
@if $height > 155px { | |
height:60px; | |
} | |
@else { | |
height: ($height - 35px)/2; | |
} | |
background:#acadaf; | |
overflow:hidden; | |
cursor:pointer; | |
@include border-radius(4px); | |
} | |
.dragger_pressed{ | |
position:absolute; | |
width:8px; | |
@if $height > 155px { | |
height:60px; | |
} | |
@else { | |
height: ($height - 35px)/2; | |
} | |
background:#7e7f81; | |
overflow:hidden; | |
@include border-radius(4px); | |
cursor:pointer; | |
} | |
} | |
} | |
$graybutton: sprite-map("graybutton/*.png"); | |
$blackbutton: sprite-map("blackbutton/*.png"); | |
$inputfield: sprite-map("inputfield/*.png"); | |
$browsebutton: sprite-map("browsebutton/*.png"); | |
$checkbox: sprite-map("checkbox/*.png"); | |
body{ | |
margin: 0; | |
background-color: #e9eef0; | |
#main{ | |
width: 1024px; | |
height: 768px; | |
margin: auto; | |
.topic{ | |
width: 1024px; | |
height: 90px; | |
position: relative; | |
.header{ | |
@include pagefont(15px, Black, 600); | |
position: absolute; | |
top: 43px; | |
left: 19px; | |
} | |
@include button('.graybutton', $graybutton, #d1d7d9); | |
.importbutton{ | |
@extend .graybutton; | |
position: absolute; | |
width: 129px; | |
height: 26px; | |
text-align: center; | |
font{ | |
@include pagefont(9px, Black, 600); | |
@include text-shadow(rgba(White, 0.8) 0.5px 0.5px 0px); | |
line-height: 26px; | |
} | |
img{ | |
display: inline-block; | |
margin-bottom: -4px; | |
margin-left: 6px; | |
} | |
} | |
.importfbutton{ | |
@extend .importbutton; | |
left: 310px; | |
top: 38px; | |
} | |
.importinbutton{ | |
@extend .importbutton; | |
left: 446px; | |
top: 38px; | |
} | |
.savebuttonbg { | |
position: absolute; | |
left: 839px; | |
top: 33px; | |
width: 165px; | |
height: 38px; | |
background: #d5dfe3; | |
@include border-radius(3px); | |
@include button('.blackbutton', $blackbutton, #4a4c4d); | |
.savebutton{ | |
@extend .blackbutton; | |
width: 153px; | |
height: 26px; | |
margin: 6px 6px 6px 6px; | |
text-align: center; | |
@include pagefont(9px, White, 600); | |
@include text-shadow(rgba(Black, 0.8) -0.5px -0.5px 0px); | |
line-height: 26px; | |
} | |
} | |
} | |
.separator{ | |
width: 988px; | |
margin: 0px 28px 0px 18px; | |
height: 1px; | |
border-top: 1px solid #d3d6dd; | |
} | |
.body{ | |
width: 1024px; | |
height: 255px; | |
padding-top: 24px; | |
position: relative; | |
.spacer{ | |
width: 10px; | |
height: 10px; | |
} | |
.text{ | |
height: 232px; | |
width: 116px; | |
float: left; | |
.textfield{ | |
height: 27px; | |
width: 101px; | |
padding-right: 15px; | |
margin-bottom: 5px; | |
text-align: right; | |
@include pagefont(9px, #5f6a71, 600); | |
@include text-shadow(rgba(White, 0.8) 0.5px 0.5px 0px); | |
line-height: 27px; | |
} | |
} | |
.inputfields{ | |
width: 439px; | |
height: 232px; | |
position: relative; | |
margin-left: 116px; | |
@include dropdown('#sex_drop', 143px, 42px, 138px, 0px); | |
@include dropdown('#day_drop', 42px, 98px, 170px, 0px); | |
@include dropdown('#mounth_drop', 85px, 98px, 170px, 57px); | |
@include dropdown('#year_drop', 55px, 98px, 170px, 157px); | |
@include inputfield('.inputpicture', 212px, 1, 0); | |
@include inputfield('.inputname', 212px, 0, 0); | |
@include inputfield('.inputsex', 143px, 2, 0); | |
.inputfieldsbox{ | |
height: 32px; | |
width: 439px; | |
@include inputfield('.inputday', 42px, 2, 1); | |
@include inputfield('.inputmounth', 85px, 2, 1); | |
@include inputfield('.inputyear', 55px, 2, 1); | |
.checkbox{ | |
width: 16px; | |
height: 16px; | |
cursor: pointer; | |
@include pagefont(12px, Black, 600); | |
line-height: 16px; | |
text-align: center; | |
position:relative; | |
float:left; | |
margin-top: 5px; | |
margin-left: 22px; | |
background: White; | |
.yes{ | |
position: absolute; | |
top: 0px; | |
width: 16px; | |
height: 16px; | |
background: sprite($checkbox, yes) no-repeat; | |
} | |
.no{ | |
top: 0px; | |
position: absolute; | |
width: 16px; | |
height: 16px; | |
background: sprite($checkbox, no) no-repeat; | |
} | |
} | |
.textforcheckbox{ | |
float: left; | |
margin-left: 12px; | |
width: 140px; | |
height: 27px; | |
@include pagefont(9px, #5f6a71, 400); | |
@include text-shadow(rgba(White, 0.8) 0.5px 0.5px 0px); | |
line-height: 27px; | |
} | |
} | |
@include inputfield('.inputcity', 429px, 0, 0); | |
.starttyping{ | |
position: absolute; | |
left: 5px; | |
top: 207px; | |
height: 17px; | |
width: 424px; | |
padding-left: 5px; | |
@include pagefont(9px, #5f6a71, 400); | |
line-height: 17px; | |
background: White; | |
} | |
.photobg{ | |
position: absolute; | |
left: 234px; | |
top: 0px; | |
height: 92px; | |
width: 92px; | |
background: url('../images/photobg.png'); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment