Skip to content

Image Cropper: Improve contrast of append label in crop options editor (closes #22878)#22917

Merged
AndyButland merged 1 commit into
umbraco:v17/devfrom
andreaslborg:v17/bugfix/22878-append-contrast-fix
May 21, 2026
Merged

Image Cropper: Improve contrast of append label in crop options editor (closes #22878)#22917
AndyButland merged 1 commit into
umbraco:v17/devfrom
andreaslborg:v17/bugfix/22878-append-contrast-fix

Conversation

@andreaslborg

Copy link
Copy Markdown
Contributor

Description

Suggestion fix for #22878

The px append 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-alt and --uui-color-text to match the styling used by the UUI library's own input component.

Before:
image

After:
image

Dark mode:
image

Testing

  1. Open the Image Cropper property editor
  2. Create a crop option under Settings
  3. See the contrast in the append

@github-actions

Copy link
Copy Markdown

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:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

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 AndyButland changed the base branch from main to v17/dev May 21, 2026 16:48

@AndyButland AndyButland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better, and improves accessibility. Thanks @andreaslborg.

@AndyButland AndyButland reopened this May 21, 2026
@AndyButland AndyButland changed the title Input append: Improve contrast of append label in image crops editor (closes #22878) Image Cropper: Improve contrast of append label in crop options editor (closes #22878) May 21, 2026
@AndyButland AndyButland enabled auto-merge (squash) May 21, 2026 17:05
@AndyButland AndyButland disabled auto-merge May 21, 2026 17:05
@AndyButland AndyButland merged commit 609b74b into umbraco:v17/dev May 21, 2026
41 of 46 checks passed
AndyButland pushed a commit that referenced this pull request May 21, 2026
closes #22878) (#22917)

Improve contrast of input append label in image crops editor
AndyButland pushed a commit that referenced this pull request May 21, 2026
closes #22878) (#22917)

Improve contrast of input append label in image crops editor
@AndyButland

Copy link
Copy Markdown
Contributor

Cherry picked to release/17.5.0 and release/18.0.

@bjarnef

bjarnef commented May 21, 2026

Copy link
Copy Markdown
Contributor

@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:

:host {
	display: inline-flex;
	align-items: stretch;
}

::slotted(umb-input-addon:first-child) {
	border-radius: 4px 0 0 4px;
}

::slotted(uui-input) {
	border-radius: 0;
}

::slotted(umb-input-addon:last-child) {
	border-radius: 0 4px 4px 0;
}

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:
https://uui.umbraco.com/?path=/story/uui-input--prepend-and-append

It would be great if it was easier to inherit the addon styles and just override via CSS variables, e.g. in themes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants