Giter Site home page Giter Site logo

customization-engine's Introduction

Customization engine

Theme customization engine demo built with Rails.

Understand

The basic idea is to determine per-theme the settings that are customizable. These settings will then be converted to SCSS variables and output just before the theme's actual SCSS, thus resulting in the rendering of SCSS to CSS using the customized variables and enabling customization.

Most of the heavy lifting is done in app/classes/theme_css_renderer.rb, check that file out. It utilises the files of a simple demo theme in app/themes. The actual customization settings are stored in the database via a Customization model.

Usage

Start the Rails server with:

rails s

Open up a rails console session:

rails c

Create an empty, dummy Customization with some settings:

Customization.create(settings: { :'color-brand' => '#0076A0', :'color-text' => '#232326', :'header-title-color' => '#FFFFFF' })

Open http://localhost:3000/demo and go back to console and change the settings and see things change!

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.