Skip to content

Commit

Permalink
Adjust styles for panels
Browse files Browse the repository at this point in the history
This makes the assumption that panels are often stacked, rather than
inline.

A panel which appears between a set of radio buttons must have a margin
on the bottom of it, this is 15px (set for all panels).

Add a top margin, so that there is a gap between a form control and the
panel (but so that the two appear associated).

Add extra spacing above a panel if it is the first panel in a group,
the last panel in a group or if it is inline.

Remove any bottom margin or padding, as any content inside the panel
should sit flush with the bottom of the panel.
  • Loading branch information
gemmaleigh committed Jun 2, 2016
1 parent 0fb0f46 commit e4f47e0
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion public/sass/elements/_panels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// ==========================================================================

.panel {
@include box-sizing(border-box);
@extend %contain-floats;
clear: both;
border-left-style: solid;
Expand Down Expand Up @@ -30,7 +31,31 @@
}

// Panels within form groups
// Remove the bottom padding as .form-group sets a bottom margin
// By default, panels have 15px bottom margin
.form-group .panel-border-narrow {
float: left;
width: 100%;
// Remove the bottom padding as .form-group sets a bottom margin
padding-bottom: 0;
// Don't remove the bottom margin for all panels, assume they are often within stacked groups
}

// Note: This is incredibly fragile, and needs rebuilding.

// The first panel in a group
.form-group .panel-border-narrow:first-child {
margin-top: 10px;
}

// The last panel in a group
.form-group .panel-border-narrow:last-child {
margin-top: 10px;
margin-bottom: 0;
}

// For inline panels
.inline .form-group .panel-border-narrow {
margin-top: 10px;
margin-bottom: 0;
}

0 comments on commit e4f47e0

Please sign in to comment.