Last active
December 13, 2019 13:28
Revisions
-
phillbaker revised this gist
Jan 28, 2013 . 2 changed files with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ # app/css/app.less .main { border: 1 + 1px solid #eee; border-radius: 3px; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,20 +8,19 @@ class App < Sinatra::Base set :root, File.dirname(__FILE__) register Sinatra::AssetPack enable :inline_templates assets do css_dir = 'app/css' # Same directory serve '/css', :from => css_dir # Add all the paths that Less should look in for @import'ed files Less.paths << File.join(App.root, css_dir) css :styles, '/css/styles.css', [ # '/css/bootstrap.css', # bootstrap.less '/css/app.css' ] -
phillbaker created this gist
Jan 28, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ source :rubygems gem 'sinatra' gem 'sinatra-assetpack' gem 'json' gem 'therubyracer' gem 'less' This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ .main { border: 1 + 1px solid #eee; border-radius: 3px; padding: 1rem; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ require 'rubygems' require 'bundler/setup' require 'sinatra/base' require 'sinatra/assetpack' require 'less' class App < Sinatra::Base set :root, File.dirname(__FILE__) set :logging, true register Sinatra::AssetPack enable :inline_templates assets do css_dir = '' # Same directory serve '/css', :from => css_dir # Add all the paths that Less should look in for @import'ed files Less.paths << File.join(App.root, css_dir) css :styles, '/css/styles.css', [ '/css/bootstrap.css', # bootstrap.less '/css/app.css' ] css_compression :less end get '/' do erb :index end run! if app_file == $0 end __END__ @@ index <html> <head> <%= css :styles %> </head> <body> <h1>Hello!</h1> <p class="main"><a href="#" class="btn">Link</a></p> </body> </html>