Advanced css selectors #2

Open
LinusU opened this Issue Nov 21, 2013 · 0 comments

Comments

Projects
None yet
1 participant

LinusU commented Nov 21, 2013

Hi TJ,

I would like to use this library for a small command line utility I wrote recently and started thinking about some more advanced css selectors that I think could benefit this project.

Essentialy what I want to output is this:

[ 1/14] Generating random pool... [ OK ]

Now, I want the [ 1/14] to be bold and also want the OK to be green, easily achieved. Now comes the complicated part:

[ 1/14] Generating random pool... [FAIL]

This time I want FAIL to be red, but wouldn't it be great if could use the same format string?

The :contains() selector was dropped from css3 which would have suited this excellent.

result:contains('OK') {
    color: green;
}

result:contains('FAIL') {
    color: red;
}

I really just opened this issue to throw some ideas and to see what you think, if we can decide on a great syntax I would be more than happy to whip up a pull request. Let me know what you think!

@LinusU LinusU referenced this issue in LinusU/node-appdmg Nov 21, 2013

Closed

Add colours to output #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment