Skip to content

Commit

Permalink
feat(styling): add a Salesforce theme
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding-SE committed Apr 20, 2020
1 parent c561335 commit 3b62101
Show file tree
Hide file tree
Showing 10 changed files with 148 additions and 15 deletions.
6 changes: 5 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@
"postsass-build-task:scss-compile:material": "postcss --use autoprefixer --output dist/styles/css/slickgrid-theme-material.css dist/styles/css/slickgrid-theme-material.css",
"sass-build-task:scss-compile:se-material": "node-sass --source-map true src/styles/se-slickgrid-theme-material.scss -o dist/styles/css",
"postsass-build-task:scss-compile:se-material": "postcss --use autoprefixer --output dist/styles/css/se-slickgrid-theme-material.css dist/styles/css/se-slickgrid-theme-material.css",
"sass-build-task:scss-compile:salesforce": "node-sass --source-map true src/styles/slickgrid-theme-salesforce.scss -o dist/styles/css",
"postsass-build-task:scss-compile:salesforce": "postcss --use autoprefixer --output dist/styles/css/slickgrid-theme-salesforce.css dist/styles/css/slickgrid-theme-salesforce.css",
"sass:build": "run-p sass-build-task:scss-compile:*",
"sass:copy": "cross-env copyfiles -f src/styles/*.scss dist/styles/sass",
"presass:watch:bootstrap": "cross-env npm run sass-build-task:scss-compile:bootstrap",
"sass:watch:bootstrap": "cross-env npm run sass-build-task:scss-compile:bootstrap -- -watch",
"presass:watch:material": "cross-env npm run sass-build-task:scss-compile:material",
"sass:watch:material": "cross-env npm run sass-build-task:scss-compile:material -- -watch",
"sass:watch": "run-p sass:watch:bootstrap sass:watch:material sass:copy:watch",
"presass:watch:salesforce": "cross-env npm run sass-build-task:scss-compile:salesforce",
"sass:watch:salesforce": "cross-env npm run sass-build-task:scss-compile:salesforce -- -watch",
"sass:watch": "run-p sass:watch:bootstrap sass:watch:material sass:watch:salesforce sass:copy:watch",
"sass:copy:watch": "nodemon --ext scss --watch src/styles/*.scss --exec \"npm run sass:copy\"",
"test": "node_modules/.bin/jest --runInBand --coverage --config ../../test/jest.config.js",
"test:watch": "node_modules/.bin/jest --config ../../test/jest.config.js --watch"
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/global-grid-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const GlobalGridOptions: GridOption = {
// useSimpleViewportCalc: true,
// saveDetailViewOnScroll: false,
// },
headerRowHeight: 30,
headerRowHeight: 35,
rowHeight: 35,
topPanelHeight: 30
};
15 changes: 9 additions & 6 deletions packages/common/src/styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ $cell-font-family: $font-family !default;
$cell-font-weight: normal !default;
$cell-active-border: 1px solid rgb(170, 170, 170) !default;
$cell-border-top: 1px solid $border-color !default;
$cell-border-right: 0 none !default;
$cell-border-bottom: 0 none !default;
$cell-border-left: 0 none !default;
$cell-border-right: 1px transparent !default;
$cell-border-bottom: 1px transparent !default;
$cell-border-left: 1px transparent !default;
$cell-even-background-color: #ffffff !default;
$cell-odd-background-color: darken($grid-cell-color, 3%) !default; // for striping every second row
$cell-odd-active-background-color: darken($grid-cell-color, 5%) !default;
Expand Down Expand Up @@ -192,7 +192,7 @@ $column-picker-item-hover-color: #fafafa !default;
$column-picker-label-margin: 4px !default;
$column-picker-label-font-weight: normal !default;
$column-picker-link-background-color: #ffffff !default;
$column-picker-title-border-bottom: solid 1px #d6d6d6 !default;
$column-picker-title-border-bottom: 1px solid #d6d6d6 !default;
$column-picker-title-font-size: ($column-picker-item-font-size + 2px) !default;
$column-picker-title-font-weight: normal !default;
$column-picker-title-margin-bottom: 10px !default;
Expand Down Expand Up @@ -298,7 +298,7 @@ $cell-menu-divider-margin: 8px 5px !default;
$cell-menu-divider-color: #e7e7e7 !default;
$cell-menu-divider-width: calc(100% - 40px) !default;
$cell-menu-option-list-margin-bottom: 10px !default;
$cell-menu-title-border-bottom: solid 1px #d6d6d6 !default;
$cell-menu-title-border-bottom: 1px solid #d6d6d6 !default;
$cell-menu-title-font-size: ($cell-menu-item-font-size + 2px) !default;
$cell-menu-title-font-weight: normal !default;
$cell-menu-title-margin-bottom: 10px !default;
Expand Down Expand Up @@ -336,7 +336,7 @@ $context-menu-divider-margin: 8px 5px !default;
$context-menu-divider-color: #e7e7e7 !default;
$context-menu-divider-width: calc(100% - 40px) !default;
$context-menu-option-list-margin-bottom: 10px !default;
$context-menu-title-border-bottom: solid 1px #d6d6d6 !default;
$context-menu-title-border-bottom: 1px solid #d6d6d6 !default;
$context-menu-title-font-size: ($context-menu-item-font-size + 2px) !default;
$context-menu-title-font-weight: normal !default;
$context-menu-title-margin-bottom: 10px !default;
Expand All @@ -363,6 +363,7 @@ $header-menu-item-disabled-color: silver !default;
$header-menu-item-padding: 2px 4px !default;
$header-menu-item-hover-border: 1px solid #BFBDBD !default;
$header-menu-item-hover-color: #fafafa !default;
$header-menu-icon-font-color: $cell-text-color !default;
$header-menu-icon-font-size: $icon-font-size !default;
$header-menu-icon-font-weight: normal !default;
$header-menu-icon-line-height: 14px !default;
Expand All @@ -377,6 +378,8 @@ $header-menu-display: none !default; /* can be none or inl

/* Checkbox Selector / Row Selection */
$checkbox-selector-color: $primary-color !default;
$checkbox-selector-checked-color: $checkbox-selector-color !default;
$checkbox-selector-unchecked-color: $checkbox-selector-color !default;
$checkbox-selector-size: ($icon-font-size - 1px) !default;
$checkbox-selector-icon: "\f00c" !default;
$checkbox-selector-icon-font-weight: bold !default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ $primary-color: #009530;
$row-mouse-hover-color: #ebfaef;
$row-selected-color: #d4f6d7; /*rgba(0, 149, 48, 0.2);*/

@import './slick-material';
@import './slick-without-bootstrap-min-styling';
@import './slick-grid';
@import './slick-controls';
@import './slick-editors';
Expand Down
2 changes: 0 additions & 2 deletions packages/common/src/styles/slick-bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,10 @@
}
table {
height: 100%;
border: 0 none;
padding: 0;
background: none;
}
td {
border: 0 none;
padding: 0;
vertical-align: middle;
text-align: left;
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/styles/slick-default-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

.slick-cell {
background: inherit;

border: 1px transparent;
padding-top: 3px;
padding-bottom: 4px;
padding-left: 4px;
Expand Down
4 changes: 3 additions & 1 deletion packages/common/src/styles/slick-plugins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@
background-position: center center;
background-repeat: no-repeat;
display: inline-block;
color: $header-menu-icon-font-color;
font-size: $header-menu-icon-font-size;
font-weight: $header-menu-icon-font-weight;
line-height: $header-menu-icon-line-height;
Expand Down Expand Up @@ -442,7 +443,7 @@
#filter-checkbox-selectall-container > input[type=checkbox] + label:before {
cursor: pointer;
content: $checkbox-selector-icon-unchecked;
color: $checkbox-selector-color;
color: $checkbox-selector-unchecked-color;
display: inline-block;
font-weight: $checkbox-selector-icon-font-weight;
font-family: $icon-font-family;
Expand All @@ -458,6 +459,7 @@
input[type=checkbox]:checked + label:before,
#filter-checkbox-selectall-container > input[type=checkbox]:checked + label:before {
content: $checkbox-selector-icon-checked;
color: $checkbox-selector-checked-color;
opacity: 1; /* checked icon */
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import './variables';

/** Bootstrap buttons adapted to Material Design */
/** Bootstrap buttons styling copied and changed slightly for Material Design */
.btn {
cursor: pointer;
font-family: $font-family;
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/styles/slickgrid-theme-material.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ $row-mouse-hover-color: #ebfaef;
$row-selected-color: #d4f6d7; /*rgba(0, 149, 48, 0.2);*/

@import './roboto-font';
@import './slick-material';
@import './slick-without-bootstrap-min-styling';
@import './slick-grid';
@import './slick-controls';
@import './slick-editors';
Expand Down
126 changes: 126 additions & 0 deletions packages/common/src/styles/slickgrid-theme-salesforce.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
/** Salesforce Theme */
@import './multiple-select';

$primary-color: #006DCC;
$font-family: var(--lwc-fontFamily,'Salesforce Sans', Arial, sans-serif);
$cell-active-border: 1px solid #0070d2;
$cell-border-top: none;
$cell-font-weight: 400;
$cell-odd-background-color: #f3f2f2;
$cell-text-color: #080707;
$font-size-base-value: 13;
$icon-font-family: "Material Design Icons";
$icon-font-size: 20px;
$group-totals-formatter-color: #666666;
$header-background-color: #fafaf9;
$header-border-bottom: 1px solid #ccc;
$header-font-size: 13px;
$header-font-weight: 700;
$header-text-color: rgba(0, 0, 0, 0.87);
$header-border-bottom: transparent;
$header-filter-row-border-bottom: 1px solid #d0d0d0;
$slick-pane-top-border-top: 1px solid #d0d0d0;
$header-resizable-hover: 2px solid #0070D2;
$header-resizable-hover-border-bottom: $header-resizable-hover;
$header-resizable-hover-border-left: $header-resizable-hover;
$header-resizable-hover-border-right: $header-resizable-hover;
$header-resizable-hover-border-top: $header-resizable-hover;
$header-resizable-hover-width: 4px;
$header-resizable-hover-border-radius: 8px;
$header-resizable-hover-right: 0;
$header-resizable-hover-opacity: 0.5;
$container-border-top: 1px solid #ccc;
$container-border-bottom: 1px solid #ccc;
$container-border-left: 0px solid #ccc;
$container-border-right: 0px solid #ccc;
$icon-sort-asc: "\F005D";
$icon-sort-desc: "\F0045";
$icon-sort-color: $primary-color;
$icon-sort-font-size: 13px;
$icon-sort-position-right: 12px;
$checkbox-selector-checked-color: #0070d2;
$checkbox-selector-unchecked-color: #b5b5b5;
$checkbox-selector-size: 19px;
$checkbox-selector-icon-font-weight: normal;
$checkbox-selector-icon-checked: "\F0C52";
$checkbox-selector-icon-unchecked: "\F0131";
$checkbox-selector-opacity: 1;
$checkbox-selector-opacity-hover: 0.9;
$cell-menu-icon-margin-right: 6px;
$column-picker-checkbox-size: 18px;
$column-picker-checkbox-font-weight: normal;
$column-picker-checkbox-icon-checked: "\F012c";
$column-picker-checkbox-icon-unchecked: "\F012c";
$column-picker-checkbox-width: 18px;
$column-picker-title-font-size: 18px;
$context-menu-item-font-size: 16px;
$context-menu-icon-font-size: 16px;
$icon-group-collapsed: "\F0142";
$icon-group-expanded: "\F0140";
$icon-group-font-weight: normal;
$icon-group-margin-right: 8px;
$draggable-group-drop-width: 100%;
$draggable-group-drop-radius: 0;
$draggable-group-toggle-collapsed-icon: "\F0142";
$draggable-group-toggle-expanded-icon: "\F0140";
$draggable-group-title-height: 24px;
$draggable-group-title-line-height: 24px;
$draggable-group-title-vertical-align: top;
$grid-menu-checkbox-size: 18px;
$grid-menu-checkbox-font-weight: normal;
$grid-menu-checkbox-icon-checked: "\F012c";
$grid-menu-checkbox-icon-unchecked: "\F012c";
$grid-menu-checkbox-width: 18px;
$grid-menu-icon-font-size: 20px;
$grid-menu-icon-width: 20px;
$grid-menu-title-font-size: 18px;
$header-menu-button-icon-font-size: 26px;
$header-menu-icon-font-size: 18px;
$header-menu-icon-width: 18px;
$header-menu-button-icon: "\F0140";
$header-menu-button-margin-right: 6px;
$header-menu-display: inline-block;
$multiselect-icon-arrow-down: "\F035D";
$multiselect-icon-arrow-up: "\F0360";
$multiselect-icon-arrow-font-size: $icon-font-size - 4px;
$multiselect-icon-checked: "\F0132";
$multiselect-icon-unchecked: "\F0131";
$multiselect-icon-radio-checked: "\F043E";
$multiselect-icon-radio-unchecked: "\F0130";
$multiselect-icon-search: "\F0349";
$multiselect-unchecked-opacity: 0.8;
$row-move-plugin-cursor: grab;
$row-move-plugin-icon: "\F0278";
$slider-editor-height: 26px;
$row-selected-color: darken($cell-odd-background-color, 7%);
$row-mouse-hover-color: rgba(128, 183, 231, 0.1);

@import './slick-without-bootstrap-min-styling';
@import './slick-grid';
@import './slick-controls';
@import './slick-editors';
@import './slick-plugins';
@import './slick-default-theme';
@import './slick-pagination';
@import './slick-footer';
@import './slickgrid-examples';
@import './slick-bootstrap';
@import './bootstrap-jquery-ui-autocomplete';

$link-color: $primary-color;

.cell-effort-driven {
text-align: center;
}

.editable-field {
background-color: #e3f0fb !important;
}
.fake-hyperlink {
cursor: pointer;
color: $link-color;
&:hover {
text-decoration: underline;
}
}

0 comments on commit 3b62101

Please sign in to comment.