Skip to content

Commit

Permalink
Style Select2 elements with multiple options
Browse files Browse the repository at this point in the history
  • Loading branch information
allejo committed Sep 16, 2017
1 parent dd5bb69 commit 06ecbd9
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ gulp.task('js:hint', function (cb) {
var sass = require('gulp-sass');
var eyeglass = require('eyeglass');
var combineMq = require('gulp-combine-mq');
var moduleImporter = require('sass-module-importer');

gulp.task('sass:dev', function (cb) {
var sourcemaps = require('gulp-sourcemaps');
Expand All @@ -126,6 +127,7 @@ gulp.task('sass:dev', function (cb) {
gulp.src('assets/css/styles.scss'),
sourcemaps.init(),
sass(eyeglass({
importer: moduleImporter(),
outputStyle: 'compact'
})),
combineMq({
Expand All @@ -145,6 +147,7 @@ gulp.task('sass:dist', function (cb) {
pump([
gulp.src('assets/css/styles.scss'),
sass(eyeglass({
importer: moduleImporter(),
outputStyle: 'compressed'
})),
combineMq({
Expand Down
13 changes: 11 additions & 2 deletions assets/css/components/_select2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ span.select2 {
.select2-selection,
.select2-selection__rendered {
@include theme-rule(color, 'body.color');

line-height: 30px;
}

.select2-selection__arrow {
Expand All @@ -30,6 +28,17 @@ span.select2 {
@include theme-rule(border-color, 'form.select2.arrow_color_dn');
}
}

.select2-selection__choice {
@include theme-rule(background-color, 'form.select2.choice_background');
@include theme-rule(color, 'form.select2.choice_color');
}

.select2-selection__choice__remove {
@include theme-rule(color, 'form.select2.choice_color');

margin-right: 4px !important;
}
}

.select2-dropdown {
Expand Down
3 changes: 2 additions & 1 deletion assets/css/styles.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//
// Eyeglass modules
// Eyeglass and Node modules
// (things that aren't pure Sass)
//
@import 'sassy-data';
@import 'select2/dist/css/select2.css';


//
Expand Down
2 changes: 2 additions & 0 deletions assets/css/themes/dark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ form:
select2:
arrow_color_up: "#ffffff transparent transparent transparent"
arrow_color_dn: "transparent transparent #ffffff transparent"
choice_color: "#ffffff"
choice_background: "#1b6a7c"
selected: "#6a6e76"
drop_shadow: "0 6px 14px 2px rgba(0, 0, 0, 0.75)"

Expand Down
2 changes: 2 additions & 0 deletions assets/css/themes/light.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ form:
select2:
arrow_color_up: "#888 transparent transparent transparent"
arrow_color_dn: "transparent transparent #888 transparent"
choice_color: "#0366d6"
choice_background: "#e1f3ff"
selected: "#c7c7c7"
drop_shadow: "0 6px 14px 2px rgba(0, 0, 0, 0.2)"

Expand Down
59 changes: 59 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"postcss-remove-prefixes": "^1.2.0",
"postcss-unprefix": "^2.1.1",
"pump": "^1.0.1",
"sass-module-importer": "^1.4.0",
"select2": "^4.0.3",
"tinysort": "^2.3.6"
},
Expand Down
1 change: 0 additions & 1 deletion views/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>{% spaceless %}{% block title %}{{ app.siteTitle }}{% endblock %}{% endspaceless %}</title>
<link rel="stylesheet" href="{{ asset('components/select2/dist/css/select2.css') }}" />
<link rel="stylesheet" href="{{ asset('includes/ladda/dist/ladda-themeless.min.css') }}" />
<link rel="stylesheet" href="{{ asset('assets/css/styles.css') }}" />

Expand Down

0 comments on commit 06ecbd9

Please sign in to comment.