semantic-ui-sass
is an Sass-powered version of Semantic UI and ready to drop into Rails & Compass.
The gem only has default theme.
gem 'semantic-ui-sass', github: 'doabit/semantic-ui-sass'
bundle install
and restart your server to make the files available through the pipeline.
Import Semantic in an SCSS file (for example, application.css.scss
) to get all of Semantic's styles
@import "semantic-ui";
You can also include modules
@import "semantic-ui/collections/menu";
We have a helper that includes all Semantic javascripts. Put this in your Javascript manifest (usually in application.js
) to
// Loads all Semantic javascripts
//= require semantic-ui
You can also load individual modules, provided you also require any dependencies.
//= require semantic-ui/modal
//= require semantic-ui/dropdown
Install the gem and create a new project using the gem.
gem install semantic-ui-sass
compass create compass-project -r semantic-ui-sass --using semantic-ui
This will sort a few things out:
- You'll get a starting
styles.scss
- You'll get a compiled stylesheet compiled & ready to drop into your application
- We'll also copy the Semantic javascripts & images & fonts into their respective folders for you
Install the gem, add the require statement to the top of your configuration file, and install the extension.
gem install semantic-ui-sass
# In config.rb
require 'semantic-ui-sass'
compass install semantic-ui
When using compass, you should visit file in local server, eg http://localhost:3000/index.html
, rather than file:///Users/doabit/demo/index.html
Add breadcrumbs helper <%= render_breadcrumbs %>
to your layout.
class ApplicationController
add_breadcrumb :index, :root_path
end
class ExamplesController < ApplicationController
add_breadcrumb :index, :examples_path
def index
end
def show
@example = Example.find params[:id]
add_breadcrumb @example.name, example_path(@example)
# add_breadcrumb :show, example_path(@example)
end
end
Add flash helper <%= semantic_flash %>
to your layout
semantic_icon('add')
# => <i class="add icon"></i>
semantic_icon(:add)
# => <i class="add icon"></i>
semantic_icon('add sign')
# => <i class="add sign icon"></i>
semantic_icon('add', 'sign')
# => <i class="add sign icon"></i>
semantic_icon(:add, :sign)
# => <i class="add sign icon"></i>
- Add global variables
- Add rails helpers like
render_flash
?
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request