Skip to content

Commit d20ee99

Browse files
committed
Improve the behavior and visuals of the color picker button
1 parent c23d828 commit d20ee99

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

com.woltlab.wcf/templates/shared_colorFormField.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
44
</span>
55
{else}
6-
<a href="#" class="colorPickerButton jsTooltip" id="{$field->getPrefixedId()}_colorPickerButton" title="{lang}wcf.style.colorPicker.button.changeColor{/lang}" data-store="{$field->getPrefixedId()}">
7-
<span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
8-
</a>
6+
<button type="button" class="colorPickerButton jsTooltip" id="{$field->getPrefixedId()}_colorPickerButton" title="{lang}wcf.style.colorPicker.button.changeColor{/lang}" data-store="{$field->getPrefixedId()}">
7+
<span class="colorPickerButton__color"{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
8+
</button>
99
<input type="hidden" {*
1010
*}id="{$field->getPrefixedId()}" {*
1111
*}name="{$field->getPrefixedId()}" {*

wcfsetup/install/files/style/ui/colorPicker.scss

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,18 @@
1818
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEX////MzMw46qqDAAAAD0lEQVQI12P4z4Ad4ZAAAH6/D/Hgw85/AAAAAElFTkSuQmCC);
1919
border: 1px solid rgba(0, 0, 0, 1);
2020
box-sizing: content-box;
21-
display: block;
21+
display: flex;
2222
min-height: 50px;
23-
24-
> span {
25-
display: block;
26-
}
2723
}
2824

2925
.colorPickerButton {
30-
height: 32px;
26+
border-radius: var(--wcfBorderRadius);
27+
overflow: hidden;
3128
width: 50px;
29+
}
3230

33-
> span {
34-
height: 32px;
35-
}
31+
.colorPickerButton__color {
32+
flex: 1 auto;
3633
}
3734

3835
.colorPickerComparison {

0 commit comments

Comments
 (0)