-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Colors moved to variables in SCSS #3026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,35 @@ | ||
$chosen-sprite: url('chosen-sprite.png') !default; | ||
$chosen-sprite-retina: url('[email protected]') !default; | ||
|
||
$chosen-bg-color: #fff; | ||
$chosen-box-shadow-color: #000; | ||
$chosen-border-color: #aaa; | ||
$chosen-group-name-color: #999; | ||
$chosen-highlighted-color: #3875d7; | ||
$chosen-highlighted-second-color: #2a62bc; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not a fan of using two different colors here to represent a gradient. You have gradients in variables below, so why not do the same here. Also, we could clarify that these are background colors. I'd recommend:
|
||
|
||
$chosen-search-choice-bg-color: #eee; | ||
$chosen-search-choice-disabled-bg-color: #e4e4e4; | ||
$chosen-search-choice-color: #333; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same "text" comment here: |
||
$chosen-search-choice-bg: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd recommend us using the word "gradient" here, and in terms of line ordering, this should be bundled with
|
||
$chosen-search-choice-disabled-color: #666; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same "text" comment here: |
||
$chosen-search-choice-focus-bg-color: $chosen-search-choice-disabled-color; | ||
$chosen-search-choice-disabled-border-color: #ccc; | ||
$chosen-no-results-bg: #f4f4f4; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency with other variable names, this should be |
||
|
||
$chosen-color: #222; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same "text" comment here: |
||
$chosen-border-color: #5897fb; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the first actual issue I see in the code. |
||
$chosen-single-color: #444; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same "text" comment here: |
||
$chosen-bg: linear-gradient($chosen-bg-color 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%); | ||
$chosen-single-bg: linear-gradient(#eee 20%, $chosen-bg-color 80%); | ||
$chosen-default-color: $chosen-group-name-color; | ||
$chosen-container-color: $chosen-single-color; | ||
$chosen-container-disabled-color: $chosen-search-choice-disabled-border-color; | ||
$chosen-container-no-results-color: #777; | ||
$chosen-choices-color: #999; | ||
$chosen-choices-bg: linear-gradient($chosen-search-choice-bg-color 1%, $chosen-bg-color 15%); | ||
$chosen-drop-result-selected: $chosen-search-choice-disabled-border-color; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure how I feel about using a variable inside the definition of another variable. Normally I'd be all for it, but in this case (and a few other cases I see in this file), the variables are completely unrelated. For instance, |
||
|
||
/* @group Base */ | ||
.chosen-container { | ||
position: relative; | ||
|
@@ -16,10 +45,10 @@ $chosen-sprite-retina: url('[email protected]') !default; | |
top: 100%; | ||
z-index: 1010; | ||
width: 100%; | ||
border: 1px solid #aaa; | ||
border: 1px solid $chosen-border-color; | ||
border-top: 0; | ||
background: #fff; | ||
box-shadow: 0 4px 5px rgba(#000,.15); | ||
background: $chosen-bg-color; | ||
box-shadow: 0 4px 5px rgba($chosen-box-shadow-color,.15); | ||
clip: rect(0,0,0,0); | ||
clip-path: inset(100% 100%); | ||
} | ||
|
@@ -38,7 +67,7 @@ $chosen-sprite-retina: url('[email protected]') !default; | |
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
font-weight: normal; | ||
color: #999999; | ||
color: $chosen-group-name-color; | ||
&:after { | ||
content: ":"; | ||
padding-left: 2px; | ||
|
@@ -57,19 +86,19 @@ $chosen-sprite-retina: url('[email protected]') !default; | |
overflow: hidden; | ||
padding: 0 0 0 8px; | ||
height: 25px; | ||
border: 1px solid #aaa; | ||
border: 1px solid $chosen-border-color; | ||
border-radius: 5px; | ||
background-color: #fff; | ||
background: linear-gradient(#fff 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%); | ||
background-color: $chosen-bg-color; | ||
background: $chosen-bg; | ||
background-clip: padding-box; | ||
box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(#000,.1); | ||
color: #444; | ||
box-shadow: 0 0 3px $chosen-bg-color inset, 0 1px 1px rgba($chosen-box-shadow-color,.1); | ||
color: $chosen-single-color; | ||
text-decoration: none; | ||
white-space: nowrap; | ||
line-height: 24px; | ||
} | ||
.chosen-default { | ||
color: #999; | ||
color: $chosen-default-color; | ||
} | ||
.chosen-single span { | ||
display: block; | ||
|
@@ -124,7 +153,7 @@ $chosen-sprite-retina: url('[email protected]') !default; | |
width: 100%; | ||
height: auto; | ||
outline: 0; | ||
border: 1px solid #aaa; | ||
border: 1px solid $chosen-border-color; | ||
background: $chosen-sprite no-repeat 100% -20px; | ||
font-size: 1em; | ||
font-family: sans-serif; | ||
|
@@ -147,7 +176,7 @@ $chosen-sprite-retina: url('[email protected]') !default; | |
|
||
/* @group Results */ | ||
.chosen-container .chosen-results { | ||
color: #444; | ||
color: $chosen-container-color; | ||
position: relative; | ||
overflow-x: hidden; | ||
overflow-y: auto; | ||
|
@@ -169,18 +198,18 @@ $chosen-sprite-retina: url('[email protected]') !default; | |
} | ||
&.disabled-result { | ||
display: list-item; | ||
color: #ccc; | ||
color: $chosen-container-disabled-color; | ||
cursor: default; | ||
} | ||
&.highlighted { | ||
background-color: #3875d7; | ||
background-image: linear-gradient(#3875d7 20%, #2a62bc 90%); | ||
color: #fff; | ||
background-color: $chosen-highlighted-color; | ||
background-image: linear-gradient($chosen-highlighted-color 20%, $chosen-highlighted-second-color 90%); | ||
color: $chosen-bg-color; | ||
} | ||
&.no-results { | ||
color: #777; | ||
color: $chosen-container-no-results-color; | ||
display: list-item; | ||
background: #f4f4f4; | ||
background: $chosen-no-results-bg; | ||
} | ||
&.group-result { | ||
display: list-item; | ||
|
@@ -207,9 +236,9 @@ $chosen-sprite-retina: url('[email protected]') !default; | |
padding: 0 5px; | ||
width: 100%; | ||
height: auto; | ||
border: 1px solid #aaa; | ||
background-color: #fff; | ||
background-image: linear-gradient(#eee 1%, #fff 15%); | ||
border: 1px solid $chosen-border-color; | ||
background-color: $chosen-bg-color; | ||
background-image: $chosen-choices-bg; | ||
cursor: text; | ||
} | ||
.chosen-choices li { | ||
|
@@ -227,7 +256,7 @@ $chosen-sprite-retina: url('[email protected]') !default; | |
border: 0 !important; | ||
background: transparent !important; | ||
box-shadow: none; | ||
color: #999; | ||
color: $chosen-choices-color; | ||
font-size: 100%; | ||
font-family: sans-serif; | ||
line-height: normal; | ||
|
@@ -239,16 +268,16 @@ $chosen-sprite-retina: url('[email protected]') !default; | |
position: relative; | ||
margin: 3px 5px 3px 0; | ||
padding: 3px 20px 3px 5px; | ||
border: 1px solid #aaa; | ||
border: 1px solid $chosen-border-color; | ||
max-width: 100%; | ||
border-radius: 3px; | ||
background-color: #eeeeee; | ||
background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); | ||
background-color: $chosen-search-choice-bg-color; | ||
background-image: $chosen-search-choice-bg; | ||
background-size: 100% 19px; | ||
background-repeat: repeat-x; | ||
background-clip: padding-box; | ||
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(#000,.05); | ||
color: #333; | ||
box-shadow: 0 0 2px $chosen-bg-color inset, 0 1px 0 rgba($chosen-box-shadow-color,.05); | ||
color: $chosen-search-choice-color; | ||
line-height: 13px; | ||
cursor: default; | ||
span { | ||
|
@@ -270,13 +299,13 @@ $chosen-sprite-retina: url('[email protected]') !default; | |
} | ||
&.search-choice-disabled { | ||
padding-right: 5px; | ||
border: 1px solid #ccc; | ||
background-color: #e4e4e4; | ||
background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); | ||
color: #666; | ||
border: 1px solid $chosen-search-choice-disabled-border-color; | ||
background-color: $chosen-search-choice-disabled-bg-color; | ||
background-image: $chosen-search-choice-bg; | ||
color: $chosen-search-choice-disabled-color; | ||
} | ||
&.search-choice-focus { | ||
background: #d4d4d4; | ||
background: $chosen-search-choice-focus-bg-color; | ||
.search-choice-close { | ||
background-position: -42px -10px; | ||
} | ||
|
@@ -288,7 +317,7 @@ $chosen-sprite-retina: url('[email protected]') !default; | |
} | ||
.chosen-drop .result-selected { | ||
display: list-item; | ||
color: #ccc; | ||
color: $chosen-drop-result-selected; | ||
cursor: default; | ||
} | ||
} | ||
|
@@ -297,18 +326,18 @@ $chosen-sprite-retina: url('[email protected]') !default; | |
/* @group Active */ | ||
.chosen-container-active{ | ||
.chosen-single { | ||
border: 1px solid #5897fb; | ||
box-shadow: 0 0 5px rgba(#000,.3); | ||
border: 1px solid $chosen-border-color; | ||
box-shadow: 0 0 5px rgba($chosen-box-shadow-color,.3); | ||
} | ||
&.chosen-with-drop{ | ||
.chosen-single { | ||
border: 1px solid #aaa; | ||
border: 1px solid $chosen-border-color; | ||
-moz-border-radius-bottomright: 0; | ||
border-bottom-right-radius: 0; | ||
-moz-border-radius-bottomleft: 0; | ||
border-bottom-left-radius: 0; | ||
background-image: linear-gradient(#eee 20%, #fff 80%); | ||
box-shadow: 0 1px 0 #fff inset; | ||
background-image: $chosen-single-bg; | ||
box-shadow: 0 1px 0 $chosen-bg-color inset; | ||
} | ||
.chosen-single div { | ||
border-left: none; | ||
|
@@ -319,10 +348,10 @@ $chosen-sprite-retina: url('[email protected]') !default; | |
} | ||
} | ||
.chosen-choices { | ||
border: 1px solid #5897fb; | ||
box-shadow: 0 0 5px rgba(#000,.3); | ||
border: 1px solid $chosen-border-color; | ||
box-shadow: 0 0 5px rgba($chosen-box-shadow-color,.3); | ||
li.search-field input[type="text"] { | ||
color: #222 !important; | ||
color: $chosen-color !important; | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot of colors here. I like what you started with clarifying whether a color is background or border or box-shadow or whatever. I think we should keep that going with text colors too, so I'd recommend this be
$chosen-group-name-text-color
.