Project

themify

0.0
No commit activity in last 3 years
No release in over 3 years
With themify you can handle multiple themes and generate css and js files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

< 2.0, >= 1.3.0
~> 10.0
>= 0

Runtime

>= 0
>= 0
 Project Readme

Themify

Build Status Code Climate

TODO: Write a gem description

Installation

Add this line to your application's Gemfile:

gem 'themify'

And then execute:

$ bundle

Or install it yourself as:

$ gem install themify

Usage

CSS

Use an initializer to add one or more templates:

Themify.add_template(Themify::Template.new('light', {'main' => '#00ccff', 'secondary' => '#121234'}))
Themify.add_template(Themify::Template.new('dark', {'main' => '#aa33ff', 'secondary' => '#565667'}))

Create a new file with extension .css.sass.template and use variables with prefix $template_. For example this template:

.label
  background: $template_main

generates

/* Template 1 */
.template-light .label {
  background: #00ccff;
}

/* Template 2 */
.template-dark .label {
  background: #aa33ff;
}

now you've just to create a parent element with the corresponding theme class.

Javascript

You can also access templates via javascript by requiring the library in your assets pipeline:

#= require themify

then you can use window.Themify.templates to have the array of templates like this:

[
  {
    "name": "light",
    "colors": {
      "main": "#00ccff",
      "secondary": "#121234"
    }
  },
  {
    "name": "dark",
    "colors": {
      "main": "#aa33ff",
      "secondary": "#565667"
    }
  }
]

Contributing

  1. Fork it ( https://github.com/alex88/themify/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