Skip to content

Commit cf8a24e

Browse files
feat: update global text field disabled state
1 parent d004c67 commit cf8a24e

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

static/css/v3/forms.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,27 @@
216216
.field__control--disabled,
217217
.field__control--disabled:hover,
218218
.field__control--disabled:focus-within {
219-
opacity: 0.5;
219+
background-color: var(--color-surface-mid, #f7f7f8);
220+
border-color: var(--color-stroke-strong, #05081640);
220221
cursor: not-allowed;
221222
}
222223

224+
.field__control--disabled .field__input,
225+
.field__control--disabled .field__input::placeholder,
226+
.field__control--disabled:hover .field__input::placeholder {
227+
color: var(--color-text-secondary, #6b6d78);
228+
}
229+
223230
.field__control--disabled .field__input {
224231
cursor: not-allowed;
225232
}
226233

234+
.field__control--disabled .field__icon,
235+
.field__control--disabled:hover .field__icon,
236+
.field__control--disabled:focus-within .field__icon {
237+
color: var(--color-icon-secondary, #6b6d78);
238+
}
239+
227240
/* ========== Datetime-local: hide native icon, full-area click ========== */
228241
.field__control--datetime {
229242
position: relative;

templates/v3/includes/_field_text.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@
109109
aria-describedby="field-{{ name }}-help"
110110
{% endif %}
111111
{% if validate_type == "email" %}x-model="value" @blur="touched = true"{% elif submit_icon %}x-model="q" {% if dispatch_field_change %}@input.debounce.150ms="$dispatch('field-change', { name: '{{ name }}', value: q })"{% endif %}{% elif max_chars %}x-model="value"{% endif %}>
112-
{% if submit_icon %}
112+
{% if disabled %}
113+
<span class="field__icon" aria-hidden="true">
114+
{% include "includes/icon.html" with icon_name="lock" icon_class="field__icon" icon_size=16 icon_viewbox="0 0 16 16" %}
115+
</span>
116+
{% elif submit_icon %}
113117
<button type="submit"
114118
class="field__submit"
115119
aria-label="{{ submit_label|default:'Submit' }}"

0 commit comments

Comments
 (0)