Glimmer DSL for CSS 0.1.0 Beta (Cascading Style Sheets)
Glimmer DSL for CSS provides Ruby syntax for building CSS (Cascading Style Sheets).
Within the context of desktop development, Glimmer DSL for CSS is useful in providing CSS for the SWT Browser widget.
Setup
Please follow these instructions to make the glimmer command available on your system.
Option 1: Direct Install
Run this command to install directly:
jgem install glimmer-dsl-xml -v 0.1.0
jgem is JRuby's version of gem command.
RVM allows running gem as an alias.
Otherwise, you may also run jruby -S gem install ...
Add require 'glimmer-dsl-xml' to your code after require glimmer-dsl-swt or require glimmer-dsl-opal
Option 2: Bundler
Add the following to Gemfile after glimmer-dsl-swt or glimmer-dsl-opal:
gem 'glimmer-dsl-xml', '~> 0.1.0'
And, then run:
jruby -S bundle install
That's it! Requiring the gem activates the Glimmer XML DSL automatically.
CSS DSL
Simply start with css keyword and add stylesheet rule sets inside its block using Glimmer DSL syntax.
Once done, you may call to_s or to_css to get the formatted CSS output.
css is the only top-level keyword in the Glimmer CSS DSL
Selectors may be specified by s keyword or HTML element keyword directly (e.g. body)
Rule property values may be specified by pv keyword or underscored property name directly (e.g. font_size)
Example (you may copy/paste in girb):
@css = css {
body {
font_size '1.1em'
pv 'background', 'white'
}
s('body > h1') {
background_color :red
pv 'font-size', '2em'
}
}
puts @css
Multi-DSL Support
Learn more about how to use this DSL alongside other Glimmer DSLs:
Help
Issues
You may submit issues on GitHub.
Click here to submit an issue.
IRC Channel
If you need live help, try the #glimmer IRC channel on irc.mibbit.net. If no one was available, you may leave a GitHub issue to schedule a meetup on IRC.
Click here to connect to #glimmer IRC channel immediately via a web interface.
Feature Suggestions
These features have been suggested. You might see them in a future version of Glimmer. You are welcome to contribute more feature suggestions.
Change Log
Contributing
Contributors
- Andy Maleh (Founder)
- Dennis Theisen (Contributor)
Click here to view contributor commits.
License
Copyright (c) 2007-2020 Andy Maleh. See LICENSE.txt for further details.