Socket
Book a DemoInstallSign in
Socket

rbss

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rbss

0.2.4
bundlerRubygems
Version published
Maintainers
1
Created
Source

rbss

Ruby Styling Sheets. Turn Ruby code into valid, minified CSS.

Installation

In your Gemfile

gem rbss

Usage

Currently, all rbss files are not cached and evaluated on run time.

In layouts/application.html.erb (or otherwise), include the line

<%= rbss('file,names,here') %>

Do not include the .rbss file extension with each name.

In app/assets/stylesheets, create some files: file.rbss, names.rbss, here.rbss, etc etc.

The files will be evaluated to minified CSS and replace <%= rbss('file,names,here') %>.

Example

A simple example

body do
  color 'black'
  width '95px'
end

span '.bacon' do
  padding '50px'
  font_size '16px'
  div '#div' do
    color 'yellow'
    div '.class' do
      width '44px'
    end
  end

  div '.potato' do
    text_align 'right'
  end
end

_ '#cats' do
  height '100px'
end

evaluates to

body{color:black;width:95px;}span.bacon{padding:50px;font-size:16px;}span.bacon div#div{color:yellow;}span.bacon div#div div.class{width:44px;}span.bacon div.potato{text-align:right;}#cats{height:100px;}

A more sexy example

#custom logic
def fake_bacon
  '95px'
end

def super_fake_bacon(value)
  value.downcase
end

super_duper_fake_bacon = '1px 1px'

#rbss
body '#okay.goodbye' do
  width fake_bacon
  color super_fake_bacon("WHITE")
  a '.success' do
    margin super_duper_fake_bacon
  end
end

evaluates to

body#okay.goodbye{width:95px;color:white;}body#okay.goodbye a.success{margin:1px 1px;}

Copyright (c) 2013 Gabe Scholz. See LICENSE.txt for further details.

FAQs

Package last updated on 02 May 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.