Skip to content

Commit

Permalink
remove range max-width, create .range-label, closes #257
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Bradley committed Dec 6, 2013
1 parent 29b1008 commit 4c62c16
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 31 deletions.
52 changes: 33 additions & 19 deletions dist/css/ionic.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@charset "UTF-8";
/*!
* Copyright 2013 Drifty Co.
* http://drifty.com/
Expand Down Expand Up @@ -4574,12 +4573,11 @@ input[type="range"] {
padding-right: 2px;
padding-left: 1px;
width: auto;
height: 4px;
height: 35px;
outline: none;
background: linear-gradient(to right, #cccccc 0%, #cccccc 100%);
background-position: center;
background-size: 96% 4px;
background-size: 99% 4px;
background-repeat: no-repeat;
-webkit-appearance: none; }
input[type="range"]::-webkit-slider-thumb {
Expand All @@ -4595,17 +4593,17 @@ input[type="range"] {
/* what creates the colorful line on the left side of the slider */
position: absolute;
top: 8px;
left: -320px;
width: 320px;
left: -2001px;
width: 2000px;
height: 4px;
background: #444444;
content: ' '; }
input[type="range"]::-webkit-slider-thumb:after {
/* create a larger (but hidden) hit area */
position: absolute;
top: -15px;
left: -15px;
padding: 25px;
top: -20px;
left: -20px;
padding: 30px;
content: ' '; }

.range {
Expand Down Expand Up @@ -4642,29 +4640,45 @@ input[type="range"] {

.range .icon {
-webkit-box-flex: 0;
-webkit-flex: 0 1 24px;
-webkit-flex: 0;
-moz-box-flex: 0;
-moz-flex: 0 1 24px;
-ms-flex: 0 1 24px;
flex: 0 1 24px;
-moz-flex: 0;
-ms-flex: 0;
flex: 0;
display: block;
min-width: 24px;
text-align: center;
font-size: 24px; }

.range input {
-webkit-box-flex: 0;
-webkit-flex: 0 1 272px;
-moz-box-flex: 0;
-moz-flex: 0 1 272px;
-ms-flex: 0 1 272px;
flex: 0 1 272px;
-webkit-box-flex: 1;
-webkit-flex: 1;
-moz-box-flex: 1;
-moz-flex: 1;
-ms-flex: 1;
flex: 1;
display: block;
margin-right: 10px;
margin-left: 10px;
max-width: 320px;
width: 100%; }

.range-label {
-webkit-box-flex: 0;
-webkit-flex: 0 0 auto;
-moz-box-flex: 0;
-moz-flex: 0 0 auto;
-ms-flex: 0 0 auto;
flex: 0 0 auto;
display: block;
white-space: nowrap; }

.range-label:first-child {
padding-left: 5px; }

.range input + .range-label {
padding-right: 5px;
padding-left: 0; }

/**
* Buttons
* --------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion dist/css/themes/ionic-ios7.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@charset "UTF-8";
/*!
* Copyright 2013 Drifty Co.
* http://drifty.com/
Expand Down
35 changes: 25 additions & 10 deletions scss/_range.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ input[type="range"] {
padding-right: 2px;
padding-left: 1px;
width: auto;
height: $range-track-height;
height: $range-slider-height + 15;
outline: none;
background: linear-gradient(to right, $range-default-track-bg 0%, $range-default-track-bg 100%);
background-position: center;
background-size: 96% $range-track-height;
background-size: 99% $range-track-height;
background-repeat: no-repeat;
-webkit-appearance: none;

Expand All @@ -36,8 +35,8 @@ input[type="range"] {
/* what creates the colorful line on the left side of the slider */
position: absolute;
top: ($range-slider-height / 2) - ($range-track-height / 2);
left: $range-max-width * -1;
width: $range-max-width;
left: -2001px;
width: 2000px;
height: $range-track-height;
background: $dark;
content: ' ';
Expand All @@ -46,10 +45,12 @@ input[type="range"] {
&::-webkit-slider-thumb:after {
/* create a larger (but hidden) hit area */
position: absolute;
top: -15px;
left: -15px;
padding: 25px;
top: -20px;
left: -20px;
padding: 30px;
content: ' ';
//background: red;
//opacity: .5;
}

}
Expand Down Expand Up @@ -89,18 +90,32 @@ input[type="range"] {
}

.range .icon {
@include flex(0, 1, $range-icon-size);
@include flex(0);
display: block;
min-width: $range-icon-size;
text-align: center;
font-size: $range-icon-size;
}

.range input {
@include flex(0, 1, $range-max-width - ($range-icon-size * 2));
@include flex(1);
display: block;
margin-right: 10px;
margin-left: 10px;
max-width: $range-max-width;
width: 100%;
}

.range-label {
@include flex(0, 0, auto);
display: block;
white-space: nowrap;
}

.range-label:first-child {
padding-left: 5px;
}
.range input + .range-label {
padding-right: 5px;
padding-left: 0;
}

1 change: 0 additions & 1 deletion scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ $range-slider-width: 20px !default;
$range-slider-height: 20px !default;
$range-slider-border-radius: 10px !default;
$range-icon-size: 24px !default;
$range-max-width: 320px !default;

$range-light-track-bg: $button-light-border !default;
$range-stable-track-bg: $button-stable-border !default;
Expand Down

0 comments on commit 4c62c16

Please sign in to comment.