Coder Social home page Coder Social logo

nduitz / flag-icons-rails Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spadarjauhien/flag-icons-rails

0.0 0.0 0.0 5.8 MB

flag-icon-css sass gem for use in Ruby/Rails projects.

License: MIT License

JavaScript 0.60% Ruby 52.09% CSS 45.97% HTML 1.34%

flag-icons-rails's Introduction

flag-icons-rails

Gem Version Gem Downloads Gem Total Downloads
Build Status Code Climate Codacy Badge

flag-icons-rails provides flag-icon-css - a collection of all country flags in SVG - as a Ruby gem for use with the asset pipeline.

Installation

Add this to your Gemfile:

gem 'flag-icons-rails'

and then execute:

bundle install

Do not add gem to assets section if you want to use flag_icon rails helper.

Usage

In your application.css, include the file:

/*
 *= require flag-icon
 */

If you prefer SCSS, add this to your application.scss file:

@import "flag-icon";

Then restart your webserver if it was previously running.

Plain usage

In your view:

<span class="flag-icon flag-icon-by"></span>
<span class="flag-icon flag-icon-by flag-icon-squared"></span>

Rails Helper usage

In your view:

flag_icon(:by)
# => <span class="flag-icon flag-icon-by"></span>
flag_icon(:by, element: :div)
# => <div class="flag-icon flag-icon-by"></div>
flag_icon(:by, squared: true)
# => <span class="flag-icon flag-icon-by flag-icon-squared"></span>
flag_icon(:by, id: 'my-flag', class: 'strong')
# => <span id="my-flag" class="flag-icon flag-icon-by strong"></span>

Thanks

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.