Skip to content

Commit b30577c

Browse files
author
Jeff Escalante
committed
Merge pull request #223 from jenius/216
adds no-select() and adjusts the color tolerance of buttons
2 parents f586eba + b2427d7 commit b30577c

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

axis/buttons.styl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
button($color = $default-color, $size = "medium", $text-color = null)
4747

4848
// color detection and changes
49-
$text-color = (light($color) ? #494949 : #fff) unless $text-color
49+
$text-color = (light(darken($color, 22%)) ? rgba(#000, .7) : #fff) unless $text-color
5050
$parsed-size = -parse($size)
5151

5252
// now that we've got numbers, let's work some proportions
@@ -68,7 +68,9 @@ button($color = $default-color, $size = "medium", $text-color = null)
6868
text-align: center
6969
text-decoration: none
7070
display: inline-block
71-
border none
71+
border: none
72+
no-select()
73+
7274
&:hover, &:focus
7375
background-color: darken($color, 5%)
7476
color: darken($text-color, 3%)
@@ -103,8 +105,8 @@ glossy-button($color = $default-color, $size = "medium", $text-color = null, $sh
103105
if $text-color
104106
$dark-text = light($text-color) ? true : false
105107
else
106-
$dark-text = light($color) ? false : true
107-
$text-color = $dark-text ? white : #494949
108+
$dark-text = light(darken($color, 22%)) ? false : true
109+
$text-color = $dark-text ? white : rgba(#000, .7)
108110

109111
$shadow-color = $dark-text ? rgba(#000,.1) : rgba(#fff,.3) unless $shadow-color
110112
$hover-color = $dark-text ? rgba(#000,.2) : rgba(#fff,.5) unless $hover-color
@@ -135,6 +137,7 @@ glossy-button($color = $default-color, $size = "medium", $text-color = null, $sh
135137
text-align: center
136138
text-decoration: none
137139
display: inline-block
140+
no-select()
138141

139142
&:hover, &:focus
140143
background-position: 0 unit($height * -1, 'px')

test/fixtures/additive/framework.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,11 @@ textarea.error:focus {
392392
text-decoration: none;
393393
display: inline-block;
394394
border: none;
395+
-webkit-touch-callout: none;
396+
-webkit-user-select: none;
397+
-moz-user-select: none;
398+
-ms-user-select: none;
399+
user-select: none;
395400
}
396401
.btn:hover,
397402
.btn:focus {
@@ -422,6 +427,11 @@ textarea.error:focus {
422427
text-align: center;
423428
text-decoration: none;
424429
display: inline-block;
430+
-webkit-touch-callout: none;
431+
-webkit-user-select: none;
432+
-moz-user-select: none;
433+
-ms-user-select: none;
434+
user-select: none;
425435
}
426436
.btn-fancy:hover,
427437
.btn-fancy:focus {

test/fixtures/buttons/button.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
text-decoration: none;
1313
display: inline-block;
1414
border: none;
15+
-webkit-touch-callout: none;
16+
-webkit-user-select: none;
17+
-moz-user-select: none;
18+
-ms-user-select: none;
19+
user-select: none;
1520
}
1621
.button:hover,
1722
.button:focus {

test/fixtures/buttons/glossy-button.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
text-align: center;
1717
text-decoration: none;
1818
display: inline-block;
19+
-webkit-touch-callout: none;
20+
-webkit-user-select: none;
21+
-moz-user-select: none;
22+
-ms-user-select: none;
23+
user-select: none;
1924
}
2025
.glossy-button:hover,
2126
.glossy-button:focus {

0 commit comments

Comments
 (0)