0.0
No commit activity in last 3 years
No release in over 3 years
Generates CSS from HTML passed into it.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.4, >= 1.4.12
 Project Readme

Introducing the HTML-to-CSS gem

require 'hlt'
require 'html-to-css' 

s =<<S
html {lang: 'en'}
  head
    title Example for HTML-to-CSS
    meta {charset: 'utf-8'}

  body
    #wrap
      article
        h1 testing 123
        p Having fun today.      
S

File.write 'index2.html', Hlt.new(s).to_html

htc = HtmlToCss.new(file: 'index2.html')
puts htc.to_layout
html {
  background-color: #d5c832
}
  body {
    background-color: #bf71c3;
    align: center
  }
    #wrap {
      background-color: #53d35c
    }
puts htc.to_style
html {
  background-color: #ea4ff5
}
  body {
    background-color: #58e977
  }
    #wrap {
      background-color: #3fdd1e
    }
      #wrap>article {
        background-color: #d25eca
      }
        #wrap>article>h1 {
          background-color: #2c25bb;
          color: #fff;
          font-family: Verdana, Arial, Helvetica, sans-serif;
          font-size: 1.3em
        }
        #wrap>article>p {
          background-color: #51f73b
        }

htmltocss gem css css3