From a748a2dc88c75c9eee3aa54f32247d8ee17bd575 Mon Sep 17 00:00:00 2001 From: Stephan Tittel Date: Tue, 8 Oct 2024 10:37:43 +0200 Subject: [PATCH] higlight required form fields in material design --- src/themes/material.css | 2 ++ src/themes/material.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/themes/material.css b/src/themes/material.css index a76b344..9e642d0 100644 --- a/src/themes/material.css +++ b/src/themes/material.css @@ -10,3 +10,5 @@ mdui-text-field::part(input) { } form.mode-edit { --label-width: 0em; } .property-instance { margin-bottom:14px; } +.mode-edit .property-instance *[required]::part(icon) { align-self: flex-start; padding-top: 0.7em; } +.mode-edit .property-instance *[required]::part(icon)::before { color: red; content: '\2736'; font-size: 0.6em; } \ No newline at end of file diff --git a/src/themes/material.ts b/src/themes/material.ts index cb50e49..cf1833f 100644 --- a/src/themes/material.ts +++ b/src/themes/material.ts @@ -93,6 +93,7 @@ export class MaterialTheme extends Theme { editor.variant = 'outlined' editor.label = label editor.helper = template?.description?.value + editor.clearable = true // @ts-ignore const result = this.createDefaultTemplate('', null, required, editor, template) let addEmptyOption = true