Loading ...
Sorry, an error occurred while loading the content.

CSS 3 selectors.

Expand Messages
  • pauanyu
    JSLint doesn t support them. Is this by design, or...?
    Message 1 of 9 , Jul 23, 2009
    • 0 Attachment
      JSLint doesn't support them. Is this by design, or...?
    • Douglas Crockford
      ... When I put CSS checking into JSLint, the CSS3 recommendation appeared to be years away from adoption, and browser implementations were spotty and
      Message 2 of 9 , Jul 23, 2009
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "pauanyu" <pcxunlimited@...> wrote:

        > JSLint doesn't support them. Is this by design, or...?

        When I put CSS checking into JSLint, the CSS3 recommendation appeared to be years away from adoption, and browser implementations were spotty and inconsistent. From then to now, there has been no demand for it.
      • pauanyu
        ... Perfectly understandable. I take it that means you will consider adding it in now? (I actually have quite a bit of stuff that uses CSS3, but apparently
        Message 3 of 9 , Jul 24, 2009
        • 0 Attachment
          --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
          >
          > When I put CSS checking into JSLint, the CSS3 recommendation appeared to be years away from adoption, and browser implementations were spotty and inconsistent. From then to now, there has been no demand for it.
          >

          Perfectly understandable. I take it that means you will consider adding it in now?

          (I actually have quite a bit of stuff that uses CSS3, but apparently always ran JSLint on the JavaScript, ignoring the CSS; hence never noticed until now.)
        • Douglas Crockford
          ... What specifically do you need?
          Message 4 of 9 , Jul 24, 2009
          • 0 Attachment
            --- In jslint_com@yahoogroups.com, "pauanyu" <pcxunlimited@...> wrote:
            >
            > --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@> wrote:
            > >
            > > When I put CSS checking into JSLint, the CSS3 recommendation appeared to be years away from adoption, and browser implementations were spotty and inconsistent. From then to now, there has been no demand for it.
            > >
            >
            > Perfectly understandable. I take it that means you will consider adding it in now?
            >
            > (I actually have quite a bit of stuff that uses CSS3, but apparently always ran JSLint on the JavaScript, ignoring the CSS; hence never noticed until now.)

            What specifically do you need?
          • pauanyu
            ... Right now? [key*= value ] [key^= value ] [key~= value ] ... P.S. JSLint also complains about: Is there any good reason for that?
            Message 5 of 9 , Jul 25, 2009
            • 0 Attachment
              --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
              >
              > What specifically do you need?
              >

              Right now?

              [key*='value']
              [key^='value']
              [key~='value']
              :nth-child(n)
              :not(foo)

              P.S. JSLint also complains about:

              <div class=":foo"></div>

              Is there any good reason for that?
            • Douglas Crockford
              ... You ve got it. ... Is there any good reason to put a colon in a class name?
              Message 6 of 9 , Jul 25, 2009
              • 0 Attachment
                --- In jslint_com@yahoogroups.com, "pauanyu" <pcxunlimited@...> wrote:
                >
                > --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@> wrote:
                > >
                > > What specifically do you need?
                > >
                >
                > Right now?
                >
                > [key*='value']
                > [key^='value']
                > [key~='value']
                > :nth-child(n)
                > :not(foo)

                You've got it.

                > P.S. JSLint also complains about:
                >
                > <div class=":foo"></div>
                >
                > Is there any good reason for that?

                Is there any good reason to put a colon in a class name?
              • pauanyu
                ... I m using it with a syntax highlighter to avoid class collisions and offer CSS styling. For instance, a pre tag that contains JavaScript text would be:
                Message 7 of 9 , Jul 25, 2009
                • 0 Attachment
                  --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
                  >
                  > Is there any good reason to put a colon in a class name?
                  >

                  I'm using it with a syntax highlighter to avoid class collisions and offer CSS styling. For instance, a pre tag that contains JavaScript text would be:

                  <pre class=":js">
                  // JavaScript goes here!
                  </pre>

                  HTML would be ":html", etc. This also means I can do stuff like:

                  *[class^=':']

                  Which would find all the special tags, etc.

                  It's not a huge deal, I'm just curious why there would be such a restriction. I mean, aren't CSS classes allowed to contain basically any (reasonable) character?

                  P.S. Thanks, some of the CSS3 selectors are very useful.
                • mnewton32@yahoo.ca
                  They are allowed to contain almost any character, but can only start with letters, numbers, or the underscore I believe. It s there in the (very readable) HTML
                  Message 8 of 9 , Jul 26, 2009
                  • 0 Attachment
                    They are allowed to contain almost any character, but can only start with letters, numbers, or the underscore I believe. It's there in the (very readable) HTML 4.01 spec. http://w3.org/TR/html4 if I recall correctly.

                    Sent from my BlackBerry device on the Rogers Wireless Network

                    -----Original Message-----
                    From: "pauanyu" <pcxunlimited@...>

                    Date: Sun, 26 Jul 2009 06:11:50
                    To: <jslint_com@yahoogroups.com>
                    Subject: [jslint] Re: CSS 3 selectors.


                    --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
                    >
                    > Is there any good reason to put a colon in a class name?
                    >

                    I'm using it with a syntax highlighter to avoid class collisions and offer CSS styling. For instance, a pre tag that contains JavaScript text would be:

                    <pre class=":js">
                    // JavaScript goes here!
                    </pre>

                    HTML would be ":html", etc. This also means I can do stuff like:

                    *[class^=':']

                    Which would find all the special tags, etc.

                    It's not a huge deal, I'm just curious why there would be such a restriction. I mean, aren't CSS classes allowed to contain basically any (reasonable) character?

                    P.S. Thanks, some of the CSS3 selectors are very useful.




                    [Non-text portions of this message have been removed]
                  • pauanyu
                    ... Thanks for the link. I took some quick glances at it and didn t notice any mention that CLASS must begin with letters, numbers, or the underscore. I did
                    Message 9 of 9 , Jul 26, 2009
                    • 0 Attachment
                      --- In jslint_com@yahoogroups.com, mnewton32@... wrote:
                      >
                      > They are allowed to contain almost any character, but can only start with letters, numbers, or the underscore I believe. It's there in the (very readable) HTML 4.01 spec. http://w3.org/TR/html4 if I recall correctly.
                      >
                      > Sent from my BlackBerry device on the Rogers Wireless Network
                      >

                      Thanks for the link. I took some quick glances at it and didn't notice any mention that CLASS must begin with letters, numbers, or the underscore. I did find this:

                      ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

                      Note that is for ID and NAME, not CLASS. In addition, because CLASS is a cdata-list, it can also contain unescaped HTML entities as well.

                      If I'm reading this properly, that means CLASS can contain *any* characters, separated by whitespace.

                      Here's the relevant link about CDATA:
                      http://www.w3.org/TR/html4/types.html#type-cdata
                    Your message has been successfully submitted and would be delivered to recipients shortly.