Code Monkey home page Code Monkey logo

groocss's People

Contributors

adamldavis avatar theosotr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

groocss's Issues

No such property: color for class: java.lang.String

When using the latest Gradle plugin with the example file yields the following error:

No such property: color for class: java.lang.String

build.gradle (from http://www.groocss.org/gradle.html)

plugins {
    id "org.groocss.groocss-gradle-plugin" version "1.0-M2"
}
def cssDir = "$parent.buildDir/../www/css"

task css(type: org.groocss.GroocssTask, dependsOn: convertCss) {
    conf = new org.groocss.Config(compress: true, addOpera: false)
    from 'index.groocss'
    into "$cssDir/index.css.min"
}

groocss file from (http://www.groocss.org/)

def myColor = 'fe33ac'.color   // creates a Color object
def mySize = 100.px

'.box'.sg {             //sg or $ can be used interchangeably whichever you prefer
  color myColor          // resolves to color: #fe33ac
  borderColor whiteSmoke // borderColor becomes border-color; built-in named colors
  padding 2.em           // resolves to 2em; validated
}
table {
    color myColor background black //fluent
}
'table.my-class'.$ {
    color darken(myColor)  // tint, shade, lighten, mix, fade, and many other methods
}
input %odd {          // becomes input:nth-child(odd)
    background yellow
}
'formId'.id {       // resolves to #formId
    minWidth mySize      // resolves to 100px
    maxWidth mySize*2    // resolves to 200px
    fontSize 1.cm + 2.mm // you can add different types
    extend(table)        // ability to extend previously defined styles
}
$('.box div') {      // can use jQuery-style as well
  boxShadow '0 0 5px rgba(0, 0, 0, 0.3)'
}

Dynamic Styles DSL/More Operators

def myColor = c('#fe33ac')

_.box {      

Variables

Ability to add variables to Config and have them available in scripts

New release plans ?

Hi:

I've started using Groocss + Asset-Pipeline to create the sites of some open source projects of mine but there are some features from GrooCSS, like deep nested styles for example, that are not working in any of the published releases so far.

Is there any plans to release a new version soon ?

Of course I'd be glad to help.

And congrats for the project BTW.
Mario

New extension methods did not work from within custom code in build.gradle

For example:

task css2 doLast {
    def config = new Config(prettyPrint: true)
    def out = file("$cssDir/out.css")
    GrooCSS.process(config) {
        table {
            border 2.em
        }
        'formId'.id {
            color white
        }
    }.writeTo(out)
}

OR

task css2 doLast {
  GrooCSS.convert(config, file("index.groocss"), file("$cssDir/index2.css"))
}

WORK-AROUND: Call new GrooCSS().initMetaClasses() before the "process" line.

Properties files

Enable the use of Properties file. For example: Properties props = new Properties()
new Config(props) or Config.fromProperties(props) or GrooCSS.configFromFile(filename) or in Gradle plugin: propertiesFile = file("groocss.properties"). Should allow the property "processorClasses" to be a list of classnames separated by commas for Processors to use.

Allow conversion that's not dependent on Files

Very cool project. I'm interested to see how it evolves.

I was thinking it would be nice to be able to covert a String value instead of having input and output files (something like this):

String grooCss = "p { border '1px solid black'}"
String result = GrooCSS.covert(grooCss)

Even a convert method that used an InputStream and an OutputStream would give some more flexibility and allow it to be used in a project like the Asset Pipeline.

Add better support for conditional styles and code reuse

In comparable systems, you can define a method which is called elsewhere, pass parameters, and conditionally add styles. GrooCSS should easily support this with a few additions.

For example, something like:

def mycolor(alpha) { styles {
   if (alpha == 0) color '#123'
   else color rgba(0,0,0,alpha)
}}

and elsewhere within a style-group:
add mycolor(0.5)

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.