diff --git a/addons/website/static/src/scss/website.wysiwyg.scss b/addons/website/static/src/scss/website.wysiwyg.scss index a4d8cea8729..d3fb73c5591 100644 --- a/addons/website/static/src/scss/website.wysiwyg.scss +++ b/addons/website/static/src/scss/website.wysiwyg.scss @@ -1,84 +1,11 @@ +//------------------------------------------------------------------------------ +// Modifications applied on normal website DOM while being in the editor. +//------------------------------------------------------------------------------ + body.editor_enable { overflow: hidden; padding-top: 0 !important; - // TOP BAR (EDIT) - #web_editor-top-edit { - height: $o-navbar-height; - background-color: $o-we-color-dark; - z-index: $zindex-modal - 9; - position: fixed; - top: 0px; - right: 0px; - width: auto; - white-space: nowrap; - - background-color: rgba(0, 0, 0, 0); - transition: background-color 400ms $o-we-md-ease 0s; - font-family: $o-we-font-family; - - form.navbar-form { - height: $o-navbar-height; - z-index: 1060; - margin: 0; - padding: 0; - position: absolute; - top: -1px; - right: 0; - transition: right 0.4s $o-we-md-ease 0s; - border-left: 1px solid $o-we-color-divider; - background-color: inherit; - - .btn-group { - height: 100%; - } - - .btn { - height: 100%; - margin: 0; - padding: 10px; - line-height: 1.2; - font-size: 13px; - font-family: $o-we-font-family; - - transition: all 0.3s ease 0s; - border: none; - border-radius: 0; - - .fa { - margin-right: $grid-gutter-width/4; - - &.fa-times { - color: $o-we-color-danger; - } - } - - &.btn-primary { - @include button-variant($o-brand-odoo, $o-brand-odoo); - } - - &.btn-secondary { - @include button-variant($o-we-color-dark, $o-we-color-dark); - - &:hover { - background: rgba(black, 0.5); - } - } - - &:focus, - &:active, - &:focus:active { - outline: none; - } - } - - .dropdown-menu { - left: auto; - right: 0; - } - } - } - #wrapwrap { height: calc(100vh - #{$o-navbar-height}); padding-top: 0px; @@ -87,555 +14,636 @@ body.editor_enable { -webkit-user-select: none; } } +} - // Translations - .oe_translate_examples li { - margin: 10px; - padding: 4px; - } +//------------------------------------------------------------------------------ +// Editor components style. +//------------------------------------------------------------------------------ - html[lang]>body.editor_enable [data-oe-translation-state] { - background: rgba($o-we-content-to-translate-color, 0.5) !important; +// TOP BAR (EDIT) +#web_editor-top-edit { + height: $o-navbar-height; + background-color: $o-we-color-dark; + z-index: $zindex-modal - 9; + position: fixed; + top: 0px; + right: 0px; + width: auto; + white-space: nowrap; - &[data-oe-translation-state="translated"] { - background: rgba($o-we-translated-content-color, 0.5) !important; + background-color: rgba(0, 0, 0, 0); + transition: background-color 400ms $o-we-md-ease 0s; + font-family: $o-we-font-family; + + form.navbar-form { + height: $o-navbar-height; + z-index: 1060; + margin: 0; + padding: 0; + position: absolute; + top: -1px; + right: 0; + transition: right 0.4s $o-we-md-ease 0s; + border-left: 1px solid $o-we-color-divider; + background-color: inherit; + + .btn-group { + height: 100%; } - &.o_dirty { - background: rgba($o-we-translated-content-color, 0.25) !important; - } - } - - // NOTE EDITOR - - // SNIPPET PANEL - #oe_snippets { - @include o-w-preserve-btn; - @include o-position-absolute(0, auto, 0, -$o-we-sidebar-width); - width: $o-we-sidebar-width; - - border-right: 1px solid $o-we-color-divider; - transition: left 400ms $o-we-md-ease 0s; - background-image: linear-gradient(45deg, $o-we-color-normal, darken($o-we-color-normal, 10%)); - - #snippets_menu { - color: #999999; - background: $o-we-color-dark; + .btn { + height: 100%; + margin: 0; + padding: 10px; + line-height: 1.2; + font-size: 13px; font-family: $o-we-font-family; - height: $o-navbar-height; - line-height: $o-navbar-height; - } - #o_scroll { - .o_panel_header { - color: #999999; - } - } - } + transition: all 0.3s ease 0s; + border: none; + border-radius: 0; - .oe_snippet { - background-color: $o-we-color-normal; + .fa { + margin-right: $grid-gutter-width/4; - .oe_snippet_thumbnail { - .oe_snippet_thumbnail_img { - border: 1px solid $o-we-color-normal; - } - - img.oe_snippet_thumbnail_img {} - - .oe_snippet_thumbnail_title { - border: 1px solid $o-we-color-dark; - color: $o-we-color-text-light; - } - - &:hover .oe_snippet_thumbnail_title { - color: $o-we-color-text-lighter; - } - } - } - - // SNIPPET OPTIONS - .colorpicker { - .o_colorpicker_sections { - .note-color-palette>div { - color: $o-we-color-text-light; - } - } - - .o_colorpicker_section { - &:after { - content: ""; - display: table; - clear: both; - } - - >button { - - &:hover, - &.selected { - box-shadow: 0px 0px 2px 2px $o-we-color-light; - } - - &[data-event="foreColor"] { - background-color: $o-we-color-normal; - - &:before { - background-color: rgba(white, 0.3); - } - } - } - } - - .note-palette-title { - color: $o-we-color-text-light; - } - - .palette-reset { - .note-color-reset { - color: desaturate(rgba($o-we-color-danger, 0.6), 40%); - - &:hover { + &.fa-times { color: $o-we-color-danger; } } - } - } - // DROPZONES - #wrapwrap .oe_drop_zone { - &.oe_insert { - height: $o-we-dropzone-size; - margin: (-$o-we-dropzone-size/2) 0; - - &:after { - border-bottom: $o-we-dropzone-border; + &.btn-primary { + @include button-variant($o-brand-odoo, $o-brand-odoo); } - &.oe_vertical { - width: $o-we-dropzone-size; - margin: 0 (-$o-we-dropzone-size/2); + &.btn-secondary { + @include button-variant($o-we-color-dark, $o-we-color-dark); - &:after { - border-right: $o-we-dropzone-border; - } - } - } - } - - // MANIPULATORS - #oe_manipulators { - - // SNIPPET MANIPULATORS - .oe_overlay { - - // OVERLAY OPTIONS - >.oe_overlay_options { - font-family: $o-we-font-family; - - >.btn-group { - .btn { - height: $o-we-overlay-option-size; - border: 1px solid $o-we-color-dark; - line-height: #{$o-we-overlay-option-size - 2px}; - - color: $o-we-color-text-light; - background-color: $o-we-color-light; - - &:hover { - background-color: lighten($o-we-color-dark, 10%); - } - - &.oe_snippet_remove { - background-color: $o-we-color-danger; - border-color: darken($o-we-color-danger, 20%); - - &:hover { - background-color: darken($o-we-color-danger, 20%); - } - } - - >.fa { - color: $o-we-color-text-light; - } - } - - // CUSTOMIZE MENU BUTTON - >.oe_options { - .btn { - background-color: $o-we-color-dark; - color: $o-we-color-text-light; - - &:hover, - &:active, - &:focus { - background-color: lighten($o-we-color-dark, 5%); - border-color: lighten($o-we-color-dark, 10%); - } - - &:before, - &:after { - background-color: $o-we-color-text-light; - } - } - - // Open menu - &.show .btn { - // background-color: $o-we-color-light; - } - - // CUSTOMIZE MENU - .dropdown-menu { - border: 1px solid $o-we-color-dark; - background-color: $o-we-color-light; - - .dropdown-item { - color: $o-we-color-text-light; - - &:hover { - background-color: fade-out($o-we-color-dark, 0.5); - } - - &.active { - background-color: fade-out($o-we-color-dark, 0.5); - } - } - - .dropdown-header { - color: wheat; - - &.o_parent_editor_header { - color: wheat; - } - } - - .dropdown-submenu { - &::before { - border-left-color: $o-we-color-text-light; - } - } - } - } + &:hover { + background: rgba(black, 0.5); } } - &.o_top_cover>.oe_overlay_options { - top: $o-we-handle-border-width; - right: $o-we-handle-border-width; - } - - } - } - - // Animations - @keyframes fadeInDownSmall { - 0% { - opacity: 0; - transform: translate(0, -5px); - } - - 100% { - opacity: 1; - transform: translate(0, 0); - } - } - - @keyframes fadeInOut { - 0% { - opacity: 0; - } - - 25% { - opacity: 1; - } - - 75% { - opacity: 1; - } - - 100% { - opacity: 0; - } - } - - @keyframes inputHighlighter { - from { - background: $o-brand-primary; - } - - to { - width: 0; - background: transparent; - } - } - - // MODALS - body .modal { - - // BACKGROUND IMAGE OPTIONS - .o_bg_img_opt_modal .o_bg_img_opt { - margin: 15px 0; - - .help-control { - @include o-position-absolute(15px, 15px); - } - - .help { - margin: 15px 0; - - .simulator { - position: relative; - float: left; - margin-right: 15px; - width: 120px; - height: 100px; - - .bg { - @include o-position-absolute(0, 0, 0, 0); - border: 1px dotted #888787; - background-image: url(/web/image); - background-position: center center; - background-size: cover; - } - - .el { - @include o-position-absolute(10px, 0, 10px, 0); - border: 1px solid #222; - } - - &.contain_bg { - .bg { - @include o-position-absolute(0, 12px, 20px, 12px); - } - - .el { - @include o-position-absolute(0, 0, 20px, 0); - } - } - } - - +* { - clear: left; - } - } - - .o_bg_img_opt_cover_edition { - @include o-we-preview-box; - padding: 0 25px 25px 25px; - - h6 { - color: white; - font-weight: bold; - } - - .o_bg_img_opt_object { - position: relative; - background: white; - min-height: 10px; - @include o-we-preview-content; - - >img { - cursor: crosshair; - border-top: 1px solid #5A5A5A; - border-bottom: 1px solid #111; - } - - &:hover .o_focus_point:before { - opacity: 0.5; - } - } - - .o_bg_img_opt_ui_info { - animation: fadeInOut 2s ease forwards; - @include o-position-absolute($bottom: 1px, $right: 0); - display: block; - padding: 3px 13px; - background-color: rgba(255, 255, 255, 0.8); - color: #333; - text-align: center; - font-weight: bold; - pointer-events: none; - - span { - font-weight: normal; - } - - .o_x { - margin-right: 10px - } - } - - .grid { - @include o-position-absolute($top: 33.33%, $left: 0); - display: block; - width: 100%; - height: 1px; - background: fade-out(lighten($o-brand-primary, 30%), 0.5); - pointer-events: none; - - &.grid-2 { - top: 66.66% - } - - &.grid-3 { - top: 0; - left: 33.33%; - width: 1px; - height: 100% - } - - &.grid-4 { - top: 0; - left: 66.66%; - width: 1px; - height: 100% - } - } - - .o_focus_point { - @include o-position-absolute($top: 0, $left: 0); - width: 30px; - height: 30px; - border: 2px solid white; - border-radius: 100%; - margin-top: -15px; - margin-left: -15px; - box-shadow: 0 0 1px #333; - pointer-events: none; - - &.o_with_transition { - transition: all 0.2s ease 0s; - } - - &:before { - pointer-events: none; - content: ""; - display: block; - width: 100px; - height: 100px; - margin-top: -37px; - margin-left: -37px; - border: 1px solid #EAEAEA; - background: rgba(247, 76, 76, 0); - border-radius: 100em; - opacity: 1; - box-shadow: 0 0 0 100em rgba(0, 0, 0, 0.33); - transition: opacity 0.2s ease 0s; - } - } - } - } - } - - .wysiwyg_multizone.note-editor { - &>.note-toolbar-wrapper .note-toolbar { - height: $o-navbar-height; - - .btn { - height: $o-navbar-height !important; // force this because of themes - } - } - - &>.note-statusbar { - display: none; - } - - &>.note-editing-area { - overflow: visible; - } - } - - .wysiwyg_multizone.note-popover.popover { - border-width: 0 1px; - - .popover-content .btn { - height: $o-navbar-height; - } - } - - .wysiwyg_multizone.note-popover, - .wysiwyg_multizone.note-editor>.note-toolbar-wrapper .note-toolbar { - // force this because of themes - background-color: $o-we-color-dark !important; - - .btn { - background-color: $o-we-color-dark !important; - color: $o-we-color-text-normal !important; - border: none !important; - padding: 0.0625rem 0.3125rem !important; - - >.fa { - color: $o-we-color-text-normal !important; - } - - &:hover { - color: $o-we-color-text-light !important; - - >.fa { - color: $o-we-color-text-light !important; - } - } - - &.active { - background-color: $o-we-color-dark !important; - color: $o-we-color-text-light !important; - - >.fa { - color: $o-we-color-text-light !important; - } - } - } - - >.btn-group { - margin-top: 0 !important; - - &.show, - .btn-group.show { - .dropdown-toggle { - border-top: 2px solid white !important; - background-color: $o-we-color-darker !important; - color: white !important; - box-shadow: none !important; - - >.fa, - >span { - color: white !important; - } - } + &:focus, + &:active, + &:focus:active { + outline: none; } } .dropdown-menu { - margin: 0 !important; - border-radius: 0 !important; - background-color: $o-we-color-darker !important; - color: $o-we-color-text-normal !important; - white-space: normal !important; + left: auto; + right: 0; + } + } +} - .dropdown-item { - width: 100% !important; - color: $o-we-color-text-light !important; +// Translations +.oe_translate_examples li { + margin: 10px; + padding: 4px; +} - >.fa { - color: $o-we-color-text-light !important; +html[lang] > body.editor_enable [data-oe-translation-state] { + background: rgba($o-we-content-to-translate-color, 0.5) !important; + + &[data-oe-translation-state="translated"] { + background: rgba($o-we-translated-content-color, 0.5) !important; + } + + &.o_dirty { + background: rgba($o-we-translated-content-color, 0.25) !important; + } +} + +// NOTE EDITOR + +// SNIPPET PANEL +#oe_snippets { + @include o-w-preserve-btn; + @include o-position-absolute(0, auto, 0, -$o-we-sidebar-width); + width: $o-we-sidebar-width; + + border-right: 1px solid $o-we-color-divider; + transition: left 400ms $o-we-md-ease 0s; + background-image: linear-gradient(45deg, $o-we-color-normal, darken($o-we-color-normal, 10%)); + + #snippets_menu { + color: #999999; + background: $o-we-color-dark; + font-family: $o-we-font-family; + height: $o-navbar-height; + line-height: $o-navbar-height; + } + + #o_scroll { + .o_panel_header { + color: #999999; + } + } +} + +.oe_snippet { + background-color: $o-we-color-normal; + + .oe_snippet_thumbnail { + .oe_snippet_thumbnail_img { + border: 1px solid $o-we-color-normal; + } + + img.oe_snippet_thumbnail_img {} + + .oe_snippet_thumbnail_title { + border: 1px solid $o-we-color-dark; + color: $o-we-color-text-light; + } + + &:hover .oe_snippet_thumbnail_title { + color: $o-we-color-text-lighter; + } + } +} + +// SNIPPET OPTIONS +.colorpicker { + .o_colorpicker_sections { + .note-color-palette>div { + color: $o-we-color-text-light; + } + } + + .o_colorpicker_section { + &:after { + content: ""; + display: table; + clear: both; + } + + >button { + + &:hover, + &.selected { + box-shadow: 0px 0px 2px 2px $o-we-color-light; + } + + &[data-event="foreColor"] { + background-color: $o-we-color-normal; + + &:before { + background-color: rgba(white, 0.3); } + } + } + } - &:hover { - background-color: $o-we-tab-active-bg !important; - color: white !important; + .note-palette-title { + color: $o-we-color-text-light; + } + + .palette-reset { + .note-color-reset { + color: desaturate(rgba($o-we-color-danger, 0.6), 40%); + + &:hover { + color: $o-we-color-danger; + } + } + } +} + +// DROPZONES +#wrapwrap .oe_drop_zone { + &.oe_insert { + height: $o-we-dropzone-size; + margin: (-$o-we-dropzone-size/2) 0; + + &:after { + border-bottom: $o-we-dropzone-border; + } + + &.oe_vertical { + width: $o-we-dropzone-size; + margin: 0 (-$o-we-dropzone-size/2); + + &:after { + border-right: $o-we-dropzone-border; + } + } + } +} + +// MANIPULATORS +#oe_manipulators { + + // SNIPPET MANIPULATORS + .oe_overlay { + + // OVERLAY OPTIONS + >.oe_overlay_options { + font-family: $o-we-font-family; + + >.btn-group { + .btn { + height: $o-we-overlay-option-size; + border: 1px solid $o-we-color-dark; + line-height: #{$o-we-overlay-option-size - 2px}; + + color: $o-we-color-text-light; + background-color: $o-we-color-light; + + &:hover { + background-color: lighten($o-we-color-dark, 10%); + } + + &.oe_snippet_remove { + background-color: $o-we-color-danger; + border-color: darken($o-we-color-danger, 20%); + + &:hover { + background-color: darken($o-we-color-danger, 20%); + } + } >.fa { - color: white !important; + color: $o-we-color-text-light; + } + } + + // CUSTOMIZE MENU BUTTON + >.oe_options { + .btn { + background-color: $o-we-color-dark; + color: $o-we-color-text-light; + + &:hover, + &:active, + &:focus { + background-color: lighten($o-we-color-dark, 5%); + border-color: lighten($o-we-color-dark, 10%); + } + + &:before, + &:after { + background-color: $o-we-color-text-light; + } + } + + // Open menu + &.show .btn { + // background-color: $o-we-color-light; + } + + // CUSTOMIZE MENU + .dropdown-menu { + border: 1px solid $o-we-color-dark; + background-color: $o-we-color-light; + + .dropdown-item { + color: $o-we-color-text-light; + + &:hover { + background-color: fade-out($o-we-color-dark, 0.5); + } + + &.active { + background-color: fade-out($o-we-color-dark, 0.5); + } + } + + .dropdown-header { + color: wheat; + + &.o_parent_editor_header { + color: wheat; + } + } + + .dropdown-submenu { + &::before { + border-left-color: $o-we-color-text-light; + } + } } } } } - .note-para .dropdown-menu { - min-width: 147px !important; + &.o_top_cover>.oe_overlay_options { + top: $o-we-handle-border-width; + right: $o-we-handle-border-width; } - .note-style .dropdown-item * { - color: $o-we-color-text-light !important; + } +} + +// Animations +@keyframes fadeInDownSmall { + 0% { + opacity: 0; + transform: translate(0, -5px); + } + + 100% { + opacity: 1; + transform: translate(0, 0); + } +} + +@keyframes fadeInOut { + 0% { + opacity: 0; + } + + 25% { + opacity: 1; + } + + 75% { + opacity: 1; + } + + 100% { + opacity: 0; + } +} + +@keyframes inputHighlighter { + from { + background: $o-brand-primary; + } + + to { + width: 0; + background: transparent; + } +} + +// MODALS +body .modal { + + // BACKGROUND IMAGE OPTIONS + .o_bg_img_opt_modal .o_bg_img_opt { + margin: 15px 0; + + .help-control { + @include o-position-absolute(15px, 15px); + } + + .help { + margin: 15px 0; + + .simulator { + position: relative; + float: left; + margin-right: 15px; + width: 120px; + height: 100px; + + .bg { + @include o-position-absolute(0, 0, 0, 0); + border: 1px dotted #888787; + background-image: url(/web/image); + background-position: center center; + background-size: cover; + } + + .el { + @include o-position-absolute(10px, 0, 10px, 0); + border: 1px solid #222; + } + + &.contain_bg { + .bg { + @include o-position-absolute(0, 12px, 20px, 12px); + } + + .el { + @include o-position-absolute(0, 0, 20px, 0); + } + } + } + + +* { + clear: left; + } + } + + .o_bg_img_opt_cover_edition { + @include o-we-preview-box; + padding: 0 25px 25px 25px; + + h6 { + color: white; + font-weight: bold; + } + + .o_bg_img_opt_object { + position: relative; + background: white; + min-height: 10px; + @include o-we-preview-content; + + >img { + cursor: crosshair; + border-top: 1px solid #5A5A5A; + border-bottom: 1px solid #111; + } + + &:hover .o_focus_point:before { + opacity: 0.5; + } + } + + .o_bg_img_opt_ui_info { + animation: fadeInOut 2s ease forwards; + @include o-position-absolute($bottom: 1px, $right: 0); + display: block; + padding: 3px 13px; + background-color: rgba(255, 255, 255, 0.8); + color: #333; + text-align: center; + font-weight: bold; + pointer-events: none; + + span { + font-weight: normal; + } + + .o_x { + margin-right: 10px + } + } + + .grid { + @include o-position-absolute($top: 33.33%, $left: 0); + display: block; + width: 100%; + height: 1px; + background: fade-out(lighten($o-brand-primary, 30%), 0.5); + pointer-events: none; + + &.grid-2 { + top: 66.66% + } + + &.grid-3 { + top: 0; + left: 33.33%; + width: 1px; + height: 100% + } + + &.grid-4 { + top: 0; + left: 66.66%; + width: 1px; + height: 100% + } + } + + .o_focus_point { + @include o-position-absolute($top: 0, $left: 0); + width: 30px; + height: 30px; + border: 2px solid white; + border-radius: 100%; + margin-top: -15px; + margin-left: -15px; + box-shadow: 0 0 1px #333; + pointer-events: none; + + &.o_with_transition { + transition: all 0.2s ease 0s; + } + + &:before { + pointer-events: none; + content: ""; + display: block; + width: 100px; + height: 100px; + margin-top: -37px; + margin-left: -37px; + border: 1px solid #EAEAEA; + background: rgba(247, 76, 76, 0); + border-radius: 100em; + opacity: 1; + box-shadow: 0 0 0 100em rgba(0, 0, 0, 0.33); + transition: opacity 0.2s ease 0s; + } + } } } } + +.wysiwyg_multizone.note-editor { + &>.note-toolbar-wrapper .note-toolbar { + height: $o-navbar-height; + + .btn { + height: $o-navbar-height !important; // force this because of themes + } + } + + &>.note-statusbar { + display: none; + } + + &>.note-editing-area { + overflow: visible; + } +} + +.wysiwyg_multizone.note-popover.popover { + border-width: 0 1px; + + .popover-content .btn { + height: $o-navbar-height; + } +} + +.wysiwyg_multizone.note-popover, +.wysiwyg_multizone.note-editor>.note-toolbar-wrapper .note-toolbar { + // force this because of themes + background-color: $o-we-color-dark !important; + + .btn { + background-color: $o-we-color-dark !important; + color: $o-we-color-text-normal !important; + border: none !important; + padding: 0.0625rem 0.3125rem !important; + + >.fa { + color: $o-we-color-text-normal !important; + } + + &:hover { + color: $o-we-color-text-light !important; + + >.fa { + color: $o-we-color-text-light !important; + } + } + + &.active { + background-color: $o-we-color-dark !important; + color: $o-we-color-text-light !important; + + >.fa { + color: $o-we-color-text-light !important; + } + } + } + + >.btn-group { + margin-top: 0 !important; + + &.show, + .btn-group.show { + .dropdown-toggle { + border-top: 2px solid white !important; + background-color: $o-we-color-darker !important; + color: white !important; + box-shadow: none !important; + + >.fa, + >span { + color: white !important; + } + } + } + } + + .dropdown-menu { + margin: 0 !important; + border-radius: 0 !important; + background-color: $o-we-color-darker !important; + color: $o-we-color-text-normal !important; + white-space: normal !important; + + .dropdown-item { + width: 100% !important; + color: $o-we-color-text-light !important; + + >.fa { + color: $o-we-color-text-light !important; + } + + &:hover { + background-color: $o-we-tab-active-bg !important; + color: white !important; + + >.fa { + color: white !important; + } + } + } + } + + .note-para .dropdown-menu { + min-width: 147px !important; + } + + .note-style .dropdown-item * { + color: $o-we-color-text-light !important; + } +}