Move input styles to form stylesheet

A better way to arrange it, and as a bonus it makes the selectors simpler, yay!
This commit is contained in:
David Cook
2024-02-21 16:03:10 +11:00
parent 2ef9e34f28
commit 958288b223
3 changed files with 19 additions and 18 deletions

View File

@@ -53,7 +53,8 @@
%th.align-right= t('admin.products_page.columns.actions')
- products.each_with_index do |product, product_index|
= form.fields_for("products", product, index: product_index) do |product_form|
%tbody.relaxed{ data: { 'record-id': product_form.object.id, controller: "nested-form",
%tbody.relaxed.naked_inputs{ data: { 'record-id': product_form.object.id,
controller: "nested-form",
action: 'nested-form:add->bulk-form#registerElements' } }
%tr
= render partial: 'product_row', locals: { product:, f: product_form }

View File

@@ -73,7 +73,7 @@
}
// Row hover
tr:hover {
tbody tr:hover {
td {
background-color: $light-grey;
position: relative;
@@ -89,6 +89,11 @@
}
}
// "Naked" inputs. Row hover helps reveal them.
input:not([type="checkbox"]) {
background-color: $color-tbl-cell-bg;
}
// Reveal naked button text when any part of row is hovered
button.naked {
color: $color-link;
@@ -163,22 +168,6 @@
label {
margin: 0;
}
// "Naked" inputs. Row hover helps reveal them.
tbody {
input:not([type="checkbox"]) {
background-color: $color-tbl-cell-bg;
height: auto;
font-size: inherit;
font-weight: inherit;
}
:not(.field_with_errors) > {
input:not([type="checkbox"]):not(:focus):not(.changed):not([disabled]) {
border-color: transparent;
}
}
}
}
#no-products {

View File

@@ -23,6 +23,17 @@ fieldset {
font-size: 14px;
line-height: 22px;
// Appears just like other text on the page.
// See table.products tr:hover for example of revealing them
.naked_inputs & {
background-color: inherit;
height: auto;
font-size: inherit;
font-weight: inherit;
border-color: transparent;
}
&:focus {
outline: none;
border-color: $color-txt-hover-brd;