Add Bitters scaffolding for Bourbon-based projects

To be removed later.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/1272/head
Alex Coles 11 years ago
parent 8e28a4296d
commit 6dd9c98051
  1. 16
      app/assets/stylesheets/bitters/_bitters.scss
  2. 11
      app/assets/stylesheets/bitters/_flashes.scss
  3. 95
      app/assets/stylesheets/bitters/_forms.scss
  4. 14
      app/assets/stylesheets/bitters/_grid-settings.scss
  5. 31
      app/assets/stylesheets/bitters/_lists.scss
  6. 22
      app/assets/stylesheets/bitters/_tables.scss
  7. 104
      app/assets/stylesheets/bitters/_typography.scss
  8. 43
      app/assets/stylesheets/bitters/_variables.scss
  9. 1
      app/assets/stylesheets/bitters/extends/_base.scss
  10. 7
      app/assets/stylesheets/bitters/extends/_button.scss
  11. 1
      app/assets/stylesheets/bitters/mixins/_base.scss
  12. 15
      app/assets/stylesheets/bitters/mixins/_flash.scss
  13. 2
      app/assets/stylesheets/default.css.sass

@ -0,0 +1,16 @@
// Neat Settings -- uncomment if using Neat
///////////////////////////////////////////////////////////////////////////////
// @import "neat-helpers"; // or "neat/neat-helpers" when not in Rails
// @import "grid-settings";
// Bitters
///////////////////////////////////////////////////////////////////////////////
@import "variables";
@import "extends/base";
@import "mixins/base";
@import "typography";
@import "forms";
@import "tables";
@import "lists";
@import "flashes";

@ -0,0 +1,11 @@
%flash-error {
@include flash($error-color);
}
%flash-notice {
@include flash($notice-color);
}
%flash-success {
@include flash($success-color);
}

@ -0,0 +1,95 @@
$form-border-color: $base-border-color;
$form-border-color-hover: darken($base-border-color, 10);
$form-border-color-focus: $base-accent-color;
$form-border-radius: $base-border-radius;
$form-box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.06);
$form-box-shadow-focus: $form-box-shadow, 0 0 5px rgba(darken($form-border-color-focus, 5), 0.7);
$form-font-size: $base-font-size;
$form-font-family: $base-font-family;
fieldset {
background: lighten($base-border-color, 10);
border: 1px solid $base-border-color;
margin: 0 0 ($base-line-height / 2) 0;
padding: $base-line-height;
}
input,
label,
select {
display: block;
font-family: $form-font-family;
font-size: $form-font-size;
}
label {
font-weight: bold;
margin-bottom: $base-line-height / 4;
&.required:after {
content: "*";
}
abbr {
display: none;
}
}
textarea,
#{$all-text-inputs},
select[multiple=multiple] {
@include box-sizing(border-box);
@include transition(border-color);
background-color: white;
border-radius: $form-border-radius;
border: 1px solid $form-border-color;
box-shadow: $form-box-shadow;
font-family: $form-font-family;
font-size: $form-font-size;
margin-bottom: $base-line-height / 2;
padding: ($base-line-height / 3) ($base-line-height / 3);
width: 100%;
&:hover {
border-color: $form-border-color-hover;
}
&:focus {
border-color: $form-border-color-focus;
box-shadow: $form-box-shadow-focus;
outline: none;
}
}
textarea {
resize: vertical;
}
input[type="search"] {
@include appearance(none);
}
input[type="checkbox"], input[type="radio"] {
display: inline;
margin-right: $base-line-height / 4;
}
input[type="file"] {
width: 100%;
}
select {
width: auto;
max-width: 100%;
margin-bottom: $base-line-height;
}
button,
input[type="submit"] {
@extend %button;
@include appearance(none);
cursor: pointer;
user-select: none;
vertical-align: middle;
white-space: nowrap;
}

@ -0,0 +1,14 @@
// Neat Overrides
///////////////////////////////////////////////////////////////////////////////
// $column: 90px;
// $gutter: 30px;
// $grid-columns: 12;
// $max-width: em(1088);
// Neat Breakpoints
///////////////////////////////////////////////////////////////////////////////
$medium-screen: em(640);
$large-screen: em(860);
$medium-screen-up: new-breakpoint(min-width $medium-screen 4);
$large-screen-up: new-breakpoint(min-width $large-screen 8);

@ -0,0 +1,31 @@
ul, ol {
margin: 0;
padding: 0;
list-style-type: none;
&%default-ul {
list-style-type: disc;
margin-bottom: $base-line-height / 2;
padding-left: $base-line-height;
}
&%default-ol {
list-style-type: decimal;
margin-bottom: $base-line-height / 2;
padding-left: $base-line-height;
}
}
dl {
line-height: $base-line-height;
margin-bottom: $base-line-height / 2;
dt {
font-weight: bold;
margin-top: $base-line-height / 2;
}
dd {
margin: 0;
}
}

@ -0,0 +1,22 @@
table {
border-collapse: collapse;
margin: ($base-line-height / 2) 0;
table-layout: fixed;
width: 100%;
}
th {
border-bottom: 1px solid darken($base-border-color, 15%);
font-weight: bold;
padding: ($base-line-height / 2) 0;
text-align: left;
}
td {
border-bottom: 1px solid $base-border-color;
padding: ($base-line-height / 2) 0;
}
tr, td, th {
vertical-align: middle;
}

@ -0,0 +1,104 @@
body {
color: $base-font-color;
font-family: $base-font-family;
font-size: $base-font-size;
-webkit-font-smoothing: antialiased;
line-height: $base-line-height;
}
h1, h2, h3, h4, h5, h6 {
font-family: $header-font-family;
line-height: 1.25em;
margin: 0;
text-rendering: optimizeLegibility; // Fix the character spacing for headings
}
h1 {
font-size: $base-font-size * 2.25; // 16 * 2.25 = 36px
}
h2 {
font-size: $base-font-size * 2; // 16 * 2 = 32px
}
h3 {
font-size: $base-font-size * 1.75; // 16 * 1.75 = 28px
}
h4 {
font-size: $base-font-size * 1.5; // 16 * 1.5 = 24px
}
h5 {
font-size: $base-font-size * 1.25; // 16 * 1.25 = 20px
}
h6 {
font-size: $base-font-size;
}
p {
margin: 0 0 ($base-line-height * .5);
}
a {
color: $base-link-color;
text-decoration: none;
@include transition(color 0.1s linear);
&:hover {
color: $hover-link-color;
}
&:active, &:focus {
color: $hover-link-color;
outline: none;
}
}
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 / 2);
}
hgroup {
margin-bottom: $base-line-height / 2;
}
del {
color: lighten($base-font-color, 15);
}
blockquote {
border-left: 2px solid $base-border-color;
color: lighten($base-font-color, 15);
margin: $base-line-height 0;
padding-left: $base-line-height / 2;
}
cite {
color: lighten($base-font-color, 25);
font-style: italic;
&:before {
content: '\2014 \00A0';
}
}

@ -0,0 +1,43 @@
// Typography
///////////////////////////////////////////////////////////////////////////////
$sans-serif: $helvetica;
$serif: $georgia;
$base-font-family: $sans-serif;
$header-font-family: $base-font-family;
// Sizes
///////////////////////////////////////////////////////////////////////////////
$base-font-size: 1em;
$base-line-height: $base-font-size * 1.5;
$base-border-radius: em(3);
// Colors
///////////////////////////////////////////////////////////////////////////////
$blue: #477DCA;
$dark-gray: #333;
$medium-gray: #999;
$light-gray: #DDD;
$light-red: #FBE3E4;
$light-yellow: #FFF6BF;
$light-green: #E6EFC2;
// Body Color
$base-body-color: white;
// Font Colors
$base-font-color: $dark-gray;
$base-accent-color: $blue;
// Text Link Colors
$base-link-color: $base-accent-color;
$hover-link-color: darken($base-accent-color, 15);
// Border color
$base-border-color: $light-gray;
// Flash Colors
$error-color: $light-red;
$notice-color: $light-yellow;
$success-color: $light-green;

@ -0,0 +1,7 @@
%button {
@include button(simple, $base-accent-color);
-webkit-font-smoothing: antialiased;
font-size: $base-font-size;
font-weight: bold;
line-height: 1em;
}

@ -0,0 +1,15 @@
@mixin flash($color) {
background: $color;
color: darken($color, 60);
font-weight: bold;
margin-bottom: $base-line-height / 2;
padding: $base-line-height / 2;
a {
color: darken($color, 70);
&:hover {
color: darken($color, 90);
}
}
}

@ -26,6 +26,8 @@
* See doc/COPYRIGHT.rdoc for more details. ++
*/
@import bourbon
@import bitters/bitters
@import global/all
@import fonts/lato
@import fonts/openproject_icon_font

Loading…
Cancel
Save