webdevRefinery Forum: CSS4 - webdevRefinery Forum

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Rate Topic: -----

User is online Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 30 September 2011 - 08:29 AM (#1)

CSS4


Well, selectors anyways
The first draft of CSS Selectors Level 4 is out: http://www.w3.org/TR...ors4-20110929/. Anything with level 4 in the overview table is new.

Some observations from me:
- There's a very easy way to style internal links differently from external links - a:local-link matches links in the same domain.
- The :nth-column selector is like nth-child, except it matches table columns. You could use it to make every second table column a different background colour, for instance
- You can finally select parent elements! For example,
$p > a
matches all paragraphs that contains one or more links.
- I read over a few times and still have no clue what "E:nth-match" does

Might be a while before we can finally use it cross-browser, seeing as Internet Explorer has still not fully implemented CSS 2.1 (let alone CSS 3!). Wonder how long until the good browsers (Firefox, Chrome, Opera) support bits of it. None of the new stuff is implemented at the moment...
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


User is online Cyril 

  • Group: Members
  • Posts: 2544
  • Joined: 03-August 10
  • Expertise:HTML,CSS,PHP,Javascript,Graphics

Posted 30 September 2011 - 08:51 AM (#2)

FUCK YEAH.

About e:nth-match, it's probably to style an element when there are a certain number of them. For example, make divs 320px wide of there are 3 of them, 480px if there are two, etc

website :: github :: twitter :: dribbble :: forrst
html, css, php, javascript, graphics
0


User is offline TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 30 September 2011 - 09:07 AM (#3)

View PostDaniel15, on 30 September 2011 - 08:29 AM, said:

The first draft of CSS Selectors Level 4 is out: http://www.w3.org/TR...ors4-20110929/. Anything with level 4 in the overview table is new.

Some observations from me:
- There's a very easy way to style internal links differently from external links - a:local-link matches links in the same domain.
- The :nth-column selector is like nth-child, except it matches table columns. You could use it to make every second table column a different background colour, for instance
- You can finally select parent elements! For example,
$p > a
matches all paragraphs that contains one or more links.
- I read over a few times and still have no clue what "E:nth-match" does

I would assume nth match is the nth match ;) think like regular expression for the other matches. So every 2nd match I want to also change the text color or something.

I want nesting.
Reserved.
0


User is offline soulcyon 

  • 兄貴 シャンク
  • Group: Members
  • Posts: 1591
  • Joined: 14-April 10
  • LocationNew Brunswick, NJ
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,Graphics,MongoDB,CouchDB

Posted 30 September 2011 - 09:12 AM (#4)

:o What happened to that huge fit about not adding parent selectors? Did they finally suck it up and add that "unoptimal parent logic"? The nth-match looks pretty cool :D

@nth-column, idk I find it pointless :S

http://jsfiddle.net/soulcyon/v5vPF/

+ div grids are becoming more popular, so idk why they would add more features to tables
Posted Image
0


User is offline TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 30 September 2011 - 09:44 AM (#5)

View Postsouless, on 30 September 2011 - 09:12 AM, said:

:o What happened to that huge fit about not adding parent selectors? Did they finally suck it up and add that "unoptimal parent logic"? The nth-match looks pretty cool :D

@nth-column, idk I find it pointless :S

http://jsfiddle.net/soulcyon/v5vPF/

+ div grids are becoming more popular, so idk why they would add more features to tables

Your fiddle doesn't highlight the 4th row in Chrome on Mac.
Reserved.
0


User is online Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 30 September 2011 - 10:29 AM (#6)

Quote

+ div grids are becoming more popular, so idk why they would add more features to tables

Tables will always have a use - They should be used for tabular data. :)

But yeah, I didn't think about doing it that way. nth-column just looks cleaner to me.

Quote

What happened to that huge fit about not adding parent selectors?

Yeah, I remember reading about that. I don't know what happened :o
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


User is offline arronhunt 

  • I'm a httpster
  • Group: Moderators
  • Posts: 3398
  • Joined: 09-March 10
  • LocationLos Angeles, CA
  • Expertise:HTML,CSS,Javascript,Graphics,Flash

Posted 30 September 2011 - 11:18 AM (#7)

View PostDaniel15, on 30 September 2011 - 08:29 AM, said:

- You can finally select parent elements! For example,
$p > a
matches all paragraphs that contains one or more links.


:lol: :blink: :lol: :blink: :lol: FINALLY!!!!!! :blink: :lol: :blink: :lol: :blink:

View PostThatRailsGuy, on 30 September 2011 - 09:07 AM, said:

I want nesting.


I don't think CSS will ever support that :( guess developers will have to stick with sass/less.
DO NOT OPEN THIS

Spoiler
0


User is offline callumacrae 

  • {{ post.author }}
  • Group: Members
  • Posts: 2862
  • Joined: 20-January 11
  • LocationWarwickshire, England
  • Expertise:HTML,CSS,PHP,Javascript,Node.js,SQL

Posted 30 September 2011 - 11:31 AM (#8)

I want Komodo to support LESS :(
Front-end developer and writer
Twitter | GitHub | phpBB Contributor and Website Team Member | lynxphp
0


User is offline DarkCoder 

  • Group: Members
  • Posts: 1463
  • Joined: 08-March 10
  • LocationEngland, United Kingdom
  • Expertise:HTML,CSS,PHP,Javascript,SQL

Posted 30 September 2011 - 12:09 PM (#9)

View PostThatRailsGuy, on 30 September 2011 - 09:44 AM, said:

Your fiddle doesn't highlight the 4th row in Chrome on Mac.

Doesn't in Chrome on Windows, either.
0


User is offline soulcyon 

  • 兄貴 シャンク
  • Group: Members
  • Posts: 1591
  • Joined: 14-April 10
  • LocationNew Brunswick, NJ
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,Graphics,MongoDB,CouchDB

Posted 30 September 2011 - 12:19 PM (#10)

View PostDarkCoder, on 30 September 2011 - 12:09 PM, said:

Doesn't in Chrome on Windows, either.

wtf cheats?
Posted Image
I would rather use nth-column anyways.
Posted Image
0


User is offline Koen 

  • Leroy Jenkins
  • Group: Members
  • Posts: 2503
  • Joined: 10-March 10
  • Locationthe Netherlands
  • Expertise:HTML,CSS,Javascript,Graphics

Posted 30 September 2011 - 01:41 PM (#11)

Oh my god, Time-dimensional pseudo-classess... Boys, we're going back in time!
Please click the + if I helped you!
Twitter: @KoenKlaren

<callumacrae> YOU DID A ROMNEY
0


User is offline morrison_levi 

  • Group: Members
  • Posts: 18
  • Joined: 20-September 11
  • LocationWestern USA
  • Expertise:HTML,CSS,PHP,Java,Javascript,SQL

Posted 30 September 2011 - 04:10 PM (#12)

View Postsouless, on 30 September 2011 - 09:12 AM, said:

. . .
@nth-column, idk I find it pointless :S

http://jsfiddle.net/soulcyon/v5vPF/

+ div grids are becoming more popular, so idk why they would add more features to tables


They added more features to tables because. . . oh, yeah, they do have valid uses! Ever heard of data? We do still use that. :)


UI state selectors are my favorite part, but only slightly ahead of parent selectors.
1


User is online Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 30 September 2011 - 09:10 PM (#13)

You guys. souless' fiddle used :nth-child(2) and not :nth-child(2n). So it'll only affect the second column, not every even one.

Quote

They added more features to tables because. . . oh, yeah, they do have valid uses! Ever heard of data? We do still use that.

LOL xD
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


User is offline soulcyon 

  • 兄貴 シャンク
  • Group: Members
  • Posts: 1591
  • Joined: 14-April 10
  • LocationNew Brunswick, NJ
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,Graphics,MongoDB,CouchDB

Posted 01 October 2011 - 12:09 AM (#14)

oh he meant "4th column", *facepalm*

idk how you typo "row" instead of "column" lolol
Posted Image
0


User is offline TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 01 October 2011 - 06:01 AM (#15)

View Postsouless, on 01 October 2011 - 12:09 AM, said:

oh he meant "4th column", *facepalm*

idk how you typo "row" instead of "column" lolol

'cuz my brain doesn't work like everyone elses, why I write good code ;P I think like |->| versus
. -> .
. -> .
Reserved.
0


User is offline DarkCoder 

  • Group: Members
  • Posts: 1463
  • Joined: 08-March 10
  • LocationEngland, United Kingdom
  • Expertise:HTML,CSS,PHP,Javascript,SQL

Posted 01 October 2011 - 06:29 AM (#16)

View PostDaniel15, on 30 September 2011 - 09:10 PM, said:

You guys. souless' fiddle used :nth-child(2) and not :nth-child(2n). So it'll only affect the second column, not every even one.

Oh yeah, now it works.
Look at this: http://dl.tl/?bcd5
0


User is offline soulcyon 

  • 兄貴 シャンク
  • Group: Members
  • Posts: 1591
  • Joined: 14-April 10
  • LocationNew Brunswick, NJ
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,Graphics,MongoDB,CouchDB

Posted 01 October 2011 - 12:02 PM (#17)

View PostDarkCoder, on 01 October 2011 - 06:29 AM, said:

Oh yeah, now it works.
Look at this: http://dl.tl/?bcd5

WEeeeeeeeeeeeeeEEEeeEEeeEEEEeeee
Posted Image
0


User is online Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 05 October 2011 - 07:35 AM (#18)

Here's a writeup on it by David Story (a W3C Working Group member): http://dstorey.tumbl...3182/selectors4
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


User is offline soulcyon 

  • 兄貴 シャンク
  • Group: Members
  • Posts: 1591
  • Joined: 14-April 10
  • LocationNew Brunswick, NJ
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,Graphics,MongoDB,CouchDB

Posted 05 October 2011 - 11:32 AM (#19)

"In CSS3 selectors, the negation selector (:not) can only accept a simple selector."

that sucks :(

well, it's more challenging for a couple things now, but it would be nice to have any arbitrary selector in :not()
Posted Image
0


User is online Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 05 October 2011 - 04:50 PM (#20)

Did you read the whole paragraph of the text you quoted? :P

Quote

These restrictions have been relaxed somewhat in CSS4 Selectors to also allow a selector list. Both simple and compound selectors are allowed. Pseudo-elements and nested selectors are still not supported however.

So CSS4 makes them a little more powerful :)
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users


Enter your sign in name and password


Sign in options
  Or sign in with these services