// This code is imported manually from bootstrap-sass at // https://github.com/thomas-mcdonald/bootstrap-sass // because we don't want to add a dependency on a full-fleged bootstrap // library. // Grays $black: #000; $grayLight: lighten($black, 75%); $white: #fff; // Accent Colors $blue: #049CDB; $blueDark: #0064CD; // Baseline grid $basefont: 13px; $baseline: 18px; // Font Stacks @mixin sans-serif-font($weight: normal, $size: 14px, $lineHeight: 20px) { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: $size; font-weight: $weight; line-height: $lineHeight; } // Border Radius @mixin border-radius($radius: 5px) { -webkit-border-radius: $radius; -moz-border-radius: $radius; border-radius: $radius; } // Drop shadows @mixin box-shadow($shadow: 0 1px 3px rgba(0,0,0,.25)) { -webkit-box-shadow: $shadow; -moz-box-shadow: $shadow; box-shadow: $shadow; } // Transitions @mixin transition($transition) { -webkit-transition: $transition; -moz-transition: $transition; -ms-transition: $transition; -o-transition: $transition; transition: $transition; } // Gradient Bar Colors for buttons and allerts @mixin gradientBar($primaryColor, $secondaryColor) { @include vertical-gradient($primaryColor, $secondaryColor); text-shadow: 0 -1px 0 rgba(0,0,0,.25); border-color: $secondaryColor $secondaryColor darken($secondaryColor, 15%); border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%); } // Gradients @mixin vertical-gradient($startColor: #555, $endColor: #333) { background-color: $endColor; background-repeat: repeat-x; background-image: -khtml-gradient(linear, left top, left bottom, from($startColor), to($endColor)); // Konqueror background-image: -moz-linear-gradient(top, $startColor, $endColor); // FF 3.6+ background-image: -ms-linear-gradient(top, $startColor, $endColor); // IE10 background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, $startColor), color-stop(100%, $endColor)); // Safari 4+, Chrome 2+ background-image: -webkit-linear-gradient(top, $startColor, $endColor); // Safari 5.1+, Chrome 10+ background-image: -o-linear-gradient(top, $startColor, $endColor); // Opera 11.10 background-image: linear-gradient(top, $startColor, $endColor); // The standard filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$startColor}, endColorstr=#{$endColor}, GradientType=0); // IE9 and down } // Shared colors for buttons and alerts .btn, .alert-message { // Set text color &.danger, &.danger:hover, &.error, &.error:hover, &.success, &.success:hover, &.info, &.info:hover { color: $white } // Sets the close button to the middle of message .close { font-family: Arial, sans-serif; line-height: 18px; } // Danger and error appear as red &.danger, &.error { @include gradientBar(#ee5f5b, #c43c35); } // Success appears as green &.success { @include gradientBar(#62c462, #57a957); } // Info appears as a neutral blue &.info { @include gradientBar(#5bc0de, #339bb9); } } @mixin vertical-three-colors-gradient($startColor: #00b3ee, $midColor: #7a43b6, $colorStop: 50%, $endColor: #c3325f) { background-color: $endColor; background-repeat: no-repeat; background-image: -webkit-gradient(linear, 0 0, 0 100%, from($startColor), color-stop($colorStop, $midColor), to($endColor)); background-image: -webkit-linear-gradient($startColor, $midColor $colorStop, $endColor); background-image: -moz-linear-gradient(top, $startColor, $midColor $colorStop, $endColor); background-image: -ms-linear-gradient($startColor, $midColor $colorStop, $endColor); background-image: -o-linear-gradient($startColor, $midColor $colorStop, $endColor); background-image: linear-gradient($startColor, $midColor $colorStop, $endColor); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$startColor}, endColorstr=#{$endColor}, GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback } // Reset filters for IE @mixin reset-filter() { filter: progid:DXImageTransform.Microsoft.gradient(enabled = false) } // Opacity @mixin opacity($opacity: 100) { filter: alpha(opacity=#{$opacity}); -khtml-opacity: $opacity / 100; -moz-opacity: $opacity / 100; opacity: $opacity / 100; } .rails_blog_engine_posts, .rails_blog_engine_post { // Base .btn styles .btn { // Button Base cursor: pointer; display: inline-block; @include vertical-three-colors-gradient(#ffffff, #ffffff, 25%, darken(#ffffff, 10%)); // Don't use .gradientbar() here since it does a three-color gradient padding: 5px 14px 6px; text-shadow: 0 1px 1px rgba(255,255,255,.75); color: #333; font-size: $basefont; line-height: normal; border: 1px solid #ccc; border-bottom-color: #bbb; @include border-radius(4px); $shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); @include box-shadow($shadow); // We added this manually because they were needed to make the buttons // look like regular Bootstrap buttons. @include sans-serif-font(normal,$basefont,$baseline); text-decoration: none; &:hover { background-position: 0 -15px; color: #333; text-decoration: none; } // Focus state for keyboard and accessibility &:focus { outline: 1px dotted #666; } // Primary Button Type &.primary { color: $white; @include gradientBar($blue, $blueDark) } // Transitions @include transition(.1s linear all); // Active and Disabled states &:active, &.active { $shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.05); @include box-shadow($shadow); } &.disabled { cursor: default; background-image: none; @include reset-filter(); @include opacity(65); @include box-shadow(none); } &[disabled] { // disabled pseudo can't be included with .disabled // def because IE8 and below will drop it ;_; cursor: default; background-image: none; @include reset-filter(); @include opacity(65); @include box-shadow(none); } // Button Sizes &.large { font-size: $basefont + 2px; line-height: normal; padding: 9px 14px 9px; @include border-radius(6px); } &.small { padding: 7px 9px 7px; font-size: $basefont - 2px; } } // Super jank hack for removing border-radius from IE9 so we can keep filter gradients on alerts and buttons :root .alert-message, :root .btn { border-radius: 0 \0; } // Help Firefox not be a jerk about adding extra padding to buttons button.btn, input[type=submit].btn { &::-moz-focus-inner { padding: 0; border: 0; } } // PAGINATION // ---------- // // This has been modified for compatibility with Kaminari. .pagination { height: $baseline * 2; margin: $baseline 0; float: left; margin: 0; border: 1px solid #ddd; border: 1px solid rgba(0,0,0,.15); border-right: 0; @include box-shadow(0 1px 2px rgba(0,0,0,.05)); span { display: inline; } .current, a { float: left; padding: 0 14px; line-height: ($baseline * 2); border-right: 1px solid; border-right-color: #ddd; border-right-color: rgba(0,0,0,.15); *border-right-color: #ddd; /* IE6-7 */ text-decoration: none; } a:hover, .current { background-color: lighten($blue, 45%); } .disabled a, .disabled a:hover { background-color: transparent; color: $grayLight; } } }