Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compact drop down and button styles #226

Merged
merged 3 commits into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions app/assets/stylesheets/_honeycrisp-compact.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,46 @@
.honeycrisp-compact {
font-size: $font-size-19;
line-height: $s19;

.data-table {
font-size: inherit;
th, td {
padding: $s15;
}
}

.form-question {
margin-bottom: $s15;
}

.button {
line-height: 2rem;
padding: $s10;
margin-top: 0;
margin-left: $s10;
margin-right: $s10;
margin-bottom: 2rem;
font-weight: normal;
border-width: 1px;
box-shadow: 0 1px 0px rgba(#000, .5);
border-radius: $border-radius;
font-size: $font-size-25-small;
[class^="icon-"], [class*=" icon-"] {
vertical-align: 0;
}
}

.select {
line-height: 4.6rem;
height: 4.6rem;
&:after {
width: 4.2rem;
}
}
.select__element {
font-size: $font-size-25-small;
font-weight: normal;
border: 1px solid $color-grey-darkest;
padding: 0 4.2rem 0 $s15;
}
}
8 changes: 8 additions & 0 deletions app/views/cfa/styleguide/pages/honeycrisp_compact.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<% content_for(:template_name) { "styleguide" } %>

<% content_for :subnavigation do %>

<li class="spacing-below-0">
<span class="section-header heading-25-small spacing-below-10">Atoms</span>
<ul class="sidebar__sub-items spacing-below-10">
<li class="spacing-below-25"><%= link_to "Buttons", styleguide_honeycrisp_compact_path(anchor: "honeycrisp_compact-buttons") %></li>
<li class="spacing-below-25"><%= link_to "Form Elements", styleguide_honeycrisp_compact_path(anchor: "honeycrisp_compact-form_elements") %></li>
</ul>
<span class="section-header heading-25-small spacing-below-10">Molecules</span>
<ul class="sidebar__sub-items spacing-below-10">
<li class="spacing-below-25"><%= link_to "Data Table", styleguide_honeycrisp_compact_path(anchor: "honeycrisp_compact-data_table") %></li>
Expand All @@ -26,4 +32,6 @@
</div>
</section>

<%= render 'section', title: 'Buttons', example: 'honeycrisp_compact/buttons' %>
<%= render 'section', title: 'Form Elements', example: 'honeycrisp_compact/form_elements' %>
<%= render 'section', title: 'Data Table', example: 'honeycrisp_compact/data_table' %>
19 changes: 19 additions & 0 deletions app/views/examples/honeycrisp_compact/_buttons.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="honeycrisp-compact">
<div class="h4">Compact</div>
<div>
<button class="button button--primary">Primary Button</button>
<button class="button button--primary button--disabled" disabled>Disabled Primary Button</button>
</div>
<div>
<button class="button">Button</button>
<button class="button button--disabled" disabled>Disabled Button</button>
</div>
<div>
<button class="button button--danger">Danger Button</button>
<button class="button button--danger button--disabled" disabled>Disabled Danger Button</button>
</div>
<div>
<button class="button">Button with icon<i class="button__icon icon-arrow_forward"></i></button>
<button class="button"><i class="button__icon--left icon-arrow_back"></i>Button with icon</button>
</div>
</div>
11 changes: 11 additions & 0 deletions app/views/examples/honeycrisp_compact/_form_elements.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div class="honeycrisp-compact">
<label for="apple_quality" class="form-question">What's your favorite apple quality?</label>
<div class="select">
<select class="select__element" name="apple_quality" id="apple_quality">
<option selected disabled>Choose a selection</option>
<option value="crisp">Crisp</option>
<option value="sweet">Sweet</option>
<option value="tart">Tart</option>
</select>
</div>
</div>