Skip to content

Commit df0f392

Browse files
committed
[IMP] website: adapt snippet_background_edition tour
1 parent 63be924 commit df0f392

File tree

6 files changed

+104
-137
lines changed

6 files changed

+104
-137
lines changed

addons/html_editor/static/src/main/font/color_plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import {
2121
isCSSColor,
2222
RGBA_REGEX,
2323
rgbaToHex,
24-
COLOR_COMBINATION_CLASSES_REGEX,
2524
} from "@web/core/utils/colors";
25+
import { COLOR_COMBINATION_CLASSES_REGEX } from "@html_editor/utils/color";
2626
import { ColorSelector } from "./color_selector";
2727

2828
const RGBA_OPACITY = 0.6;

addons/web/static/src/core/color_picker/color_picker.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,12 @@
6060
margin-left: 2px;
6161
}
6262

63-
.o_font_color_selector .o_color_button.selected {
63+
.o_font_color_selector {
6464
// todo: check web_editor
65-
border: 3px solid $o-enterprise-action-color;
65+
.o_color_button.selected,
66+
.o_custom_gradient_button.selected {
67+
border: 3px solid $o-enterprise-action-color !important;
68+
}
6669
}
6770
// custom gradients
6871
.custom-gradient-configurator {

addons/web/static/src/core/color_picker/color_picker.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@
114114
<t t-if="state.activeTab==='gradient'">
115115
<div class="o_colorpicker_sections p-2" t-on-click="onColorApply" t-on-mouseover="onColorHover" t-on-mouseout="onColorHoverOut" t-on-focusin="onColorFocusin">
116116
<t t-foreach="this.DEFAULT_GRADIENT_COLORS" t-as="gradient" t-key="gradient">
117-
<button class="w-50 m-0 o_color_button o_gradient_color_button btn" t-attf-style="background-image: #{gradient};" t-att-data-color="gradient"/>
117+
<button class="w-50 m-0 o_color_button o_gradient_color_button btn" t-att-class="{'selected': getCurrentGradientColor()?.includes(gradient)}" t-attf-style="background-image: #{gradient};" t-att-data-color="gradient"/>
118118
</t>
119119
</div>
120120
<div class="px-2">
121-
<button t-attf-style="background-image: {{ getCurrentGradientColor() }};" class="w-50 border btn mb-2 o_custom_gradient_button" t-on-click="this.toggleGradientPicker" title="Define a custom gradient">Custom</button>
121+
<button t-attf-style="background-image: {{ getCurrentGradientColor() }};" class="w-50 border btn mb-2 o_custom_gradient_button" t-att-class="{'selected': getCurrentGradientColor() &amp;&amp; !this.DEFAULT_GRADIENT_COLORS.includes(getCurrentGradientColor())}" t-on-click="this.toggleGradientPicker" title="Define a custom gradient" t-att-data-color="getCurrentGradientColor()">Custom</button>
122122
<GradientPicker t-if="state.showGradientPicker" onGradientChange.bind="applyColor" selectedGradient="getCurrentGradientColor()"/>
123123
</div>
124124
</t>

addons/web/static/src/core/color_picker/gradient_picker/gradient_picker.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
<div class="gradient-colors">
9292
<div t-foreach="this.colors" t-as="color" t-key="color_index">
9393
<input type="range" min="0" max="100" t-att-value="color.percentage"
94+
t-att-class="{'active': this.state.currentColorIndex === color_index}"
9495
t-attf-name="custom gradient percentage color #{color_index+1}"
9596
t-on-click="() => this.state.currentColorIndex = color_index"
9697
t-on-change="(ev) => this.onColorPercentageChange(color_index, ev)" />

0 commit comments

Comments
 (0)