Skip to content

Advanced css selectors #2

Description

@LinusU

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!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions