Skip to content

Commit

Permalink
feat(styling): add more material design stylings
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding-SE committed Mar 13, 2020
1 parent f08864d commit 680788b
Show file tree
Hide file tree
Showing 4 changed files with 234 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/common/src/styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -473,14 +473,20 @@ $multiselect-checkbox-hover-bg-color: $row-mouse-hover-color !default;
$multiselect-select-all-border-bottom: 1px solid #ddd !default;
$multiselect-select-all-text-color: darken($primary-color, 5%) !default;
$multiselect-select-all-text-hover-color: darken($primary-color, 10%) !default;
$multiselect-icon-font-size: 16px !default;
$multiselect-icon-arrow-down: "\f0d7" !default;
$multiselect-icon-arrow-up: "\f0d8" !default;
$multiselect-icon-arrow-font-size: $multiselect-icon-font-size !default;
$multiselect-icon-color: $primary-color !default;
$multiselect-icon-checked: "\f14a" !default;
$multiselect-icon-unchecked: "\f096" !default;
$multiselect-icon-radio-checked: "\f192" !default;
$multiselect-icon-radio-unchecked: "\f10c" !default;
$multiselect-icon-font-size: 16px !default;
$multiselect-icon-search: "\f002" !default;
$multiselect-icon-search-margin-right: 8px !default;
$multiselect-ok-button-font-weight: 600 !default;
$multiselect-label-margin-bottom: 5px !default;
$multiselect-unchecked-opacity: 0.5 !default;
$multiselect-unchecked-opacity: 0.6 !default;
$multiselect-placeholder-font-family: $filter-placeholder-font-family !default;
$multiselect-ok-button-bg-color: #fff !default;
$multiselect-ok-button-bg-hover-color: darken($row-mouse-hover-color, 3%) !default;
Expand Down
191 changes: 191 additions & 0 deletions packages/common/src/styles/multiple-select.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
/**
* @author zhixin wen <[email protected]>
*/

.ms-parent {
display: inline-block;
position: relative;
vertical-align: middle;
}

.ms-choice {
display: block;
width: 100%;
height: 26px;
padding: 0;
overflow: hidden;
cursor: pointer;
border: 1px solid #aaa;
text-align: left;
white-space: nowrap;
line-height: 26px;
color: #444;
text-decoration: none;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background-color: #fff;
}

.ms-choice.disabled {
background-color: #f4f4f4;
background-image: none;
border: 1px solid #ddd;
cursor: default;
}

.ms-choice > span {
position: absolute;
top: 0;
left: 0;
right: 20px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
padding-left: 8px;
}

.ms-choice > span.placeholder {
color: #999;
}

.ms-choice > div {
position: absolute;
top: 0;
right: 0;
width: 20px;
height: 25px;
/* background: url("multiple-select.png") left top no-repeat; */
}

.ms-choice > div.open {
/* background: url('multiple-select.png') right top no-repeat; */
}

.ms-drop {
width: 100%;
overflow: hidden;
display: none;
margin-top: -1px;
padding: 0;
position: absolute;
z-index: 1000;
background: #fff;
color: #000;
border: 1px solid #aaa;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}

.ms-drop.bottom {
top: 100%;
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
-moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
}

.ms-drop.top {
bottom: 100%;
-webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
-moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
}

.ms-search {
display: inline-block;
margin: 0;
min-height: 26px;
padding: 4px;
position: relative;
white-space: nowrap;
width: 100%;
z-index: 10000;
}

.ms-search input {
width: 100%;
height: auto !important;
min-height: 24px;
padding: 0 20px 0 5px;
margin: 0;
outline: 0;
font-family: sans-serif;
font-size: 1em;
border: 1px solid #aaa;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
/* background: #fff url('multiple-select.png') no-repeat 100% -22px; */
/* background: url('multiple-select.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); */
/* background: url('multiple-select.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); */
/* background: url('multiple-select.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); */
/* background: url('multiple-select.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); */
/* background: url('multiple-select.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); */
/* background: url('multiple-select.png') no-repeat 100% -22px, linear-gradient(to top, #ffffff 85%, #eeeeee 99%); */
}

.ms-search, .ms-search input {
-webkit-box-sizing: border-box;
-khtml-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}

.ms-drop ul {
overflow: auto;
margin: 0;
padding: 5px 8px;
}

.ms-drop ul > li {
list-style: none;
display: list-item;
background-image: none;
position: static;
}

.ms-drop ul > li .disabled {
opacity: .35;
filter: Alpha(Opacity=35);
}

.ms-drop ul > li.multiple {
display: block;
float: left;
}

.ms-drop ul > li.group {
clear: both;
}

.ms-drop ul > li.multiple label {
width: 100%;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.ms-drop ul > li label {
font-weight: normal;
display: block;
white-space: nowrap;
}

.ms-drop ul > li label.optgroup {
font-weight: bold;
}

.ms-drop input[type="checkbox"] {
vertical-align: middle;
}

.ms-drop .ms-no-results {
display: none;
}
26 changes: 26 additions & 0 deletions packages/common/src/styles/slick-plugins.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* plugin variables */
@import './variables';
@import './multiple-select';

// ----------------------------------------------
// Cell Menu Plugin (Action menu
Expand Down Expand Up @@ -467,6 +468,21 @@
border: $multiselect-input-filter-border;
background-color: transparent;

div {
&:before {
font-family: $icon-font-family;
font-size: $multiselect-icon-arrow-font-size;
content: $multiselect-icon-arrow-down;
}
&.open {
&:before {
font-family: $icon-font-family;
font-size: $multiselect-icon-arrow-font-size;
content: $multiselect-icon-arrow-up;
}
}
}

span {
font-size: $multiselect-input-filter-font-size;
font-family: $multiselect-input-filter-font-family;
Expand Down Expand Up @@ -532,6 +548,7 @@
.ms-select-all {
border-bottom: $multiselect-select-all-border-bottom;
label {
display: inline-block;
font-weight: normal;
padding: 5px 8px;
color: $multiselect-select-all-text-color;
Expand All @@ -558,6 +575,15 @@
color: $multiselect-ok-button-text-hover-color;
}
}
.ms-search {
&:before {
font-family: $icon-font-family;
font-size: $multiselect-icon-font-size;
content: $multiselect-icon-search;
right: $multiselect-icon-search-margin-right;
position: absolute;
}
}
}

// ----------------------------------------------
Expand Down
9 changes: 9 additions & 0 deletions packages/common/src/styles/slickgrid-theme-material.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ $grid-menu-title-font-size: 18px;
$header-menu-button-icon-font-size: 16px;
$header-menu-icon-font-size: 18px;
$header-menu-button-icon: "\FB0B";
$multiselect-icon-arrow-down: "\F35D";
$multiselect-icon-arrow-up: "\F360";
$multiselect-icon-arrow-font-size: $icon-font-size - 4px;
$multiselect-icon-checked: "\F132";
$multiselect-icon-unchecked: "\F131";
$multiselect-icon-radio-checked: "\FAA4";
$multiselect-icon-radio-unchecked: "\F130";
$multiselect-icon-search: "\F349";
$multiselect-unchecked-opacity: 0.8;
$slider-editor-height: 26px;
$primary-color: #009530;
$row-mouse-hover-color: #ebfaef;
Expand Down

0 comments on commit 680788b

Please sign in to comment.