From c16b8d1ee3a5ef1d622f9470738e89d73dbb8f1b Mon Sep 17 00:00:00 2001 From: Paul B Date: Fri, 16 Apr 2021 14:46:17 +0200 Subject: [PATCH] css: isolate spacing properties for 'button--alt' class (#1956) When customising your own admin dashboards, it is quite expected to use consistent graphical elements (such as buttons) in custom pages. Exposing a `button--alt` CSS class is helpful when adding some custom buttons, however the existing CSS class includes some spacing properties which is specific to the navigation bar (because this class is only used there in the Administrate engine). This commit moves the spacing property (margin) into a dedicated `.button--nav` class in order to give the `.button--alt` class a reusable role. --- app/assets/stylesheets/administrate/components/_buttons.scss | 3 +++ app/views/administrate/application/_navigation.html.erb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/administrate/components/_buttons.scss b/app/assets/stylesheets/administrate/components/_buttons.scss index 6ac025cd88..d05fe5881e 100644 --- a/app/assets/stylesheets/administrate/components/_buttons.scss +++ b/app/assets/stylesheets/administrate/components/_buttons.scss @@ -47,5 +47,8 @@ input[type="submit"], border: $base-border; border-color: $blue; color: $blue; +} + +.button--nav { margin-bottom: $base-spacing; } diff --git a/app/views/administrate/application/_navigation.html.erb b/app/views/administrate/application/_navigation.html.erb index 664c2415f5..670aab66eb 100644 --- a/app/views/administrate/application/_navigation.html.erb +++ b/app/views/administrate/application/_navigation.html.erb @@ -8,7 +8,7 @@ as defined by the routes in the `admin/` namespace %>