Flatten every form button, not only the submit input - #53
Merged
Merged
Conversation
ActiveAdmin applies its gradient `dark-button` mixin to three form
elements at once:
form { input[type=submit], input[type=button], button { ... } }
The theme's flat override named only `input[type=submit]`, plus the very
narrow `fieldset.actions > ol > li.button_action > button`. A custom
`<button>` or `<input type="button">` placed in a form therefore fell
through to ActiveAdmin's rule and kept the gradient, the bevelled border
and the text shadow, next to a flat submit button.
Mirror ActiveAdmin's own selector list so the override covers the same
three elements. The narrow `button_action` selector is dropped: it is a
strict subset of `form button`, which now wins by source order.
Buttons outside a form are left alone on purpose — those are the
dropdown and table-tool controls the theme styles deliberately
elsewhere, not the ones the report is about.
Fixes #25
Fivell
added a commit
to yeti-switch/active_admin_theme
that referenced
this pull request
Oct 2, 2026
Brings in activeadmin-plugins#53: the flat button rule now covers form input[type=button] and form button, not only the submit input. No conflict — this branch does not touch that selector.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The defect
A custom button placed in an ActiveAdmin form keeps ActiveAdmin's stock
gradient, bevelled border and text shadow, sitting next to a flat themed
submit button. Reported in #25.
Cause
ActiveAdmin applies its
dark-buttonmixin to three form elements at once:The theme's flat override named only
form input[type=submit], plus the verynarrow
fieldset.actions > ol > li.button_action > button. Anything else —a plain
<button>, an<input type="button">— fell through to ActiveAdmin'srule.
The change
One selector list, mirroring ActiveAdmin's own:
The
button_actionselector is dropped because it is a strict subset ofform button, which now wins by source order.Buttons outside a form are deliberately left alone: those are the dropdown
and table-tool controls the theme styles separately, not what the report is
about.
Before / after
A form whose
fieldset.actionsholds the normal submit next to a<button type="button">and an<input type="button">, neither carrying atheme class.
Before:
After:
Screenshots are taken against a generated ActiveAdmin 3.5 admin. Of sixteen
scenarios shot across the two revisions, only the two form cases changed;
menu, title bar, index table, table tools, pagination, filter sidebar and
show page are byte-identical.
rake csspasses: 8 override configurations compile clean, 6 bad onesrejected.
Fixes #25