Giter VIP home page Giter VIP logo

bootswatch-sass's Introduction

Bootswatch ruby gem Gem Version

Bootswatch is a collection of free themes for Bootstrap.

Installation

Add this line to your application's Gemfile:

gem 'bootstrap'
gem 'bootswatch'

Bootstrap JavaScript depends on jQuery. If you're using Rails 5.1+, add the jquery-rails gem to your Gemfile:

gem 'jquery-rails'

And then execute:

$ bundle

Usage

Stylesheets

in your application.scss

// example override bootswatch variables
$primary:       #FFCF06;
$secondary:     #37474f;
$success:       #28b62c;
$info:          #03a9f4;
$warning:       #fbe42c;
$danger:        #ff4136;
$light:         #eeeeee;
$dark:          #444444;
// end example override

// import scss file
@import "bootswatch/materia/variables";
@import "bootstrap";
@import "bootswatch/materia/bootswatch";

Make sure the file has .scss extension (or .sass for Sass syntax). If you have just generated a new Rails app, it may come with a .css file instead. If this file exists, it will be served instead of Sass, so rename it:

Javascript

Add Bootstrap dependencies and Bootstrap to your application.js:

//= require jquery3
//= require popper
//= require bootstrap

or use individual Bootstrap components for ease of debugging

//= require jquery3
//= require popper
//= require bootstrap-sprockets

see more on bootstrap readme

Contributing

  1. Fork it ( https://github.com/mkhairi/bootswatch/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

bootswatch-sass's People

Contributors

mkhairi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bootswatch-sass's Issues

Rails error after installing this css.

Undefined mixin 'gradient-vertical-three-colors'.

Extracted source (around line #3):
@import 'variables';
@mixin btn-shadow($color){
@include gradient-vertical-three-colors(lighten($color, 8%), $color, 60%, darken($color, 4%));
filter: none;
border-bottom: 1px solid darken($color, 10%);
}

Just a question

Hi thanks for writing and sharing this usefull gem I just ave a small question I was able to follow your steps to install bootswatch scss but now I'm wondering if I require bootsrap js in my application ? it's not specified in you readme. thanks ahead. David.

sass & sass-rails are now deprecated

Well, as sass and sass-rails are deprecated in favor of sassc & sassc-rails, you might want to remove them from the gemspec.

The best approach to me would be to explicitly mention (in the README) that one would need a SASS/SCSS compiler and not directly depend to one.

What do you think?

missing custom.min.css?

When using the v4 bootstrap gem and the bootstrap-sass gem, I have to manually create an assets/stylesheets/custom.min.css copied from the official bootswatch source in order for any bootswatch stylesheet to appear correctly. Is this a flaw in the boostrap-sass gem, or is the flaw mine?

With the Gemfile:

gem 'bootstrap'
gem 'bootswatch'
source 'https://rails-assets.org' do
  gem 'rails-assets-tether', '>= 1.3.3'
end

and the assets/stylesheets/application.css.sass:

@import "bootswatch/cosmo/variables"
@import "bootstrap"
@import "bootswatch/cosmo/bootswatch"

and the assets/javascripts/application.js:

//= require jquery
//= require tether
//= require bootstrap-sprockets
//= require jquery_ujs
//= require turbolinks
//= require_tree .

and the layout app/views/layouts/application.html.haml (excuse the haml):

= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
= javascript_include_tag 'application', 'data-turbolinks-track': 'reload'

Not all the necessary styles seems to exist such that the example matches the app. Here is the difference:

enter image description here

Left: official example. Right: the Rails app in question

If I manually create assets/stylesheets/custom.min.css, add a stylesheet_link_tag for custom.min.css and the necessary Rails.application.config.assets.precompile directive, the application matches the example.

enter image description here

Left: official example. Right: the Rails app in question

Neither the bootswatch documentation nor the bootstrap-sass documentation mention anything about this magic custom.min.css file. All of the bootswatch examples use a link to this stylesheet. Is this a flaw in the documentation for bootswatch, a flaw in the bootswatch-sass gem, or a flaw in my understanding of how all these moving parts should be made to work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.