Skip to content

Commit f903ffa

Browse files
committed
styling adjustments on the color palette editor
1 parent 53295b1 commit f903ffa

File tree

2 files changed

+39
-16
lines changed

2 files changed

+39
-16
lines changed

app/assets/javascripts/admin/addon/components/color-palette-editor.gjs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,17 @@ const Picker = class extends Component {
126126
{{on "input" this.onInput}}
127127
{{on "change" this.onChange}}
128128
/>
129-
{{icon "hashtag"}}
130-
<input
131-
class="color-palette-editor__text-input"
132-
type="text"
133-
maxlength="6"
134-
value={{this.displayedColor}}
135-
{{on "keypress" this.onTextKeypress}}
136-
{{on "change" this.onTextChange}}
137-
/>
129+
<div class="color-palette-editor__input-wrapper">
130+
{{icon "hashtag" class="color-palette-editor__icon"}}
131+
<input
132+
class="color-palette-editor__text-input"
133+
type="text"
134+
maxlength="6"
135+
value={{this.displayedColor}}
136+
{{on "keypress" this.onTextKeypress}}
137+
{{on "change" this.onTextChange}}
138+
/>
139+
</div>
138140
</template>
139141
};
140142

app/assets/stylesheets/admin/color-palette-editor.scss

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,52 @@
4040

4141
&__picker {
4242
display: flex;
43-
justify-content: center;
4443
align-items: center;
45-
padding: 5px 10px;
46-
gap: 5px;
44+
gap: var(--space-2);
45+
padding: var(--space-2);
4746
border: 1px solid var(--primary-low);
47+
border-radius: var(--d-input-border-radius);
4848

49-
.d-icon-hashtag {
50-
color: var(--primary-high);
51-
font-size: var(--font-down-2);
49+
&:focus-within {
50+
border-color: var(--tertiary);
51+
outline: 2px solid var(--tertiary);
52+
outline-offset: -2px;
5253
}
5354
}
5455

56+
&__input-wrapper {
57+
position: relative;
58+
display: flex;
59+
align-items: center;
60+
}
61+
62+
&__icon {
63+
position: absolute;
64+
pointer-events: none;
65+
color: var(--primary-medium);
66+
font-size: var(--font-down-2);
67+
}
68+
5569
&__revert.--hidden {
5670
visibility: hidden;
5771
}
5872

5973
input[type="color"] {
6074
width: 23px;
6175
height: 23px;
76+
border-radius: 100px;
6277
}
6378

6479
input[type="text"] {
6580
font-family: monospace;
6681
margin: 0;
67-
width: 5em;
82+
width: 4.5rem;
83+
padding-left: var(--space-4);
84+
border: none;
85+
86+
&:focus {
87+
outline: none;
88+
}
6889
}
6990

7091
&__color-code {

0 commit comments

Comments
 (0)