Image Cropper: Improve contrast of append label in crop options editor (closes #22878)#22917
Conversation
|
Hi there @andreaslborg, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
AndyButland
left a comment
There was a problem hiding this comment.
Looks much better, and improves accessibility. Thanks @andreaslborg.
|
Cherry picked to |
|
@AndyButland in addition to this, I wonder if we could have a structure like the following, which makes it simpler to re-use the "addons", without copying the styles and if changes are made later. It could look similar to this: <umb-input-group>
<umb-input-addon slot="prepend">px</umb-input-addon>
<uui-input
label="Height"
id="height"
name="height"
type="number"
autocomplete="false"
required
.value=${initial?.height ?? ''}
min="0">
</uui-input>
<umb-input-addon slot="append">px</umb-input-addon>
</umb-input-group>import { LitElement, css, html } from 'lit';
import { customElement } from 'lit/decorators.js';
@customElement('umb-input-group')
export class UmbInputGroupElement extends LitElement {
static styles = css`
:host {
display: flex;
align-items: stretch;
}
::slotted(uui-input) {
flex: 1;
}
`;
render() {
return html`
<slot name="prepend"></slot>
<slot></slot>
<slot name="append"></slot>
`;
}
}import { LitElement, css, html } from 'lit';
import { customElement } from 'lit/decorators.js';
@customElement('umb-input-addon')
export class UmbInputAddonElement extends LitElement {
static styles = css`
:host {
padding-inline: var(--uui-size-space-4);
background: var(--uui-color-surface-alt);
border-left: 1px solid var(--uui-color-border);
color: var(--uui-color-text);
font-size: var(--uui-type-small-size);
display: flex;
align-items: center;
}
`;
render() {
return html`<slot></slot>`;
}
}Some extra which could be added: but it could possible also be part of UI library. By default there is no standard styling of prepend/append, so up to the developer what they like: It would be great if it was easier to inherit the addon styles and just override via CSS variables, e.g. in themes. |
Description
Suggestion fix for #22878
The
pxappend label in the image crops property editor (and media picker local crops) was styled using--uui-color-disabled/--uui-color-disabled-contrast, which produced poor contrast between the text and background.Updated to use
--uui-color-surface-altand--uui-color-textto match the styling used by the UUI library's own input component.Before:

After:

Dark mode:

Testing