Skip to content

Commit

Permalink
Merge pull request #16 from Spectrum/issue/SDL-69_checkbox_height
Browse files Browse the repository at this point in the history
SDL-69 - Checkbox should be 32px height
  • Loading branch information
karstens authored and GitHub Enterprise committed Dec 17, 2016
2 parents 6dcb4ac + 12b7596 commit fe2fe1b
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 25 deletions.
29 changes: 17 additions & 12 deletions abstract/checkbox/index.styl
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
$spectrum-checkbox-size = 12*$px
$spectrum-checkbox-radius = 2*$px
@require '../commons'

$spectrum-checkbox-height = $spectrum-component-single-line-height

$spectrum-checkbox-checkmark-box-size = 12*$px
$spectrum-checkbox-checkmark-mark-size = 10*$px
$spectrum-checkbox-checkmark-box-border-radius = 2*$px

spectrum-checkbox() {
display: inline-block
position: relative
padding: 7*$px 0
font-size: 0
height: $spectrum-checkbox-height
line-height: $spectrum-checkbox-height
}

spectrum-checkbox-input() {
Expand All @@ -29,24 +35,23 @@ spectrum-checkbox-label() {
spectrum-checkbox-checkmark() {
display: inline-block
box-sizing: border-box
width: $spectrum-checkbox-size
height: $spectrum-checkbox-size
width: $spectrum-checkbox-checkmark-box-size
height: $spectrum-checkbox-checkmark-box-size

border-radius: $spectrum-checkbox-radius
border-radius: $spectrum-checkbox-checkmark-box-border-radius
border-width: 2*$px
border-style: solid

vertical-align: middle

transition: border $spectrum-transition-time ease-in-out, box-shadow $spectrum-transition-time ease-in-out

&:after {
&::after {
position: absolute
// i guess this value depends on the line-height of the input element ?!
top: 14*$px
top: ($spectrum-checkbox-height / 2 - $spectrum-checkbox-checkmark-mark-size / 2 )
left: 1*$px
width: 10*$px
height: 10*$px
width: $spectrum-checkbox-checkmark-mark-size
height: $spectrum-checkbox-checkmark-mark-size

background-repeat: no-repeat
background-position: center
Expand All @@ -63,7 +68,7 @@ spectrum-checkbox-checkmark() {
spectrum-checkbox-checkmark--checked() {
border-width: 6*$px

&:after {
&::after {
transform:scale(1)
opacity:1
}
Expand Down
2 changes: 1 addition & 1 deletion abstract/checkbox/skin.styl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $spectrum-checkbox-check-icon-url = 'embed/Check.svg' // Relative to project roo
spectrum-checkbox-checkmark() {
border-color: $spectrum-color-border-switch-default;

&:after {
&::after {
background-image: svgurl(embedurl($spectrum-checkbox-check-icon-url)) svg(path fill $spectrum-color-switch-track);
}
}
Expand Down
20 changes: 12 additions & 8 deletions abstract/textfield/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ spectrum-textfield() {
}
}


// to be used for textarea
spectrum-textfield--multiline() {
height: auto;
padding: 4*$px 8*$px;
text-indent: 0;
}

spectrum-textfield--quiet() {
border-radius: 0;
text-indent: 0;
Expand All @@ -89,3 +81,15 @@ spectrum-textfield--quiet() {
padding-right: 0;

}

// to be used for textarea
spectrum-textfield--multiline() {
height: auto;
padding: 4*$px 8*$px;
text-indent: 0;
}

spectrum-textfield--quiet--multiline() {
resize: none;
overflow-y: hidden;
}
1 change: 1 addition & 0 deletions reference/page/skin.styl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// colors
& {
spectrum-page()
}
1 change: 0 additions & 1 deletion reference/radio/skin.styl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
}

.spectrum-Radio {
spectrum-radio()

.spectrum-Radio-label {
spectrum-radio-label()
Expand Down
8 changes: 6 additions & 2 deletions reference/textfield/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
spectrum-textfield()
}

.spectrum-Textfield--quiet {
spectrum-textfield--quiet()
}

.spectrum-Textfield--multiline {
spectrum-textfield--multiline()
}

.spectrum-Textfield--quiet {
spectrum-textfield--quiet()
.spectrum-Textfield--quiet + spectrum-Textfield--multiline {
spectrum-textfield--quiet--multiline()
}

@import 'light.styl'
Expand Down
1 change: 0 additions & 1 deletion reference/textfield/skin.styl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
&:invalid {
spectrum-textfield--invalid()
}

}

.spectrum-Textfield--quiet {
Expand Down

0 comments on commit fe2fe1b

Please sign in to comment.