diff --git a/app/assets/images/favicon-16.png b/app/assets/images/favicon-16.png index 0ebf0087e..93a5b366d 100644 Binary files a/app/assets/images/favicon-16.png and b/app/assets/images/favicon-16.png differ diff --git a/app/assets/images/favicon-32.png b/app/assets/images/favicon-32.png index 868ea6dc1..5778c9c11 100644 Binary files a/app/assets/images/favicon-32.png and b/app/assets/images/favicon-32.png differ diff --git a/app/assets/images/favicon-48.png b/app/assets/images/favicon-48.png index 0a9b0b8ba..914184cc9 100644 Binary files a/app/assets/images/favicon-48.png and b/app/assets/images/favicon-48.png differ diff --git a/app/assets/images/favicon.ico b/app/assets/images/favicon.ico index 1354303b0..87f76573c 100644 Binary files a/app/assets/images/favicon.ico and b/app/assets/images/favicon.ico differ diff --git a/app/assets/javascripts/projects/canvas.js.erb b/app/assets/javascripts/projects/canvas.js.erb index bee3df49e..902d4b7a3 100644 --- a/app/assets/javascripts/projects/canvas.js.erb +++ b/app/assets/javascripts/projects/canvas.js.erb @@ -496,6 +496,10 @@ function animateReposition(el, left, top) { function bindModeChange() { var buttons = $('#diagram-buttons').find("a[type='button']"); + $('.change-canvas-view').off().on('click', '.sci-toggle-item', function() { + $(this).next().click(); + }) + buttons.on('click', function() { var action = $(this).data("action"); diff --git a/app/assets/javascripts/projects/index.js b/app/assets/javascripts/projects/index.js index 727be409b..76bed9eef 100644 --- a/app/assets/javascripts/projects/index.js +++ b/app/assets/javascripts/projects/index.js @@ -510,16 +510,20 @@ } function initProjectsViewModeSwitch() { - $('input[name=projects-view-mode-selector]').off().on('change', function() { - if ($(this).val() === projectsViewMode) { - return; - } - projectsViewMode = $(this).val(); - if (projectsChanged) { - refreshCurrentView(); - } - projectsChanged = false; - }); + $('input[name=projects-view-mode-selector]').off() + .on('change', function() { + if ($(this).val() === projectsViewMode) { + return; + } + projectsViewMode = $(this).val(); + if (projectsChanged) { + refreshCurrentView(); + } + projectsChanged = false; + }) + .on('click', function() { + $(this).next().click(); + }); } function initSorting() { diff --git a/app/assets/javascripts/sidebar_toggle.js.erb b/app/assets/javascripts/sidebar_toggle.js.erb index 827a8d9a9..104c19882 100644 --- a/app/assets/javascripts/sidebar_toggle.js.erb +++ b/app/assets/javascripts/sidebar_toggle.js.erb @@ -7,7 +7,7 @@ $('#wrapper').removeClass('hidden2'); $('#wrapper').css('paddingLeft', '280px'); $('.navbar-secondary').css( - { 'margin-left': '-280px', 'padding-left': '294px' } + { 'margin-left': '-280px', 'padding-left': '280px' } ); $('#sidebar-arrow').attr('data-shown', ''); sessionStorage.setItem(STORAGE_TOGGLE_KEY, "un-toggled"); @@ -18,7 +18,7 @@ $('#wrapper').css('paddingLeft', '0'); $('.navbar-secondary').css({ 'margin-left': '0', - 'padding-left': '14px' + 'padding-left': '0' }); $('#sidebar-arrow').removeAttr('data-shown'); sessionStorage.setItem(STORAGE_TOGGLE_KEY, "toggled"); diff --git a/app/assets/javascripts/sitewide/avatar_modal.js b/app/assets/javascripts/sitewide/avatar_modal.js index 893ed0c64..c7906e665 100644 --- a/app/assets/javascripts/sitewide/avatar_modal.js +++ b/app/assets/javascripts/sitewide/avatar_modal.js @@ -31,7 +31,7 @@ var avatarsModal = (function() { reader.readAsDataURL(inputField.files[0]); reader.onload = function() { var avatarContainer = $(modal).find('.avatar-preview-container'); - $(modal).find('.save-button').removeClass('disabled'); + $(modal).find('.save-button').attr('disabled', false); $(modal).find('#new_avatar').val(reader.result); avatarContainer.show().children().remove(); @@ -50,7 +50,7 @@ var avatarsModal = (function() { function initPredefinedAvatars() { $(modal).find('.avatar-collection .avatar').click(function() { - $(modal).find('.save-button').removeClass('disabled'); + $(modal).find('.save-button').attr('disabled', false); $(modal).find('#raw_avatar')[0].value = null; $(modal).find('.avatar-preview-container').hide(); $(modal).find('.current-avatar').show().find('img') @@ -61,9 +61,9 @@ var avatarsModal = (function() { function initUpdateButton() { $(modal).find('.save-button').click(function() { - if ($(this).hasClass('disabled')) return; + if ($(this).is('[disabled=disabled]')) return; - $(this).addClass('disabled'); + $(this).attr('disabled', true); $.ajax({ url: $(modal).data('update-url'), type: 'PUT', @@ -76,7 +76,7 @@ var avatarsModal = (function() { location.reload(); }, error: () => { - $(this).removeClass('disabled'); + $(this).attr('disabled', false); } }); }); diff --git a/app/assets/javascripts/sitewide/comments.js b/app/assets/javascripts/sitewide/comments.js index 45e4a3ef9..26159335f 100644 --- a/app/assets/javascripts/sitewide/comments.js +++ b/app/assets/javascripts/sitewide/comments.js @@ -65,6 +65,7 @@ var Comments = (function() { $el.find('textarea'), $el.find('.new-comment-button') ); + $el.find('textarea').focus().blur(); $el.find('.new-comment-button').off('click').click(() => { var errorField = $el.find('.new-message-error'); var newButton = this; diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 76b39c9c1..3a28a9d3e 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,27 +1,36 @@ /* *= require highlightjs-github-theme *= require_self - *= require_tree . *= require jquery-ui/draggable *= require rails_bootstrap_forms *= require bootstrap-select - *= require constants *= stub reports_pdf */ +@import "shared_styles/constants/*"; + @import "constants"; + @import "bootstrap-sprockets"; @import "bootstrap"; @import "bootstrap-datetimepicker"; @import "bootstrap-colorselector"; @import "bootstrap-tagsinput"; @import "bootstrap-tagsinput-typeahead"; + +@import "shared_styles/elements/*"; + @import "handsontable.full.min"; @import "ajax-bootstrap-select.min"; @import "extend/bootstrap"; -@import "themes/scinote"; -@import "extend/perfect-scrollbar"; +@import "extend/*"; +@import "hooks/*"; +@import "partials/*"; @import "my_modules/protocols/*"; @import "my_modules/results/*"; @import "protocols/*"; -@import "hooks/*"; +@import "settings/*"; +@import "shared/*"; +@import "themes/*"; + +@import "*" diff --git a/app/assets/stylesheets/constants.scss b/app/assets/stylesheets/constants.scss index d9fb728de..4d0eb4083 100644 --- a/app/assets/stylesheets/constants.scss +++ b/app/assets/stylesheets/constants.scss @@ -5,7 +5,7 @@ //============================================================================== // Grayscale colors -$color-white: #fff; +/*$color-white: #fff; $color-alabaster: #fcfcfc; $color-concrete: #f2f2f2; $color-gainsboro: #e3e3e3; @@ -41,7 +41,7 @@ $office-ms-powerpoint: #d24726; // MarvinJS color: $marvinjs-color: #29999c; - +*/ //============================================================================== // Other //============================================================================== @@ -62,14 +62,14 @@ $gray-light: $color-dove-gray; $gray-lighter: $color-concrete; // Scaffolding -$body-bg: $color-concrete; -$text-color: $color-emperor; -$link-color: $brand-primary; -$link-hover-color: darken($link-color, 15%); -$link-hover-decoration: underline; +// $body-bg: $color-concrete; +// $text-color: $color-emperor; +// $link-color: $brand-primary; +// $link-hover-color: darken($link-color, 15%); +// $link-hover-decoration: underline; // Typography -$font-family-lato: Lato, "Open Sans", Arial, Helvetica, sans-serif; +/*$font-family-lato: Lato, "Open Sans", Arial, Helvetica, sans-serif; $font-family-sans-serif: "Open Sans", Arial, Helvetica, sans-serif; $font-family-serif: Georgia, "Times New Roman", Times, serif; $font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace; @@ -89,7 +89,7 @@ $line-height-computed: floor(($font-size-base * $line-height-base)); $headings-font-family: inherit; $headings-font-weight: 500; $headings-line-height: 1.1; -$headings-color: inherit; +$headings-color: inherit;*/ // Components $padding-base-vertical: 6px; @@ -125,17 +125,17 @@ $btn-default-color: $gray-dark; $btn-default-bg: $brand-default; $btn-default-border: $color-silver; $btn-primary-color: $color-white; -$btn-primary-bg: $brand-success; +$btn-primary-bg: $brand-primary; $btn-primary-border: darken($btn-primary-bg, 5%); $btn-primary-new-color: $color-white; -$btn-primary-new-bg: $brand-primary-new; -$btn-primary-new-border: darken($brand-primary-new, 5%); +$btn-primary-new-bg: $brand-primary; +$btn-primary-new-border: darken($brand-primary , 5%); $btn-success-color: $color-white; -$btn-success-bg: $brand-success; +$btn-success-bg: $brand-primary; $btn-success-border: darken($btn-success-bg, 5%); $btn-info-color: $color-white; -$btn-info-bg: $brand-info; -$btn-info-border: darken($btn-info-bg, 5%); +$btn-info-bg: $brand-primary; +$btn-info-border: $brand-primary; $btn-warning-color: $color-white; $btn-warning-bg: $brand-warning; $btn-warning-border: darken($btn-warning-bg, 5%); diff --git a/app/assets/stylesheets/extend/perfect-scrollbar.scss b/app/assets/stylesheets/extend/perfect-scrollbar.scss index cec47082b..6407a74e2 100644 --- a/app/assets/stylesheets/extend/perfect-scrollbar.scss +++ b/app/assets/stylesheets/extend/perfect-scrollbar.scss @@ -14,10 +14,10 @@ */ .ps__rail-x { display: none; - opacity: 0; transition: background-color .2s linear, opacity .2s linear; -webkit-transition: background-color .2s linear, opacity .2s linear; height: 16px; + opacity: 0.6; /* there must be 'bottom' or 'top' for ps__rail-x */ bottom: 0px; /* please don't change 'position' */ @@ -26,10 +26,10 @@ .ps__rail-y { display: none; - opacity: 0; transition: background-color .2s linear, opacity .2s linear; -webkit-transition: background-color .2s linear, opacity .2s linear; width: 16px; + opacity: 0.6; /* there must be 'right' or 'left' for ps__rail-y */ right: 0; /* please don't change 'position' */ @@ -80,10 +80,10 @@ .ps__thumb-y { background-color: $color-silver-chalice; - border-radius: 4px; + border-radius: 3px; transition: background-color .2s linear, width .2s ease-in-out; -webkit-transition: background-color .2s linear, width .2s ease-in-out; - width: 4px; + width: 6px; /* there must be 'right' for ps__thumb-y */ right: 2px; /* please don't change 'position' */ @@ -93,15 +93,13 @@ .ps__rail-x:hover > .ps__thumb-x, .ps__rail-x:focus > .ps__thumb-x, .ps__rail-x.ps--clicking .ps__thumb-x { - background-color: $brand-primary; - height: 12px; + height: 10px; } .ps__rail-y:hover > .ps__thumb-y, .ps__rail-y:focus > .ps__thumb-y, .ps__rail-y.ps--clicking .ps__thumb-y { - background-color: $brand-primary; - width: 12px; + width: 10px; } /* MS supports */ diff --git a/app/assets/stylesheets/global_activities.scss b/app/assets/stylesheets/global_activities.scss index e6a949b3b..1ef49cded 100644 --- a/app/assets/stylesheets/global_activities.scss +++ b/app/assets/stylesheets/global_activities.scss @@ -34,22 +34,6 @@ display: flex; height: 42px; - .hide-actions { - align-items: center; - color: $color-silver-chalice; - display: flex; - margin-right: 20px; - - &:hover { - text-decoration: none; - } - - .fas { - font-size: 18px; - margin-right: 5px; - } - } - .ga-search-container { display: none; flex-grow: 1; diff --git a/app/assets/stylesheets/marvinjs.scss b/app/assets/stylesheets/marvinjs.scss index 92d1a2da7..918b8016a 100644 --- a/app/assets/stylesheets/marvinjs.scss +++ b/app/assets/stylesheets/marvinjs.scss @@ -140,6 +140,7 @@ } .new-marvinjs-upload-button { + padding: 2px 16px; .new-marvinjs-upload-icon { display: inline-block; diff --git a/app/assets/stylesheets/my_modules/protocols/index.scss b/app/assets/stylesheets/my_modules/protocols/index.scss index 8e9736d33..d5a76bf33 100644 --- a/app/assets/stylesheets/my_modules/protocols/index.scss +++ b/app/assets/stylesheets/my_modules/protocols/index.scss @@ -259,6 +259,7 @@ .my-module-recent-protocols { flex-grow: 1; + height: 36px; margin-bottom: 5px; position: relative; diff --git a/app/assets/stylesheets/my_modules/results/index.scss b/app/assets/stylesheets/my_modules/results/index.scss index 9fe221dc4..5d8714ee0 100644 --- a/app/assets/stylesheets/my_modules/results/index.scss +++ b/app/assets/stylesheets/my_modules/results/index.scss @@ -8,10 +8,14 @@ #results-toolbar { .help_tooltips { - .btn-default { - border: 0; - color: inherit; - margin-left: 10px; + align-items: center; + display: flex; + + .add-result-text { + display: inline-block; + line-height: 36px; + margin-bottom: 5px; + margin-right: 5px; } } } diff --git a/app/assets/stylesheets/partials/_sidebar.scss b/app/assets/stylesheets/partials/_sidebar.scss index f3eed2ba0..3b0fadb98 100644 --- a/app/assets/stylesheets/partials/_sidebar.scss +++ b/app/assets/stylesheets/partials/_sidebar.scss @@ -26,7 +26,7 @@ $toggle-btn-size: 50px; border-bottom-right-radius: 10px; border-top-right-radius: 10px; bottom: 50%; - box-shadow: 2px 0 4px $color-alto; + box-shadow: $flyout-shadow; display: block; position: absolute; right: -18px; @@ -54,7 +54,7 @@ $toggle-btn-size: 50px; #sidebar-wrapper { background-color: $color-white; - box-shadow: 1px 3px 6px $color-alto; + box-shadow: $flyout-shadow; height: 100%; margin-left: -$wrapper-width; position: fixed; diff --git a/app/assets/stylesheets/projects.scss b/app/assets/stylesheets/projects.scss index 4c43691c9..a7859d1b9 100644 --- a/app/assets/stylesheets/projects.scss +++ b/app/assets/stylesheets/projects.scss @@ -40,7 +40,7 @@ $color-module-hover: $brand-primary; } .projects-view-mode-switch { - margin: 10px; + margin: 8px 10px 12px; } } @@ -48,26 +48,38 @@ $color-module-hover: $brand-primary; /* Canvas index page */ #canvas-container:not(.canvas-container-edit-mode) { - margin-top: 20px; + margin-top: 5px; } /********************************** * jsPlumb CANVAS RELATED STYLING * *********************************/ #diagram-buttons { - margin-bottom: 10px; + align-items: center; + display: flex; + + #edit-canvas-button { + margin-right: 5px; + } + + .actions-button { + margin-right: 15px; + } + + .toolbarButtons { + align-items: center; + display: flex; + + .zoom-text { + margin-right: 5px; + } + } } #update-canvas { - #canvas-new-module { - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - } - .btn-group > .btn:first-child { - border-bottom-left-radius: 0; - } - .btn-group > .btn:last-child { - border-bottom-right-radius: 0; + + .canvas-header { + margin-bottom: 5px; } } @@ -552,9 +564,9 @@ li.module-hover { } .experiment-no-description { + @include font-h3; color: $color-alto; display: block; - font-size: $font-size-large; font-weight: bold; margin-top: 10px; text-align: center; diff --git a/app/assets/stylesheets/protocol_management.scss b/app/assets/stylesheets/protocol_management.scss index a11303793..67573f78c 100644 --- a/app/assets/stylesheets/protocol_management.scss +++ b/app/assets/stylesheets/protocol_management.scss @@ -226,6 +226,7 @@ align-items: center; display: flex; height: 30px; + margin-top: 5px; .info-line.button { flex-grow: 1; @@ -355,15 +356,6 @@ } } - .external-import-btn { - background-color: $brand-primary; - border: 0; - color: $color-white; - font-size: 12px; - padding-bottom: 3px; - padding-top: 3px; - } - .footer { background: $color-white; bottom: -30px; diff --git a/app/assets/stylesheets/reports.scss b/app/assets/stylesheets/reports.scss index 91a2ea303..2acec9c31 100644 --- a/app/assets/stylesheets/reports.scss +++ b/app/assets/stylesheets/reports.scss @@ -12,7 +12,6 @@ border-bottom: 1px solid $color-gainsboro; border-left: 0; border-right: 0; - border-top: 15px solid $color-concrete; margin-bottom: 15px; min-width: 320px; padding: 25px 20px; diff --git a/app/assets/stylesheets/shared/comments.scss b/app/assets/stylesheets/shared/comments.scss index 2961d4915..93356a7db 100644 --- a/app/assets/stylesheets/shared/comments.scss +++ b/app/assets/stylesheets/shared/comments.scss @@ -220,6 +220,7 @@ border: 1px solid transparent; box-shadow: none; outline: none; + overflow: hidden; width: 100%; &:focus { diff --git a/app/assets/stylesheets/shared_styles/constants/borders.scss b/app/assets/stylesheets/shared_styles/constants/borders.scss new file mode 100644 index 000000000..e62e938ec --- /dev/null +++ b/app/assets/stylesheets/shared_styles/constants/borders.scss @@ -0,0 +1,13 @@ +@import "colors"; + +$border-radius-default: 4px; +$border-radius-modal: 6px; +$border-radius-tag: 2px; + +$border-default: 1px solid $color-silver-chalice; +$border-secondary: 1px solid $color-volcano; +$border-tertiary: 1px solid $color-alto; + +$border-focus: 1px solid $brand-focus; +$border-danger: 1px solid $brand-danger; +$border-transparent: 1px solid transparent; diff --git a/app/assets/stylesheets/shared_styles/constants/colors.scss b/app/assets/stylesheets/shared_styles/constants/colors.scss new file mode 100644 index 000000000..d8cab82b5 --- /dev/null +++ b/app/assets/stylesheets/shared_styles/constants/colors.scss @@ -0,0 +1,55 @@ +// Grayscale colors +$color-white: #fff; +$color-concrete: #f0f0f6; +$color-alto: #d0d0d8; +$color-silver-chalice: #a0a0a8; +$color-volcano: #404048; +$color-black: #231f20; + + + +// Theme colors +$brand-primary: #104da9; +$brand-primary-hover: #0c3a80; +$brand-primary-press: #07244f; + +$brand-academy: #a52068; +$brand-academy-dark: #8c1b58; + +$brand-focus: #609fff; +$brand-focus-light: #dfecff; + +$brand-success: #2dbe61; +$brand-success-light: #cbefd7; + +$brand-danger: #e72525; +$brand-danger-hover: #b21d1d; +$brand-danger-press: #801515; +$brand-danger-light: #f9c9c9; + +$brand-warning: #f0ad4e; +$brand-warning-light: #fbebd3; + +// MS Office colors: +$office-ms-word: #2b579a; +$office-ms-excel: #217346; +$office-ms-powerpoint: #d24726; + +// MarvinJS color: +$marvinjs-color: #29999c; + + + +// Don't use them +$color-alabaster: $color-concrete; +$color-gainsboro: $color-concrete; +$color-silver: $color-alto; +$color-dove-gray: $color-volcano; +$color-emperor: $color-volcano; +$brand-default: $color-white; +$brand-info: $brand-focus; +$brand-other: $brand-success; +$brand-extra: $brand-focus; +$brand-primary-light: $brand-focus-light; +$brand-light-blue: $brand-focus-light; + diff --git a/app/assets/stylesheets/shared_styles/constants/fonts.scss b/app/assets/stylesheets/shared_styles/constants/fonts.scss new file mode 100644 index 000000000..1a156e6bd --- /dev/null +++ b/app/assets/stylesheets/shared_styles/constants/fonts.scss @@ -0,0 +1,67 @@ +$font-family-lato: Lato, "Open Sans", Arial, Helvetica, sans-serif; +$font-family-sans-serif: "Open Sans", Arial, Helvetica, sans-serif; +$font-family-serif: Georgia, "Times New Roman", Times, serif; +$font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace; +$font-family-base: $font-family-lato; +$font-family-icons: "Font Awesome 5 Free"; +$font-size-base: 16px; + +$font-size-h1: 24px; +$font-size-h2: 18px; +$font-size-h3: $font-size-base; +$font-size-h4: $font-size-base; +$font-size-h5: $font-size-base; +$font-size-h6: $font-size-base; + +$font-fas-check: "\f00c"; +$font-fas-exclamation-triangle: "\f071"; + +@mixin font-h1 { + font-size: 24px; + font-weight: bold; +} + +@mixin font-h2 { + font-size: 18px; + font-weight: bold; +} + +@mixin font-h3 { + font-size: $font-size-base; + font-weight: bold; +} + +@mixin font-main { + font-size: $font-size-base; +} + +@mixin font-button { + font-size: 14px; +} + +@mixin font-small { + font-size: 12px; +} + +@mixin font-awesome { + font-family: "Font Awesome 5 Free"; + font-weight: 501; +} + + + + +// $font-size-large: ceil(($font-size-base * 1.1)); //16px +// $font-size-small: ceil(($font-size-base * .9)); //13px +// $font-size-h1: floor(($font-size-base * 2.6)); //36px +// $font-size-h2: floor(($font-size-base * 2.15)); //30px +// $font-size-h3: ceil(($font-size-base * 1.7)); //24px +// $font-size-h4: ceil(($font-size-base * 1.25)); //18px +// $font-size-h5: $font-size-base; //14px +// $font-size-h6: ceil(($font-size-base * .85)); //12px +// $line-height-base: 1.428571429; +// $line-height-computed: floor(($font-size-base * $line-height-base)); +// $headings-font-family: inherit; +// $headings-font-weight: 500; +// $headings-line-height: 1.1; +// $headings-color: inherit; diff --git a/app/assets/stylesheets/shared_styles/constants/shadows.scss b/app/assets/stylesheets/shared_styles/constants/shadows.scss new file mode 100644 index 000000000..a345c116e --- /dev/null +++ b/app/assets/stylesheets/shared_styles/constants/shadows.scss @@ -0,0 +1,2 @@ +$flyout-shadow: 0px 1px 4px rgba(35, 31, 32, 0.15); +$modal-shadow: 0px 4px 16px rgba(35, 31, 32, 0.15); \ No newline at end of file diff --git a/app/assets/stylesheets/shared_styles/constants/transition.scss b/app/assets/stylesheets/shared_styles/constants/transition.scss new file mode 100644 index 000000000..689148746 --- /dev/null +++ b/app/assets/stylesheets/shared_styles/constants/transition.scss @@ -0,0 +1,4 @@ +$timing-function-deceleration: cubic-bezier(0, 0, .2, 1) !default; +$timing-function-standard: cubic-bezier(.4, 0, .2, 1) !default; +$timing-function-acceleration: cubic-bezier(.4, 0, 1, 1) !default; +$timing-function-sharp: cubic-bezier(.4, 0, .6, 1) !default; diff --git a/app/assets/stylesheets/shared_styles/elements/buttons.scss b/app/assets/stylesheets/shared_styles/elements/buttons.scss new file mode 100644 index 000000000..9b38b4736 --- /dev/null +++ b/app/assets/stylesheets/shared_styles/elements/buttons.scss @@ -0,0 +1,170 @@ +// scss-lint:disable NestingDepth + +.btn{ + @include font-button; + animation-timing-function: $timing-function-sharp; + border-radius: $border-radius-default; + cursor: pointer; + display: inline-block; + line-height: 20px; + outline: 0; + padding: 7px 16px; + position: relative; + text-align: center; + text-decoration: none; + transition: .3s; + user-select: none; + + .fas { + color: inherit; + margin-right: 5px; + } + + &:hover { + text-decoration: none; + } + + &:active { + text-decoration: none; + } + + &:focus { + outline: 0; + text-decoration: none; + } + + &.btn-primary { + background: $brand-primary; + border: 1px solid $brand-primary; + color: $color-white; + + &:hover { + background: $brand-primary-hover; + color: $color-white; + } + + &:active { + background: $brand-primary-press; + color: $color-white; + } + + &:focus { + box-shadow: 0 0 0 1px $brand-focus; + color: $color-white; + } + } + + &.btn-secondary { + background: $color-white; + border: $border-default; + color: $color-black; + + &:hover { + background: $color-concrete; + border: $border-secondary; + color: $color-black; + } + + &:active { + background: $color-alto; + border: $border-secondary; + color: $color-black; + } + + &:focus { + box-shadow: 0 0 0 1px $brand-focus; + color: $color-black; + } + } + + &.btn-light { + background: transparent; + border: $border-transparent; + color: $color-black; + + &:hover { + background: $color-concrete; + border: $border-transparent; + color: $color-black; + } + + &:active { + background: $color-alto; + border: $border-transparent; + color: $color-black; + } + + &:focus { + box-shadow: 0 0 0 1px $brand-focus; + color: $color-black; + } + } + + &.btn-danger { + background: $brand-danger; + border: $border-danger; + color: $color-white; + + &:hover { + background: $brand-danger-hover; + color: $color-white; + } + + &:active { + background: $brand-danger-press; + color: $color-white; + } + + &:focus { + box-shadow: 0 0 0 1px $brand-focus; + color: $color-white; + } + } + + &.icon-btn { + padding: 7px; + width: 36px; + + .fas { + margin: 0; + } + } + + &:disabled { + background: $color-alto; + border: $border-tertiary; + color: $color-silver-chalice; + opacity: .5; + + &.btn-secondary, + &.btn-light { + background: $color-white; + + &:hover { + background: $color-white; + border: $border-tertiary; + color: $color-silver-chalice; + } + } + + &.btn-danger { + &:hover { + background: $color-alto; + } + } + } +} + +.sci-btn-group { + display: inline-block; + position: relative; + + .btn { + float: left; + margin: 2px 4px 2px 0; + + &:nth-last-child(1) { + margin-right: 0; + } + } +} diff --git a/app/assets/stylesheets/shared_styles/elements/checkboxes.scss b/app/assets/stylesheets/shared_styles/elements/checkboxes.scss new file mode 100644 index 000000000..c7cee3baa --- /dev/null +++ b/app/assets/stylesheets/shared_styles/elements/checkboxes.scss @@ -0,0 +1,63 @@ +// scss-lint:disable SelectorDepth QualifyingElement + +:root { + --sci-checkbox-size: 16px; +} + +input[type="checkbox"].sci-checkbox { + cursor: pointer; + flex-shrink: 0; + height: var(--sci-checkbox-size); + margin: 0; + opacity: 0; + position: relative; + width: var(--sci-checkbox-size); + z-index: 2; + + + .sci-checkbox-label { + display: inline-block; + flex-shrink: 0; + height: var(--sci-checkbox-size); + margin-left: calc((var(--sci-checkbox-size) * -1) - 3px); + position: relative; + width: var(--sci-checkbox-size); + + &::before { + @include font-awesome; + animation-timing-function: $timing-function-sharp; + background: $color-white; + border: $border-default; + border-radius: 1px; + color: $color-white; + content: ""; + font-size: calc(var(--sci-checkbox-size) - var(--sci-checkbox-size) * .375); + height: var(--sci-checkbox-size); + left: 0; + line-height: calc(var(--sci-checkbox-size) - 2px); + position: absolute; + text-align: center; + top: 1px; + transition: .2s; + width: var(--sci-checkbox-size); + } + } + + &.hidden + .sci-checkbox-label { + display: none; + } + + &:checked + .sci-checkbox-label { + &::before { + background: $brand-primary; + border: 1px solid $brand-primary; + content: $font-fas-check; + } + } + + &:disabled + .sci-checkbox-label { + &::before { + background: $color-alto; + border: $border-tertiary; + } + } +} diff --git a/app/assets/stylesheets/shared_styles/elements/input_fields.scss b/app/assets/stylesheets/shared_styles/elements/input_fields.scss new file mode 100644 index 000000000..c86571b5d --- /dev/null +++ b/app/assets/stylesheets/shared_styles/elements/input_fields.scss @@ -0,0 +1,132 @@ +// scss-lint:disable NestingDepth + +.sci-input-container { + display: inline-block; + position: relative; + + label { + @include font-small; + display: inline-block; + font-weight: bold; + margin-bottom: 5px; + } + + .sci-input-field { + @include font-button; + animation-timing-function: $timing-function-sharp; + border: $border-default; + border-radius: $border-radius-default; + height: 36px; + outline: 0; + padding: 0 0 0 10px; + transition: .3s; + width: 100%; + + &:focus { + border: $border-focus; + } + + &:disabled { + background: transparent; + } + } + + .fas { + bottom: 0; + line-height: 36px; + position: absolute; + text-align: center; + width: 25px; + } + + &.left-icon { + .sci-input-field { + padding: 0 0 0 30px; + } + + .fas { + left: 5px; + } + } + + &.right-icon { + .sci-input-field { + padding: 0 30px 0 10px; + } + + .fas { + right: 5px; + } + } + + &.success, + &.error { + .sci-input-field { + padding: 0 30px 0 10px; + } + + &::after { + @include font-awesome; + bottom: 0; + line-height: 36px; + position: absolute; + right: 5px; + text-align: center; + width: 25px; + } + + &.right-icon { + .sci-input-field { + padding: 0 60px 0 10px; + } + + &::after { + right: 35px; + } + } + } + + &.success { + &::after { + color: $brand-success; + content: $font-fas-check; + } + } + + &.error { + .sci-input-field { + border: $border-danger; + } + + &::after { + color: $brand-danger; + content: $font-fas-exclamation-triangle; + } + + &::before { + @include font-small; + bottom: -15px; + color: $brand-danger; + content: attr(data-error-text); + left: 0; + line-height: 15px; + position: absolute; + width: 100%; + } + } + + &.disabled { + label { + color: $color-alto; + } + + .sci-input-field { + border: $border-tertiary; + color: $color-alto; + + &::placeholder { + color: inherit; + } + } + } +} diff --git a/app/assets/stylesheets/shared_styles/elements/radio_buttons.scss b/app/assets/stylesheets/shared_styles/elements/radio_buttons.scss new file mode 100644 index 000000000..706e8a12e --- /dev/null +++ b/app/assets/stylesheets/shared_styles/elements/radio_buttons.scss @@ -0,0 +1,81 @@ +// scss-lint:disable SelectorDepth QualifyingElement + +:root { + --sci-radio-size: 16px; +} + +input[type="radio"].sci-radio { + cursor: pointer; + flex-shrink: 0; + height: var(--sci-radio-size); + margin: 0; + opacity: 0; + position: relative; + width: var(--sci-radio-size); + z-index: 2; + + + .sci-radio-label { + display: inline-block; + flex-shrink: 0; + height: var(--sci-radio-size); + margin-left: calc((var(--sci-radio-size) * -1) - 3px); + position: relative; + width: var(--sci-radio-size); + + &::before { + animation-timing-function: $timing-function-sharp; + border: $border-default; + border-radius: 50%; + color: $color-white; + content: ""; + font-size: calc(var(--sci-radio-size) - var(--sci-radio-size) * .375); + height: var(--sci-radio-size); + left: 0; + line-height: calc(var(--sci-radio-size) - 2px); + position: absolute; + text-align: center; + top: 1px; + transition: .2s; + width: var(--sci-radio-size); + } + + &::after { + animation-timing-function: $timing-function-sharp; + background: $color-white; + border-radius: 50%; + content: ""; + display: inline-block; + height: calc(var(--sci-radio-size) - 6px); + left: 3px; + position: absolute; + top: 4px; + transition: .2s; + width: calc(var(--sci-radio-size) - 6px); + } + } + + &.hidden + .sci-radio-label { + display: none; + } + + &:checked + .sci-radio-label { + &::before { + border: 1px solid $brand-primary; + } + + &::after { + background: $brand-primary; + } + } + + &:disabled + .sci-radio-label { + &::before { + background: $color-alto; + border: $border-tertiary; + } + + &::after { + display: none; + } + } +} diff --git a/app/assets/stylesheets/shared_styles/elements/toggles.scss b/app/assets/stylesheets/shared_styles/elements/toggles.scss new file mode 100644 index 000000000..e95ae09c6 --- /dev/null +++ b/app/assets/stylesheets/shared_styles/elements/toggles.scss @@ -0,0 +1,104 @@ +// scss-lint:disable SelectorDepth QualifyingElement NestingDepth + +input[type="checkbox"].sci-toggle-checkbox { + cursor: pointer; + flex-shrink: 0; + height: 16px; + margin: 0; + opacity: 0; + position: relative; + width: 24px; + z-index: 2; + + + .sci-toggle-checkbox-label { + animation-timing-function: $timing-function-sharp; + background: $color-alto; + border-radius: 8px; + display: inline-block; + flex-shrink: 0; + height: 16px; + margin-left: -27px; + position: relative; + transition: .2s; + width: 24px; + + &::before { + animation-timing-function: $timing-function-sharp; + background: $color-white; + border-radius: 7px; + content: ""; + height: 12px; + left: 0; + margin: 2px; + position: absolute; + transition: .2s; + width: 12px; + } + } + + &.hidden + .sci-toggle-checkbox-label { + display: none; + } + + &:checked + .sci-toggle-checkbox-label { + background: $brand-primary; + + &::before { + left: 8px; + } + } + + &:disabled + .sci-toggle-checkbox-label { + + &::before { + background: $color-silver-chalice; + } + } +} + +.sci-toggles-group { + align-items: center; + display: flex; + position: relative; + + input[type="radio"].sci-toggle-item { + cursor: pointer; + height: 36px; + margin: 0; + opacity: 0; + position: relative; + width: 48px; + z-index: 2; + + + .sci-toggle-item-label { + animation-timing-function: $timing-function-sharp; + background: $color-white; + border: $border-default; + border-left-color: transparent; + color: $color-black; + display: inline-block; + height: 36px; + line-height: 34px; + margin-left: -48px; + position: relative; + text-align: center; + transition: .2s; + width: 48px; + + &:first-of-type { + border-left-color: $color-silver-chalice; + border-radius: $border-radius-default 0 0 $border-radius-default; + } + + &:last-of-type { + border-radius: 0 $border-radius-default $border-radius-default 0; + } + } + + &:checked + .sci-toggle-item-label { + background: $brand-primary; + border: 1px solid $brand-primary; + color: $color-white; + } + } +} diff --git a/app/assets/stylesheets/shared_styles/global_elements.scss b/app/assets/stylesheets/shared_styles/global_elements.scss new file mode 100644 index 000000000..5bfab7225 --- /dev/null +++ b/app/assets/stylesheets/shared_styles/global_elements.scss @@ -0,0 +1,82 @@ +// scss-lint:disable Comment + +@import "constants/*"; +@import "elements/*"; + +// Examples + +/* + +