Skip to content

Commit

Permalink
Generalize CSS on atomic form
Browse files Browse the repository at this point in the history
Why?
Currently the button & form styles are coded to be applied to a 'page'
specific form, selected by id: "form#edit_page". This makes it
difficult to have multiple models in a project that are editable as
atomic CMS componenets

How?
We added another class selector to the form styles
"form.edit-atomic-content" that users can apply to their parent form
and inherit all atomic button styles.
Also, updated Readme to reflect these changes

Side Effects?
There should not be any side effects.
  • Loading branch information
bbrock25 committed Oct 19, 2015
1 parent f4f6036 commit 738dc03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ ActiveAdmin.register Page do
actions
end

form do |f|
form html: { class: "edit-atomic-content" } do |f|
f.semantic_errors(*f.object.errors.keys)

# new form
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/atomic_cms.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}

#wrapper #active_admin_content #main_content_wrapper #main_content {
form#edit_page {
form#edit-page, form.edit-atomic-content {
div.buttons {
@include clearfix;
margin: 0 0 20px;
Expand Down

0 comments on commit 738dc03

Please sign in to comment.