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

Some opinionated moves based on using bitters a couple times #2

Closed
wants to merge 3 commits into from
Closed
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
5 changes: 5 additions & 0 deletions application.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import "normalize";
@import "bourbon";
@import "base/grid-settings";
@import "neat";
@import "base/base";
1 change: 0 additions & 1 deletion bitters/_base.scss → base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
@import "forms";
@import "tables";
@import "lists";
@import "layout";
@import "flashes";
6 changes: 0 additions & 6 deletions bitters/_flashes.scss → base/_flashes.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
///////////////////////////////////////////////////////////////////////////////
//
// Base Flash Styles for Rails Projects
//
///////////////////////////////////////////////////////////////////////////////

/* Success, error & notice boxes for messages and errors. */
div.error, div.notice, div.success, #flash_failure, #flash_success, #flash_notice {
margin-bottom: .75em;
Expand Down
50 changes: 15 additions & 35 deletions bitters/_forms.scss → base/_forms.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
///////////////////////////////////////////////////////////////////////////////
//
// Base Form Styles
//
///////////////////////////////////////////////////////////////////////////////

$form-border-color: $base-border-color;
$form-border-color-hover: darken($base-border-color, 10%);
$form-border-color-focus: $blue; //blue default
$form-border-radius: 3px;
$form-box-shadow-focus: darken($form-border-color-focus, 5%);
$form-font-size: $base-font-size;
$form-font-family: $lucida-grande;
$form-width: em(300);

fieldset {
background: #f1f1f1;
border: 1px solid lighten($base-border-color, 20%);
background: lighten($base-border-color, 10);
border: 1px solid $base-border-color;
margin: 0 0 $base-line-height 0;
padding: $base-line-height $base-line-height ($base-line-height * .75) $base-line-height;
}
Expand All @@ -24,8 +9,8 @@ input,
label,
select {
display: block;
font-family: $form-font-family;
font-size: $form-font-size;
font-family: $base-font-family;
font-size: $base-font-size;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the removal of all these $form variables.

}

label {
Expand All @@ -44,24 +29,23 @@ label {
textarea,
#{$all-text-inputs} {
background-color: white;
border: 1px solid $form-border-color;
border-radius: $form-border-radius;
border: 1px solid $base-border-color;
box-shadow: inset 0px 1px 3px hsla(0, 0%, 0%, 0.06);
@include box-sizing(border-box);
font-family: $form-font-family;
font-size: $form-font-size;
font-family: $base-font-family;
font-size: $base-font-size;
margin-bottom: $base-line-height * .5;
padding: ($base-line-height * .5) ($base-line-height * .5);
@include transition(border-color);
width: $form-width;
width: 100%;

&:hover {
border-color: $form-border-color-hover;
border-color: darken($base-border-color, 10%);
}

&:focus {
border-color: $form-border-color-focus;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 0 5px rgba($form-box-shadow-focus, 0.7);
border-color: $base-accent;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 0 5px rgba(darken($base-accent, 5%), 0.7);
outline: none;
}
}
Expand All @@ -86,17 +70,13 @@ input[type="checkbox"], input[type="radio"] {
}

select {
width: $form-width;
width: 100%;
margin-bottom: $base-line-height * 1.5;
}

button,
input[type="submit"] {
@include button(simple, #fafafa);

// Button Overrides
border-color: #BBB;
box-shadow: 0 1px 1px hsla(0, 0%, 0%, 0.06);
font-size: $form-font-size;
padding: 0.7em 1.9em;
@include button(simple, $base-accent);
font-size: 1em;
-webkit-font-smoothing: antialiased;
}
4 changes: 4 additions & 0 deletions base/_grid-settings.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$column: 90px;
$gutter: 30px;
$grid-columns: 12;
$max-width: em(1088);
6 changes: 0 additions & 6 deletions bitters/_lists.scss → base/_lists.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
///////////////////////////////////////////////////////////////////////////////
//
// Base List Styles
//
///////////////////////////////////////////////////////////////////////////////

ul, ol {
list-style-position: outside;
margin-bottom: $base-line-height * .5;
Expand Down
8 changes: 1 addition & 7 deletions bitters/_tables.scss → base/_tables.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
///////////////////////////////////////////////////////////////////////////////
//
// Base Table Styles
//
///////////////////////////////////////////////////////////////////////////////

table {
margin: ($base-line-height * .5) 0;
width: 100%;
Expand All @@ -23,7 +17,7 @@ td {
}

caption, th, td {
padding: $base-line-height * .5;
padding: ($base-line-height * .5) ($base-line-height * .5) ($base-line-height * .5) 0;
}

caption {
Expand Down
114 changes: 114 additions & 0 deletions base/_typography.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
body {
color: $base-color;
font-family: $base-font-family;
font-size: $base-font-size;
line-height: $base-line-height;
}

hgroup {
margin-bottom: $base-line-height * .5;
}

h1, h2, h3, h4, h5, h6 {
text-rendering: optimizeLegibility; // Fix the character spacing for headings
}

h1 {
font-size: em(36); // = 36px
line-height: em(44, 36); // 44px = $base-line-height @ 2x
margin: .5em 0; // 22px = $base-line-height
}

h2 {
font-size: em(32); // = 32px
line-height: $base-line-height; // = 44px = $base-line-height @ 2x
margin: .25em 0; // = 11px = 1/2 $base-line-height
}

h3 {
font-size: em(28); // = 28px
line-height: em(33, 28); // = 33px = $base-line-height * .75
margin: em(11, 28) 0 0; // = 11px = $base-line-height / 2
}

h4 {
font-size: em(24); // = 24px
line-height: $base-line-height; // = 33px = $base-line-height * .75
margin: .5em 0 0; // = 11px = $base-line-height / 2
}

h5, h6 {
font-size: em(20); // = 20px
line-height: $base-line-height; // = 22px
margin: 0;
}

p {
font-size: $base-font-size;
font-weight: normal;
margin: 0 0 ($base-line-height / 2);
}

a:link, a:visited {
color: $base-link-color;
text-decoration: none;
@include transition;

&:hover, &:active, &:focus {
color: $base-hover-color;
}

&:visited {
color: darken($base-hover-color, 15);
}
}

hr {
border-bottom: 1px solid $base-border-color;
border-left: none;
border-right: none;
border-top: none;
margin: $base-line-height 0;
}

img {
margin: 0;
max-width: 100%;
}

abbr, acronym {
border-bottom: 1px dotted $base-border-color;
cursor: help;
}

address {
display: block;
margin: 0 0 ($base-line-height * .5);
}

del {
color: lighten($base-color, 15%);
text-decoration: line-through;
}

blockquote {
border-left: 2px solid $base-border-color;
color: lighten($base-color, 15%);
font-style: italic;
margin: $base-line-height 0;
padding-left: $base-line-height * .5;
}

cite {
color: lighten($base-color, 25%);
font-style: italic;

&:before {
content: '\2014 \00A0';
}
}

pre, code {
line-height: $base-line-height;
margin: ($base-line-height * .5) 0;
}
35 changes: 35 additions & 0 deletions base/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// All global variables -- Any variable used in more than one file

// Font Stack
$sans-serif: $helvetica;
$serif: $georgia;
$base-font-family: $sans-serif;
$header-font-family: $base-font-family;

// Font Sizes
$base-font-size: 1em;
$base-line-height: em(22);

// Colors
$blue: #477DCA;
$dark-gray: #333;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to have a medium gray variable by default.

Hexidecimal is base 16, meaning there are 16 values from 0 through F. We currently provide two values for grays:

 $dark-gray: #333;
$light-gray: #DDD;

Dark-gray is the 4th stop away from black. Light gray is the 3rd stop away from white. See the visual below:

0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - A - B - C - D - E - F
# - # - # - ^ - # - # - # - # - # - # - # - # - # - ^ - # - #

To get equal gray values within the spectrum, sass calculated the following values:

 $dark-gray: lighten(#000, 25%) = #404040
  $med-gray: lighten(#000, 50%) = #808080
$light-gray: lighten(#000, 75%) = #BFBFBF

I think we should provide the 3 hex values I calculated above.

The values are actually pretty close to the existing ones:
Screen Shot 2013-03-22 at 3 37 14 PM 1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with changing the shades of $light-gray and $dark-gray but I don't see a reason for us to start to add in colors that we don't need. I've replaced these colors with app or site specific ones on almost every project I've done.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the light and dark variables in groupize but felt it was missing a medium gray value.

$light-gray: #DDD;
$light-red: #FBE3E4;
$light-yellow: #FFF6BF;
$light-green: #E6EFC2;

// Font Colors
$base-color: $dark-gray;
$base-accent: $blue;

// Text Link Colors
$base-link-color: $base-accent;
$base-hover-color: darken($base-accent, 15);

// Border color
$base-border-color: $light-gray;

// Flash Colors
$error-color: $light-red;
$notice-color: $light-yellow;
$success-color: $light-green;
12 changes: 0 additions & 12 deletions bitters/_grid_settings.scss

This file was deleted.

10 changes: 0 additions & 10 deletions bitters/_layout.scss

This file was deleted.

Loading