diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-03-12 16:27:41 +0100 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2018-04-18 15:59:15 +0200 |
| commit | b04dec4025013c60e4857c1e177bb20d811cd41a (patch) | |
| tree | db8b38a5e1df34ee6f0402fab9a0bd8b4b769f8e /addons/web_editor/static/src/scss | |
| parent | a6393130e6fcc4ad706f3df08557e5434416e4ab (diff) | |
[REF] *: rename all LESS files to SCSS
This is a simple renaming without adaptation.
Diffstat (limited to 'addons/web_editor/static/src/scss')
| -rw-r--r-- | addons/web_editor/static/src/scss/web_editor.backend.scss | 108 | ||||
| -rw-r--r-- | addons/web_editor/static/src/scss/web_editor.common.scss | 308 | ||||
| -rw-r--r-- | addons/web_editor/static/src/scss/web_editor.ui.scss | 1687 | ||||
| -rw-r--r-- | addons/web_editor/static/src/scss/web_editor.variables.scss | 202 |
4 files changed, 2305 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/scss/web_editor.backend.scss b/addons/web_editor/static/src/scss/web_editor.backend.scss new file mode 100644 index 00000000000..7ddbaeaa7ce --- /dev/null +++ b/addons/web_editor/static/src/scss/web_editor.backend.scss @@ -0,0 +1,108 @@ +.oe_form_field_html_text { + .note-editable { + min-height: 180px; + font: initial !important; + font-family: inherit !important; + line-height: initial !important; + color: initial !important; + p, div { + font-family: 'Lucida Grande', Helvetica, Verdana, Arial, sans-serif; + font-size: 13px; + } + a, a:hover { + color: initial; + } + ul > li > p { + margin: 0px; + } + } + .o_readonly { + min-height: 1em; + width: 100%; + margin: 0; + padding: 0; + border: 0; + word-wrap: break-word; + ul > li > p { + margin: 0px; + } + } +} +.oe_form_field_html iframe { + display: block; + width: 100%; + border: 0; + padding: 0; + margin: 0; + min-height: 300px; + min-height: -webkit-calc(100vh - 170px); + min-height: calc(100vh - 170px); +} +.o_field_widgetTextHtml_fullscreen { + .oe_form_field_html.o_form_fullscreen_ancestor iframe { + position: absolute !important; + left: 0 !important; + right: 0 !important; + top: 0 !important; + bottom: 0 !important; + width: 100% !important; + min-height: 100% !important; + z-index: 1001 !important; + border: 0; + } + * { + display: none; + } + .o_form_fullscreen_ancestor { + display: block !important; + position: static !important; + top: 0 !important; + left: 0 !important; + width: auto !important; + overflow: hidden !important; + transform: none !important; + } +} + +.openerp .oe_form .oe_form_field_html_translate textarea { + min-width: 60px; + width: 100%; + color: #4c4c4c; + font: normal 13px "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; +} +.openerp .oe_form_readonly .oe_form .oe_form_field_html_translate textarea { + border: 0; + background: #fff; +} +.openerp .oe_form_editable .oe_form .oe_form_field_html_translate { + > button { + float: right; + margin: -6px -3px 0 0; + } + > .note-editable { + border: 1px solid #ccc; + min-height: 22px; + border-radius: 3px; + } + .note-editable [contentEditable='true']:hover { + box-shadow: #DDCC33 0 0 5px 2px inset; + } +} + +// FIX (to improve in next versions) +// --------------------------------- +// The web_editor.colorpicker defines a series of color buttons which toggle the bg-* and text-* classes. +// The problem is that themes can define new buttons whose bg-* and text-* classes only exist in the frontend. +// So these buttons should not be displayed in the backend. Only solution for the current implementation is +// to add this ugly rule (in this backend file) which hides every button and redisplayed the default ones. +.note-editor { + .colorpicker .o_colorpicker_section > button { + display: none; + + &[data-color="alpha"], &[data-color="beta"], &[data-color="gamma"], &[data-color="delta"], &[data-color="epsilon"], + &[data-color="white"], &[data-color="gray-lighter"], &[data-color="gray-light"], &[data-color="gray"], &[data-color="gray-dark"], &[data-color="gray-darker"], &[data-color="black"], + &[data-color="primary"], &[data-color="success"], &[data-color="info"], &[data-color="warning"], &[data-color="danger"] { + display: block; + } + } +} diff --git a/addons/web_editor/static/src/scss/web_editor.common.scss b/addons/web_editor/static/src/scss/web_editor.common.scss new file mode 100644 index 00000000000..99f6a474397 --- /dev/null +++ b/addons/web_editor/static/src/scss/web_editor.common.scss @@ -0,0 +1,308 @@ +/// +/// This file regroups basic style rules for web_editor enable page edition and backend utils. +/// + +html, body { + width: 100%; + height: 100%; +} + +.css_non_editable_mode_hidden { + display: none !important; +} +.editor_enable .css_editable_mode_hidden { + display: none !important; +} +.note-toolbar { + margin-left: 0 !important; +} +.note-popover .popover > .arrow { + display: none; +} + +/* ----- GENERIC LAYOUTING HELPERS ---- */ +/* table */ +#wrapwrap, .o_editable { + // Only style editor-made tables (shop/portal/... tables are not supposed to + // use table-bordered...) + table.table.table-bordered { + table-layout: fixed; + td { + min-width: 20px; + } + } + @media (max-width: @screen-xs-max) { + .table-responsive > table.table { + table-layout: auto; + } + } +} + +// Medias +img.shadow { + box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2); +} +img.padding-small, .img.padding-small, span.fa.padding-small, iframe.padding-small { + padding: 4px; +} +img.padding-medium, .img.padding-medium, span.fa.padding-medium, iframe.padding-medium { + padding: 8px; +} +img.padding-large, .img.padding-large, span.fa.padding-large, iframe.padding-large { + padding: 16px; +} +img.padding-xl, .img.padding-xl, span.fa.padding-xl, iframe.padding-xl { + padding: 32px; +} + +.fa-6x { + font-size: 6em; +} +.fa-7x { + font-size: 7em; +} +.fa-8x { + font-size: 8em; +} +.fa-9x { + font-size: 9em; +} +.fa-10x { + font-size: 10em; +} +.fa.center-block { + text-align: center; +} + +div.media_iframe_video { + margin: 0 auto; + text-align: center; + position: relative; + overflow: hidden; + + iframe { + width: 100%; + height: 100%; + .o-position-absolute(@top: 0); + margin: 0 auto; + margin-left: -50%; + } + &.padding-small iframe { + padding: 4px; + } + &.padding-medium iframe { + padding: 8px; + } + &.padding-large iframe { + padding: 16px; + } + &.padding-xl iframe { + padding: 32px; + } + + .media_iframe_video_size { + padding-bottom: 66.5%; + position: relative; + width: 100%; + height: 0; + } + + .css_editable_mode_display { + .o-position-absolute(); + width: 100%; + height: 100%; + display: none; + z-index: 2; + } +} + +html[data-browser^="msie"] div.media_iframe_video iframe { + margin-left: 0; +} + +@media (max-width: @screen-xs-max) { + img:not(.cke_iframe), .media_iframe_video, span.fa, i.fa { + -webkit-transform: none !important; + -moz-transform: none !important; + -ms-transform: none !important; + -o-transform: none !important; + transform: none !important; + } +} + +// Fields +address { + .fa.fa-mobile-phone { + margin: 0 3px 0 2px; + } + .fa.fa-file-text-o { + margin-right: 1px; + } +} + +span[data-oe-type="monetary"] { + white-space: nowrap; +} + +// Menus +// TODO should not be here but used by web_studio so must stay here for now +ul.oe_menu_editor { + .oe_menu_placeholder { + outline: 1px dashed #4183C4; + } + ul { + list-style: none; + } + li div { + cursor: move; + } +} + +// Generate all spacings for all sizes +.o-spacing-all(@factor: 1) { + // Generate vertical margin/padding classes used by the editor + .o-generate-spacings(256/8); + .o-generate-spacings(@n, @i: 0) when (@i =< @n) { + .o-vspacing(@i * 8); + .o-generate-spacings(@n, @i + 1); + } + .o-vspacing(4, @factor); + + // 92px vertical margin is kept for compatibility + .o-vmargins(92, @factor); + + // Some horizontal margin classes defined for convenience + // (and compatibility) + .o-hmargins(0, @factor); + .o-hmargins(4, @factor); + .o-hmargins(8, @factor); + .o-hmargins(16, @factor); + .o-hmargins(32, @factor); + .o-hmargins(64, @factor); +} + +// Generate all spacings for one size, scalled by a given factor +// (0 <= factor <= 1) +.o-vspacing(@name, @factor: 1) { + .o-vmargins(@name, @factor); + .o-vpaddings(@name, @factor); +} +.o-vmargins(@name, @factor: 1) { + .o-vmargins-define(@name, @factor * @name); +} +.o-vpaddings(@name, @factor: 1) { + .o-vpaddings-define(@name, @factor * @name); +} +.o-hspacing(@name, @factor: 1) { + .o-hmargins(@name, @factor); + .o-hpaddings(@name, @factor); +} +.o-hmargins(@name, @factor: 1) { + .o-hmargins-define(@name, @factor * @name); +} +.o-hpaddings(@name, @factor: 1) { + .o-hpaddings-define(@name, @factor * @name); +} + +// Generate all spacings for one size, given the name of the spacing and +// intended size +.o-vmargins-define(@name, @size: @name) { + .mt@{name} { margin-top: unit(@size, px)!important; } + .mb@{name} { margin-bottom: unit(@size, px)!important; } +} +.o-vpaddings-define(@name, @size: @name) { + .pt@{name} { padding-top: unit(@size, px)!important; } + .pb@{name} { padding-bottom: unit(@size, px)!important; } +} +.o-hmargins-define(@name, @size: @name) { + .ml@{name} { margin-left: unit(@size, px)!important; } + .mr@{name} { margin-right: unit(@size, px)!important; } +} +.o-hpaddings-define(@name, @size: @name) { + .pl@{name} { padding-left: unit(@size, px)!important; } + .pr@{name} { padding-right: unit(@size, px)!important; } +} + +// Generate all margins +.o-spacing-all(); + +// Underline +a.o_underline { + text-decoration: underline; + &:hover { + text-decoration: underline; + } +} + +// Colors +@gray-white: #fff; + +@color-alpha: #1cc1a9; +@color-beta: #875A7B; +@color-gamma: #BA3C3D; +@color-delta: #0D6759; +@color-epsilon: #0B2E59; + +// Greyscale transparent colours +@color-black-25: fade(black, 25%); +@color-black-50: fade(black, 50%); +@color-black-75: fade(black, 75%); +@color-white-25: fade(white, 25%); +@color-white-50: fade(white, 50%); +@color-white-75: fade(white, 75%); + +.o-create-color-classes(@name, @color, @complementary: contrast(@color, @text-color, #FFF, 60%), @content-color: @color) { + .bg-@{name} { + background-color: @color; + color: @complementary; + .text-muted { + color: fade(@complementary, 40%); + } + } + body .text-@{name} { // body to make the rules more important that bg-* ones + color: @content-color; + } +} +.o-create-color-btn-classes(@name, @color, @complementary: contrast(@color, @text-color, #FFF, 60%), @border-color: darken(@color, 5%)) { + .btn-@{name} { + .button-variant(@complementary, @color, @border-color); + } +} + +// Create classes for theme colors... +.o-create-color-classes(alpha, @color-alpha); +.o-create-color-classes(beta, @color-beta); +.o-create-color-classes(gamma, @color-gamma); +.o-create-color-classes(delta, @color-delta); +.o-create-color-classes(epsilon, @color-epsilon); + +// ... and button classes +.o-create-color-btn-classes(alpha, @color-alpha); +.o-create-color-btn-classes(beta, @color-beta); +.o-create-color-btn-classes(gamma, @color-gamma); +.o-create-color-btn-classes(delta, @color-delta); +.o-create-color-btn-classes(epsilon, @color-epsilon); + +// Create classes for UI colors +.o-create-color-classes(primary, @brand-primary); +.o-create-color-classes(success, @state-success-bg, @content-color: @state-success-text); +.o-create-color-classes(info, @state-info-bg, @content-color: @state-info-text); +.o-create-color-classes(warning, @state-warning-bg, @content-color: @state-warning-text); +.o-create-color-classes(danger, @state-danger-bg, @content-color: @state-danger-text); + +// Create classes for greyscale colors +.o-create-color-classes(~'black', @gray-base); +.o-create-color-classes(~'gray-darker', @gray-darker); +.o-create-color-classes(~'gray-dark', @gray-dark); +.o-create-color-classes(~'gray', @gray); +.o-create-color-classes(~'gray-light', @gray-light); +.o-create-color-classes(~'gray-lighter', @gray-lighter); +.o-create-color-classes(~'white', @gray-white); + +// Create classes for greyscale transparent colours +.o-create-color-classes(~'black-25', @color-black-25); +.o-create-color-classes(~'black-50', @color-black-50); +.o-create-color-classes(~'black-75', @color-black-75); +.o-create-color-classes(~'white-25', @color-white-25); +.o-create-color-classes(~'white-50', @color-white-50); +.o-create-color-classes(~'white-75', @color-white-75); diff --git a/addons/web_editor/static/src/scss/web_editor.ui.scss b/addons/web_editor/static/src/scss/web_editor.ui.scss new file mode 100644 index 00000000000..76e86b98cb9 --- /dev/null +++ b/addons/web_editor/static/src/scss/web_editor.ui.scss @@ -0,0 +1,1687 @@ + +// TOP BAR (EDIT) +#web_editor-top-edit { + .o-position-absolute(0, 0, auto, 0); + position: fixed; + height: @odoo-navbar-height; + z-index: @zindex-modal - 9; + + background-color: rgba(0,0,0,0); + .o-transition(background-color, 400ms, @o-we-md-ease); + font-family: @o-we-font-family; + + form.navbar-form { + height: 100%; + z-index: 1060; + margin: 0; + padding: 0; + .o-position-absolute(@right: -@o-we-sidebar-width); + .o-transition(right, 0.4s, @o-we-md-ease); + 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; + + .o-transition(all, 0.3s); + border: none; + border-radius: 0; + + .fa { + margin-right: @grid-gutter-width/4; + &.fa-times { + color: @o-we-color-danger; + } + } + + &.btn-primary { + .button-variant(white, @odoo-brand-primary, @odoo-brand-primary); + } + &.btn-default { + .button-variant(white, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)); + + &:hover { + background: fade(black, 50%); + } + } + + &:focus, &:active, &:focus:active { + outline: none; + } + } + .dropdown-menu { + left: auto; + right: 0; + } + } +} + +// Translations +.oe_translate_examples li { + margin: 10px; + padding: 4px; +} +html[lang] > body.editor_enable [data-oe-translation-state] { + @o-color-content-to-translate: rgb(255, 255, 90); + @o-color-translated-content: rgb(120, 215, 110); + + background: fade(@o-color-content-to-translate, 50%)!important; + + &[data-oe-translation-state="translated"] { + background: fade(@o-color-translated-content, 50%)!important; + } + &.o_dirty { + background: fade(@o-color-translated-content, 25%)!important; + } +} + +// SNIPPET PANEL +#oe_snippets { + .o-w-preserve-btn(); + + .o-flex-display(); + .o-flex-flow(column, nowrap); + .o-position-absolute(0, auto, 0, -@o-we-sidebar-width); + position: fixed; + width: @o-we-sidebar-width; + z-index: @zindex-modal - 9; + + font-family: Roboto, @font-family-sans-serif; + border-right: 1px solid @o-we-color-divider; + .o-transition(left, 400ms, @o-we-md-ease); + .o-linear-gradient(45deg, @o-we-color-normal, darken(@o-we-color-normal, 10%)); + box-shadow: 0px 10px 10px -10px black inset; + + #snippets_menu { + .o-flex(0, 0, auto); + height: @odoo-navbar-height; + line-height: @odoo-navbar-height; + margin: 0; + padding: 0; + background: @o-we-color-dark; + text-align: center; + font-weight: normal; + font-size: 17px; + color: white; + font-family: @o-we-font-family; + } + + #o_scroll { + height: 100%; + overflow: auto; + + .o_panel_header { + color: #999999; + .o-flex-display(); + .o-align-items(center); + .o-justify-content(center); + padding: 3%; + color: white; + margin-bottom: 3%; + + i { + margin-right: 5px; + } + } + .o_panel_body { + &:after { + content: " "; + display: table; + clear: both; + } + + .oe_snippet { + float: left; + width: 45.5%; + margin: 0 0 6% 3%; + box-shadow: none; + background-color: transparent; + .user-select(none); + + cursor: pointer; + cursor: copy; + cursor: grab; + + .oe_snippet_thumbnail { + .oe_snippet_thumbnail_img { + border: none; + } + .oe_snippet_thumbnail_title { + border: none; + padding: 0px; + } + + &:hover .oe_snippet_thumbnail_img { + .o-transition(transform, 200ms, ease); + .scale(1.05); + } + } + + &.o_disabled { + .oe_snippet_thumbnail { + background-color: rgba(255, 0, 0, 0.75); + } + .oe_snippet_thumbnail_img { + opacity: 0.8; + } + } + + &.o_snippet_install { + .oe_snippet_thumbnail_img { + opacity: 0.5; + } + .btn.o_install_btn { + display: none; + .o-position-absolute(16px, 4px, auto, 4px); + } + &:hover .btn.o_install_btn { + display: block; + } + } + + &:nth-child(2n+1) { + clear: left; + } + } + } + } +} +.oe_snippet { // No root because can be drag and drop (and the helper is in the body) + position: relative; + width: 100px; + background-color: @o-we-color-normal; + + > :not(.oe_snippet_thumbnail) { + display: none!important; + } + + .oe_snippet_thumbnail { + width: 100%; + + .oe_snippet_thumbnail_img { + width: 100%; + height: 0; + border: 1px solid @o-we-color-normal; + padding-bottom: 75%; + background-size: cover; + background-position: center center; + text-align: center; + overflow: hidden; + } + img.oe_snippet_thumbnail_img { + height: auto; + padding-bottom: 0; + } + .oe_snippet_thumbnail_title { + display: block; + border: 1px solid @o-we-color-dark; + padding: 5px; + font-size: 12px; + font-weight: 300; + text-shadow: none; + color: @o-we-color-text-light; + } + &:hover .oe_snippet_thumbnail_title { + color: white; + } + } +} + +// DROPZONES +@keyframes dropZoneInsert { + to { + background-color: fade(@odoo-brand-primary, 20%); + } +} +#wrapwrap .oe_drop_zone { + background-color: fade(@odoo-brand-primary, 5%); + .o-animation(dropZoneInsert, 1s, linear, 0s, infinite, alternate); + + &.oe_insert { + @odoo-dropzone-size: 40px; + @odoo-dropzone-border-width: 2px; + @odoo-dropzone-border: @odoo-dropzone-border-width dashed @odoo-brand-primary; + + z-index: 999; + + border: @odoo-dropzone-border; + border-top: none; + border-bottom: none; + + position: relative; + width: 100%; + height: @odoo-dropzone-size; + margin: -@odoo-dropzone-size/2 0; + + .o-transition(margin, 400ms, linear); + + &:after { + content: ""; + display: block; + width: 100%; + height: 50%; + border-bottom: @odoo-dropzone-border; + box-sizing: content-box; + } + + &.oe_vertical { + border: 2px dashed @odoo-brand-primary; + border-left: none; + border-right: none; + + width: @odoo-dropzone-size; + float: left; + margin: 0 -@odoo-dropzone-size/2; + + &:after { + width: 50%; + height: 100%; + border-bottom: none; + border-right: @odoo-dropzone-border; + } + } + } +} + +// MANIPULATORS +#oe_manipulators { + @odoo-handle-edge-size: 1px; + @odoo-handle-border-width: 1px; + + position: relative; + + // SNIPPET MANIPULATORS + .oe_overlay { + .o-position-absolute(); + z-index: 1002; + display: none; + height: 0; + background: transparent; + text-align: center; + .o-transition(opacity, 400ms, linear); + &.o_keypress { + opacity: 0; + } + &.oe_active { + display: block; + } + + // OVERLAY OPTIONS + > .oe_overlay_options { + font-family: @o-we-font-family; + .o-position-absolute(@bottom: 0, @left: 0); + width: 250px; // the parent oe_overlay has a width equal to the snippet width, the 250px is there to force the options to stay on one line without overriding bootstrap .btn-group + text-align: left; + + > .btn-group { + white-space: nowrap; + + .btn { + @o-overlay-option-size: 25px; + + display: inline-block; + width: @o-overlay-option-size; + height: @o-overlay-option-size; + padding: 0; + border: 1px solid @o-we-color-dark; + line-height: @o-overlay-option-size; + font-size: 11px; + border-radius: 0; + font-weight: normal; + + .o-transition(all, 400ms); + color: @o-we-color-text-light; + background-color: @o-we-color-light; + &:hover { + color: white; + background-color: lighten(@o-we-color-dark, 10%); + + > .fa { + color: white; + } + } + + &.oe_snippet_remove { + color: white; + background-color: @o-we-color-danger; + border-color: darken(@o-we-color-danger, 20%); + + > .fa { + color: white; + } + + &:hover { + background-color: darken(@o-we-color-danger, 20%); + } + } + &.oe_snippet_parent > i { + .scaleX(-1); + font-size: 12px; + } + + > .fa { + color: @o-we-color-text-light; + } + } + + // CUSTOMIZE MENU BUTTON + > .oe_options { + .btn { + width: auto; + padding: 0 25px 0 5px; + background-color: @o-we-color-dark; + text-transform: uppercase; + &:hover, &:active, &:focus { + background-color: lighten(@o-we-color-dark, 5%); + border-color: lighten(@o-we-color-dark, 10%); + color: white; + } + &:active, &:focus, &:active:focus { + outline: none; + } + &:before, &:after { + content: ""; + width: 7px; + height: 2px; + background-color: @o-we-color-text-light; + .o-position-absolute(46%); + .o-transition(all, 0.3s); + } + &:before { + right: 9px; + .rotate(45deg); + } + &:after { + right: 5px; + .rotate(-45deg); + } + } + // Open menu + &.open .btn { + background-color: @o-we-color-light; + &:before, &:after { + width: 9px; + } + &:before { + right: 10px; + transform: translateX(5px) rotate(-45deg); + } + &:after { + .rotate(45deg); + } + } + + // CUSTOMIZE MENU + .dropdown-menu { + margin: -1px 0 0 0; + padding: 0; + border: 1px solid @o-we-color-dark; + border-radius: 0; + background-color: @o-we-color-light; + a { + color: @o-we-color-text-light; + font-weight: normal; + font-size: 12px; + padding: 5px 35px 5px 20px; + } + + > li { + position: relative; + &:hover { + background-color: fadeOut(@o-we-color-dark, 50%); + > a { + color: white; + background: transparent; + cursor: pointer; + } + > .dropdown-menu { + display: block; + left: 100%; + top: 0; + + &.o_open_to_left { + left: auto; + right: 100%; + } + } + } + &.dropdown-submenu:before { + .o-position-absolute(@top: 10px, @right: 10px); + .o-caret-right(3px); + border-left-color: @o-we-color-text-light; + } + &.divider { + background-color: @o-we-color-divider; + margin: 0 8px; + } + &.active > a { + color: white; + background-color: fadeOut(@o-we-color-dark, 50%); + &:before { + .o-position-absolute(@top: 5px, @left: 5px); + content: "\f00c"; + font-family: "FontAwesome"; + color: @odoo-brand-optional; + } + } + &.dropdown-header { + color: white; + font-weight: bold; + font-size: 12px; + margin-top: 2px; + + &:hover { + background-color: initial; + } + + &.o_main_header { + padding-left: 8px; + } + &.o_parent_editor_header { + color: wheat; + font-weight: 400; + font-size: 10px; + margin: 7px 0 4px 4px; + &::before { + content: "\f148"; + .o-position-absolute(@top: 2px, @left: 8px); + font-family: FontAwesome; + .scaleX(-1); + } + ~ li:not(.dropdown-header) { + a { + font-size: 11px; + padding: 4px 35px 4px 20px; + opacity: 0.8; + &:hover { + opacity: 1; + } + } + } + } + } + + &.separator { + display: block; + margin: 4px 35px 4px 20px; + height: 1px; + background: fade(@o-we-color-text-light, 10%); + } + + > a > i { + width: 16px; + margin-right: 8px; + } + } + } + } + } + } + + &.o_top_cover > .oe_overlay_options { + bottom: auto; + top: @odoo-handle-border-width; + right: @odoo-handle-border-width; + } + + // HANDLES + > .o_handles { + @o-handles-offset-to-hide: 10000px; + @o-handless-accent-color: #00e2ff; + .o-position-absolute(-@o-handles-offset-to-hide, 0, auto, 0); + + &:hover > .o_handle { + background-color: fade(@o-handless-accent-color, 5%); + } + + > .o_handle { + @o-handle-btn-size: 18px; + + position: relative; + border: 0 solid @o-handless-accent-color; + .o-transition(background, 300ms); + + &:hover, &.o_active { + background-color: fade(@o-handless-accent-color, 20%); + + &:before { + content: ''; + .o-position-absolute(0, @left:50%); + width: 1px; + height: 100%; + margin-left: -1px; + background-color: fade(@o-handless-accent-color, 50%); + } + + &.w:before { + .o-position-absolute(50%, @left: 0); + width: 100%; + height: 1px; + } + + &:after { + border-color: darken(@o-handless-accent-color, 10%); + background-color: darken(@o-handless-accent-color, 20%); + } + } + + &:after { + display: block; + width: @o-handle-btn-size; + height: @o-handle-btn-size; + border: solid 1px darken(@o-handless-accent-color, 10%); + line-height: @o-handle-btn-size - 2; + font-size: 14px; + font-family: FontAwesome; + background-color: darken(@o-handless-accent-color, 20%); + color: white; + } + &.w:after, &.e:after { + content: "\f07e"; + } + &.s:after, &.n:after { + content: "\f07d"; + } + + &.o_handle_start { + &.w:after, &.e:after { + content: '\f061'; + } + &.n:after, &.s:after { + content: '\f063'; + } + } + &.o_handle_end { + &.w:after, &.e:after { + content: '\f060'; + } + &.n:after, &.s:after { + content: '\f062'; + } + } + + &.w { + .o-position-absolute(@o-handles-offset-to-hide, auto, -@o-handles-offset-to-hide, 0); + width: @odoo-handle-edge-size; + border-width: @odoo-handle-border-width; + border-right-width: 0; + cursor: e-resize; + + &:after { + .o-position-absolute(@top: 50%, @left: 40%); + margin-top: -@o-handle-btn-size/2; + } + } + &.e { + .o-position-absolute(@o-handles-offset-to-hide, 0, -@o-handles-offset-to-hide, auto); + width: @odoo-handle-edge-size; + border-right-width: @odoo-handle-border-width; + cursor: w-resize; + + &:after { + .o-position-absolute(@top: 50%, @right: 40%); + margin-top: -@o-handle-btn-size/2; + } + } + &.n { + .o-position-absolute(@o-handles-offset-to-hide, 0, auto, 0); + border-top-width: @odoo-handle-border-width; + cursor: ns-resize; + + &:after { + .o-position-absolute(@left: 50%, @top: 40%); + margin-left: -@o-handle-btn-size/2; + } + } + &.s { + .o-position-absolute(auto, 0, -@o-handles-offset-to-hide, 0); + border-bottom-width: @odoo-handle-border-width; + cursor: ns-resize; + + &:after { + .o-position-absolute(@left: 50%, @bottom: 40%); + margin-left: -@o-handle-btn-size/2; + } + } + + &.readonly { + cursor: auto!important; + + &:after { + display: none!important; + } + &:hover { + opacity: 0.5; + } + } + } + } + } +} + +.s-resize-important * { + cursor: s-resize !important; +} +.n-resize-important * { + cursor: n-resize !important; +} +.e-resize-important * { + cursor: e-resize !important; +} +.w-resize-important * { + cursor: w-resize !important; +} +.move-important * { + cursor: move !important; +} + +// NOTE EDITOR +.note-popover .popover { + height: @odoo-navbar-height; + top: 0 !important; + left: 0 !important; + padding: 0; + margin: 0 0 0 @o-we-sidebar-width; + background-color: @o-we-color-dark; + border-radius: 0; + border-width: 0 1px; + width: auto; + text-align: center; + box-shadow: none; + + .popover-content { + height: @odoo-navbar-height; + white-space: nowrap; + font-family: @o-we-font-family; + + h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { + font-family: @o-we-font-family; + } + + .btn { + height: @odoo-navbar-height; + border: none; + border-radius: 0; + padding: @padding-base-vertical @padding-base-horizontal; // force this because of themes + background-color: @o-we-color-dark; + color: @o-we-color-text-normal; + border-top: 2px solid transparent; + .o-transition(all, 0.3s); + + > .fa { + color: @o-we-color-text-normal; + } + + &:hover { + border-top: 2px solid @o-we-color-text-normal; + color: @o-we-color-text-light; + + > .fa { + color: @o-we-color-text-light; + } + } + + .o_image_alt { + .o-text-overflow(inline-block); + max-width: 100px; + } + + &.active { + border-top: 2px solid white; + background-color: @o-we-color-dark; + color: @o-we-color-text-light; + box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.5); + + > .fa { + color: @o-we-color-text-light; + } + } + } + > .btn-group { + margin-top: -2px; + + &.open, .btn-group.open { + .dropdown-toggle { + border-top: 2px solid white; + background-color: @o-we-color-darker; + color: white; + box-shadow: none; + + > .fa, > span { + color: white; + } + } + } + } + .dropdown-menu { + margin: 0; + border-radius: 0; + background-color: @o-we-color-darker; + color: @o-we-color-text-normal; + > li > a { + width: 100%; + color: @o-we-color-text-light; + + > .fa { + color: @o-we-color-text-light; + } + + &:hover { + background-color: @o-we-tab-active-bg; + color: white; + + > .fa { + color: white; + } + } + } + } + .note-para .dropdown-menu { + min-width: 228px; + } + + #colors_preview { + padding: 4px; + border-radius: 2px; + border: 1px solid #989898; + border-color: fadeOut(@o-we-color-text-normal, 0.5); + } + .note-color-palette .note-color-row { + height: auto!important; + + &::after { + content: ""; + display: table; + clear: both; + } + + .note-color-btn { + float: left; + margin: 1px 1px 0 0; + border-color: black; + .o_alpha_button_preview(); + + &.o_small { + width: 16px; + height: 16px; + margin: 3px 3px 2px 2px; + border-radius: 50%; + } + + &.o_clear { + clear: both; + } + + &.o_btn_transparent { + display: none; + } + } + } + } +} + +.note-popover .popover, .note-editor { + .dropdown-menu { + > li > a { + > i { + visibility: hidden; + } + &.checked > i { + visibility: visible; + } + } + } + + .note-color { + .dropdown-toggle { + width: auto; + } + .o_foreground_toggle > button:before { + font-family: FontAwesome; + content: '\f1fc'; + } + .o_background_toggle > button:before { + font-family: FontAwesome; + content: '\f0c3'; + } + .dropdown-menu { + min-width: 353px!important; + } + } +} + +table.colorpicker { + width: 100%; + td { + padding: 0 2px 2px 0; + > button { + width: 100%; + border: 1px solid black; + padding: 0; + &::after { + content: "A"; + font-weight: bold; + vertical-align: sub; + } + } + } +} +.colorpicker { + background-color: @o-we-color-dark!important; + + .o_colorpicker_sections { + border: 1px solid darken(@o-we-color-dark, 12%); + border-width: 1px 0 0; + font-size: 14px; + + .o_colorpicker_section_menu { + width: 50px; + height: 100%; + float: left; + margin: 0; + padding: 0; + list-style: none; + text-align: center; + + > li { + display: block; + float: none; + margin: 0; + background-color: transparent; + > a { + display: block; + padding: 5px 10px!important; + border-radius: 0; + background-color: transparent; + color: darken(@o-we-color-text-light, 10%); + > i.fa { + font-size: 20px; + } + + &:focus, &:active, &:focus:active { + outline: none; + } + } + &:hover, &.active { + > a { + color: white; + } + } + &.active > a { + background-color: @o-we-tab-active-bg!important; + } + } + } + .o_colorpicker_section_tabs { + width: 200px; + height: 100%; + margin-left: 50px; + .tab-pane { + padding: 5px 10px; + background-color: @o-we-tab-active-bg; + } + &.o_unique_palette { + margin-left: 0; + } + } + } + .o_colorpicker_section { + &:after { + content: ""; + display: table; + clear: both; + } + + > button { + position: relative; + display: block; + width: 100%; + height: 30px; + border: 1px solid @o-we-color-dark; + border-radius: 3px; + margin: 0 0 5px; + padding: 0 20px; + line-height: 28px; + font-size: 12px; + font-weight: bold; + text-align: left; + .o_alpha_button_preview(); + + &:hover, &.selected { + box-shadow: 0px 0px 2px 2px @o-we-color-light; + } + + &:after { + content: "A"; + .o-position-absolute(0, 0); + width: 25px; + text-align: center; + font-size: 13px; + line-height: 28px; + font-weight: normal; + } + &.selected:after { + content: "\f00c"; + font-family: "FontAwesome"; + color: @brand-success; + } + + &[data-event="foreColor"] { + background-color: @o-we-color-normal; + &:after { + background-color: fade(white, 30%); + } + } + + &.o_small { + float: left; + width: auto; + min-width: 27px; + padding: 0; + margin-right: 5px; + } + + &.o_btn_transparent::before { + background-color: transparent; + } + } + } + .note-palette-title { + padding: 10px 0px 10px 10px; + color: @o-we-color-text-light; + font-weight: bold; + } + .palette-reset { + .o-position-absolute(0, 0); + margin: 0; + padding: 5px 10px 0; + .note-color-reset { + font-size: 20px!important; + color: desaturate(fade(@o-we-color-danger, 60%), 40%); + margin: 1px 0 0; + padding: 0; + cursor: pointer; + &:hover { + background: transparent!important; + color: @o-we-color-danger; + } + } + } +} + +// ENTER IN EDIT MODE +body.editor_enable { + padding-top: @odoo-navbar-height!important; + + #web_editor-top-edit { + background-color: @o-we-color-dark; + form.navbar-form { + right: 0; + } + } + + &.editor_has_snippets { + .o-transition(padding-left, 400ms, @o-we-md-ease); + padding-left: @o-we-sidebar-width!important; + + #oe_snippets { + left: 0; + } + } +} + +#web_editor_inside_iframe { + background-color: @odoo-brand-secondary; + + #wrapwrap { + position: relative; + display: table; + table-layout: fixed; + width: 100%; + height: 100%; + + > * { + display: table-row; + } + > main { + height: 100%; + + #editable_area { + position: relative; + width: 100%; + height: 100%; + background-color: white; + } + } + } +} + +// Mixins for buttons with alpha bg-color +.o_alpha_button_preview () { + position: relative; + background-image: url('/web_editor/static/src/img/transparent.png'); + background-size: 10px auto; + z-index: 1; + + // Place an overlay that inherit the button's bg-color. + &::before { + content: ""; + .o-position-absolute(0, 0, 0, 0); + z-index: -1; + background-color: inherit; + } +} + +// Animations +@keyframes fadeInDownSmall { + 0% { + opacity: 0; + .translate(0, -5px); + } + 100% { + opacity: 1; + .translate(0, 0); + } +} +@keyframes fadeInOut { + 0% { + opacity: 0; + } + 25% { + opacity: 1; + } + 75% { + opacity: 1; + } + 100% { + opacity: 0; + } +} +@keyframes inputHighlighter { + from { background: @odoo-brand-optional; } + to { width: 0; background: transparent; } +} + +// INPUTS +@o-switch-size: 2ex; +@o-switch-inactive-color: @gray-lighter; + +.o_switch { + .o-flex-display(); + .o-align-items(center); + font-weight: normal; + cursor: pointer; + + > input { + display: none; + + + span { + background-color: @o-switch-inactive-color; + box-shadow: inset 0 0 0px 1px darken(@o-switch-inactive-color,10%); + border-radius: 100rem; + height: @o-switch-size; + width: @o-switch-size * 1.8; + margin-right: 0.5em; + display: inline-block; + .transition(all 0.3s @o-we-md-ease); + + &:after { + content: ""; + background: @o-we-color-paper; + display: block; + width: @o-switch-size - 0.2; + height: @o-switch-size - 0.2; + margin-top: 0.1ex; + margin-left: 0.1ex; + border-radius: 100rem; + .transition(all 0.3s @o-we-md-ease); + box-shadow: 0 1px 1px darken(@o-switch-inactive-color,35%), inset 0 0 0 1px lighten(@o-switch-inactive-color,10%); + } + } + + &:checked + span { + box-shadow: none; + .o-linear-gradient(0deg, @o-we-color-success, darken(@o-we-color-success, 10%)); + + &:after { + margin-left: (@o-switch-size*1.8 - @o-switch-size) + 0.1; + } + } + } + &.o_switch_danger { + > input { + &:not(:checked) + span { + box-shadow: none; + .o-linear-gradient(0deg, lighten(@brand-danger, 5%), darken(@brand-danger, 5%)); + } + } + } +} + +.dropdown-menu label .o_switch { + margin: 0; + padding: 2px 0; +} + +.text-input-group { + position: relative; + margin-bottom: 45px; + + input { + font-size: 18px; + padding: 10px 10px 10px 5px; + display: block; + width: 300px; + border: none; + border-bottom: 1px solid #757575; + } + input:focus { outline: none; } + + /* LABEL ======================================= */ + label { + color: #999; + font-size: 18px; + font-weight: normal; + .o-position-absolute(@top: 10px, @left: 5px); + pointer-events: none; + .transition(0.2s ease all) + } + + /* active state */ + input:focus ~ label, input:valid ~ label { + top: -20px; + font-size: 14px; + color: #5264AE; + } + + /* BOTTOM BARS ================================= */ + .bar { position: relative; display: block; width: 300px; } + .bar:before, .bar:after { + content: ''; + height: 2px; + width: 0; + bottom: 1px; + .o-position-absolute(); + background: #5264AE; + .transition(0.2s ease all); + } + .bar:before { + left: 50%; + } + .bar:after { + right: 50%; + } + + /* active state */ + input:focus ~ .bar:before, input:focus ~ .bar:after { + width: 50%; + } + + /* HIGHLIGHTER ================================== */ + .highlight { + .o-position-absolute(@top: 25%, @left: 0); + height: 60%; + width: 100px; + pointer-events: none; + opacity: 0.5; + } + + /* active state */ + input:focus ~ .highlight { + .animation(inputHighlighter 0.3s ease); + } +} + +// DRAG&DROP ANIMATIONS +.oe_snippet_body { + opacity: 0; + .o-animation(fadeInDownSmall, 700ms, @fill-mode: forwards); +} + +// ACE EDITOR +.o_ace_view_editor { + @o-ace-color: #2F3129; + background: @o-ace-color; + color: white; + .o-flex-display(); + .o-flex-flow(column, nowrap); + opacity: 0.97; + + .o_ace_view_editor_title { + .o-flex(0, 0, auto); + .o-flex-display(); + .o-align-items(center); + padding: @grid-gutter-width/4; + + > .o_ace_type_switcher > button::after { + .o-caret-down(); + margin-left: 4px; + } + + > * { + .o-flex(0, 0, auto); + margin: 0 @grid-gutter-width/4; + + &.o_include_option { + .o-flex-display(); + .o-align-items(center); + font-size: 11px; + + > .o_checkbox { + margin-right: @grid-gutter-width/4; + } + } + + &.o_res_list { + .o-flex(1, 1, auto); + min-width: 60px; + } + } + } + #ace-view-id { + .o-flex(0, 0, auto); + padding: @grid-gutter-width/4 @grid-gutter-width/2; + background-color: lighten(@o-ace-color, 10%); + } + #ace-view-editor { + height: 70%; // in case flex is not supported + .o-flex(1, 1, auto); + .ace_gutter { + cursor: ew-resize; + + .ace_gutter-cell.o_error { + position: relative; + &::after { + .o-position-absolute(-100%, 0, -100%, 0); + .ace-line-error-mixin(); + } + } + } + .ace_resize_bar { + .o-position-absolute(@right: 0); + width: 25px; + height: 100%; + cursor: ew-resize; + } + .ace_scroller.o_error::after { + .o-position-absolute(0, auto, 0, 0); + width: 3px; + .ace-line-error-mixin(); + } + + .ace-line-error-mixin() { + content: ""; + z-index: 1000; + display: block; + background-color: @brand-danger; + opacity: 0.5; + pointer-events: none; + } + } +} +.o_ace_select2_dropdown { + width: auto!important; + padding-top: 4px; + font-family: monospace!important; + + > .select2-results { + max-height: none; + max-height: 70vh; + + .select2-result-label { + padding-top: 1px; + padding-bottom: 2px; + + >.o_ace_select2_result { + padding: 0; + font-size: 12px; + white-space: nowrap; + } + } + } +} + +// MODALS +body .modal { + // SELECT MEDIA + .o_select_media_dialog { + width: 80%; + + .modal-body { + .nav-tabs .active > a[href="#editor-media-icon"] { + background-color: white; + } + + li.search { + ul.pager li:last-child{ + margin-left: 2px; + } + .form-group { + position: relative; + margin: 0 10px 0 0; + > input { + padding-right: 30px; + } + > span { + .o-position-absolute(7px, 7px); + font-size: 1.3em; + } + } + } + + .well { + border-color: @gray-lighter; + border-top-width: 0; + } + + .o_existing_attachment_cell { + @odoo-border-image: 2px; + + .o_existing_attachment_remove { + .o-position-absolute(@odoo-border-image, 15px + @odoo-border-image); + padding: 3px 5px 5px 5px; + background-color: fade(white, 80%); + text-shadow: 0 0 1px white; + border-radius: 0 0 0 2px; + opacity: 0; + cursor: pointer; + + &:hover { + background-color: white; + color: @o-we-color-danger; + } + } + .o_image { + border: @odoo-border-image solid transparent; + cursor: pointer; + .o-transition(opacity, 400ms); + + &.o_webimage { + width: 100%; + height: auto; + background-image: none!important; + } + + &.o_image_loading { + opacity: 0; + } + } + &.o_selected .o_image { + border-color: @odoo-brand-primary; + box-shadow: 0px 0px 2px 2px @odoo-brand-secondary; + } + &:hover .o_existing_attachment_remove { + opacity: 1; + } + } + .font-icons-icons { + padding: 20px 0; + + > span { + text-align: center; + font-size: 22px; + margin: 5px; + width: 50px; + height: 50px; + padding: 15px; + cursor: pointer; + + &.o_selected { + cursor: auto; + background-color: @o-we-color-paper; + box-shadow: 0px 0px 0px 1px @o-we-color-success; + } + } + } + + #editor-media-image, #editor-media-document { + .well { + label { + margin: auto 10px; + } + + .btn-group { + margin-right: 10px; + } + } + } + + // VIDEO TAB + #editor-media-video .well { + padding: 0; + .o-flex-display(); + .o-flex-flow(row, wrap); + + .o_video_dialog_form { + .o-flex(1, 1, auto); + min-width: 0; + padding: 20px; + + #o_video_form_group { + position: relative; + width: 100%; + + > textarea { + width: 100%; + min-height: 95px; + padding-bottom: 25px; + overflow-y: scroll; + } + + > .o_validate_feedback { + .o-position-absolute(auto, 10px, 10px); + + > .fa { + display: none; + } + } + &.has-error > .o_validate_feedback > .fa-exclamation-triangle { + display: block; + } + &.has-success > .o_validate_feedback > .fa-check { + display: block; + } + } + } + + #video-preview { + position: relative; + .o-flex(1, 0, 50%); + .o-flex-display(); + .o-flex-flow(column, nowrap); + .o-justify-content(center); + + .o-we-preview-box(0 19px); + border: none; + + .media_iframe_video { + width: 100%; + } + + .o_video_dialog_iframe { + .o-we-preview-content(); + max-width: 100%; + max-height: 100%; + + &.alert { + .o-animation(fadeInDownSmall, 700ms, @fill-mode: forwards); + margin: 0 auto; + } + } + } + } + } + } + + // BACKGROUND IMAGE OPTIONS + .o_bg_img_opt_modal .o_bg_img_opt { + margin: 15px 0; + + .help-control { + .o-position-absolute(15px, 15px); + } + .help { + margin: 15px 0; + + .simulator { + position: relative; + float: left; + margin-right: 15px; + width: 120px; + height: 100px; + .bg { + .o-position-absolute(0, 0, 0, 0); + border: 1px dotted #888787; + background-image: url(/web/image); + background-position: center center; + .o-background-size(cover); + } + .el { + .o-position-absolute(10px, 0, 10px, 0); + border: 1px solid #222; + } + &.contain_bg { + .bg { + .o-position-absolute(0, 12px, 20px, 12px); + } + .el { + .o-position-absolute(0, 0, 20px, 0); + } + } + } + + * { + clear: left; + } + } + + .o_bg_img_opt_cover_edition { + .o-we-preview-box(); + + h6 { + color: white; + font-weight: bold; + } + .o_bg_img_opt_object { + position: relative; + background: white; + min-height: 10px; + .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); + .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 { + .o-position-absolute(@top: 33.33%, @left: 0); + display: block; + width: 100%; + height: 1px; + background: fadeOut(lighten(@odoo-brand-optional, 30%), 50%); + 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 { + .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 { + .o-transition(all, 0.2s); + } + &: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); + .o-transition(opacity, 0.2s); + } + } + } + } + + // LINK EDITOR DIALOG COLOR SELECTOR + .o_link_dialog { + .o_link_dialog_color > .o_link_dialog_color_item { + position: relative; + width: 30px; + height: 30px; + padding: 0; // Important for themes + border: 2px solid rgba(0, 0, 0, 0.25); + border-radius: 50%; + + input:checked + i::before { + content: "\f00c"; + .o-position-absolute(@top: 6px, @left: 5px); + } + + &.btn-link { + padding: 3px 9px; + + > span { + text-decoration: underline; + } + } + } + .o_link_dialog_preview { + border-left: 1px solid @gray-lighter; + } + } +} diff --git a/addons/web_editor/static/src/scss/web_editor.variables.scss b/addons/web_editor/static/src/scss/web_editor.variables.scss new file mode 100644 index 00000000000..40f4625c9ad --- /dev/null +++ b/addons/web_editor/static/src/scss/web_editor.variables.scss @@ -0,0 +1,202 @@ +/// +/// This files regroups the variables and mixins which are specific to the editor. +/// + +@o-we-font-family: Roboto, 'Montserrat', "Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif; + +@o-we-color-dark: #2c2c36; +@o-we-color-darker: darken(@o-we-color-dark, 2%); +@o-we-color-divider: #33363e; +@o-we-color-light: #4e525b; +@o-we-color-normal: #50545d; +@o-we-color-paper: #fcfcfc; +@o-we-color-text-normal: #999999; +@o-we-color-text-light: #d4d5d7; +@o-we-color-danger: #e6586c; +@o-we-color-warning: #f0ad4e; +@o-we-color-success: #40ad67; +@o-we-color-info: #6999a8; + +@o-we-sidebar-width: 210px; + +@o-we-tab-active-bg: #3D4048; + +// Transitions +@o-we-md-ease: cubic-bezier(0.19, 1, 0.22, 1); + +// ============ 'Preview' component Mixins =============== +// Create a "preview" work-area to edit/customize specific elements + +.o-we-preview-box(@padding: 0px 25px 25px 25px, @color-text: white) { + padding: @padding; + border-top: 1px solid black; + border-bottom: 1px solid white; + .o-linear-gradient(-150deg, @o-we-color-dark, @o-we-color-darker); + + color: @color-text; +} + +.o-we-preview-content() { + display: inline-block; + max-width: 100%; + overflow: hidden; + box-shadow: 0 0 15px 2px #000; +} + + +// ============ Preservetion mixins =============== +// Used to preserve web_editor and website UI from themes customizations + +.o-w-preserve-base() { + font-family: @o-we-font-family; + line-height: 1.42857143; + color: @o-we-color-divider; + + .text-muted { + color: @o-we-color-text-normal; + } +} + +.o-w-preserve-headings() { + h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { + font-family: @o-we-font-family; + line-height: 1.42857143; + color: @o-we-color-dark; + font-weight: bold; + } +} + +.o-w-preserve-links() { + a:not(.o_btn_preview) { + color: @odoo-brand-optional; + + &:focus, &:active, &:focus:active { + outline: none!important; + } + } + + .label { + &:hover a, a { + color: #fff; + } + } +} + +.o-w-preserve-forms() { + .form-control { + height: 34px; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + border: 1px solid @o-we-color-text-light; + color: #555; + background-color: #fff; + border-radius: 0; + } + + .has-error { + .form-control { + border-color: @state-danger-text; + } + } + + select.form-control { + .o-appearance(none); + background: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPScxLjEnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZycgeG1 sbnM6eGxpbms9J2h0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsnIHdpZHRoPScyNCcgaGVpZ2 h0PScyNCcgdmlld0JveD0nMCAwIDI0IDI0Jz48cGF0aCBpZD0nc3ZnXzEnIGQ9J203LjQwNiw3L jgyOGw0LjU5NCw0LjU5NGw0LjU5NCwtNC41OTRsMC40MDYsMS40MDZsLTUsNC43NjZsLTUsLTQu NzY2bDAuNDA2LC0xLjQwNnonIGZpbGw9JyM4ODgnLz48L3N2Zz4='); + background-position: 100% 65%; + background-repeat: no-repeat; + } +} + +.o-w-preserve-modals() { + background: 0; + + .modal-content { + border-radius: 0; + background-color: @o-we-color-paper; + + .modal-body { + background-color: white; + } + .modal-footer { + text-align: left; + } + } +} + +.o-w-preserve-tabs() { + .nav-tabs { + border-bottom: 1px solid @gray-lighter; + + > li { + > a { + line-height: 1.42857143; + color: @o-we-color-light; + &:hover { + border-color: @gray-lighter; + } + } + + &.active > a { + &, &:hover, &:focus { + color: @o-we-color-normal; + background-color: @o-we-color-paper; + border-color: @gray-lighter; + border-bottom-color: transparent; + } + } + } + } +} + +.o-w-preserve-btn() { + .btn:not(.o_btn_preview) { + border-width: 1px; + border-radius: 0; + font-weight: normal; + .button-size(6px; 12px; 14px; 1.42857143; 0); + + &.btn-primary { + .button-variant(white, @odoo-brand-optional, darken(@odoo-brand-optional,5%)); + } + &.btn-default { + .button-variant(@o-we-color-normal, white, @o-we-color-text-light); + } + &.btn-link { + .button-variant(@odoo-brand-optional, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)); + } + &.btn-success { + .button-variant(white; @o-we-color-success; darken(@o-we-color-success, 5%)); + } + &.btn-info { + .button-variant(white; @o-we-color-info; darken(@o-we-color-info, 5%)); + } + &.btn-warning { + .button-variant(white; @o-we-color-warning; darken(@o-we-color-warning, 5%)); + } + &.btn-danger { + .button-variant(white; @o-we-color-danger; darken(@o-we-color-danger, 5%)); + } + + &.btn-lg { + .button-size(10px; 16px; 18px; 1.3333333; 0); + } + &.btn-sm { + .button-size(5px; 10px; 12px; 1.5; 0); + } + &.btn-xs { + .button-size(1px; 5px; 12px; 1.5; 0); + } + } +} + +.o-w-preserve-wells() { + .well { + padding: 19px; + margin-bottom: 20px; + background-color: @o-we-color-paper; + border: 1px solid darken(@o-we-color-paper,5%); + border-radius: 0; + .box-shadow(none); + } +} |
