CSS Wishlist

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

CSS Wishlist

Post by Chris Corbyn »

Just thinking of CSS and some drawbacks I often think about. Apart from the obvious things like all browsers sticking to standards what would you like to see available in CSS in the future?

Maybe the things I think of are already available and I don't know about it so if they are I'd love to know :)

Two major things I think about are:

Class inheritance

Rather than specifying a whitespace separated list of classes in the class attrribute to allow an element to take the properties of two different classes, allow it to be done in the stylesheet.

e.g.

Rather than:

Code: Select all

<style type="text/css">
.one {
    width: 100%;
}

.two {
    background: #eeee88 url(myimage.png) repeat-x;
}
</style>

<div class="one two">
    ..
</div>
Allow:

Code: Select all

<style type="text/css">
.one {
    width: 100%;
}

.two extends .one {
    background: #eeee88 url(myimage.png) repeat-x;
}
</style>

<div class="two">
    ..
</div>
Ability to perform mathematics the browser already clearly does itself

Code: Select all

<style type="text/css">
.example {
    width: math(100% - 200px);
}
</style>

<div class="example">
    ..
</div>
Vertical text for table headings (Internet explorer has this)

(No example needed)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

  • (quality) rounded corners (CSS 3)
  • unified opacity (CSS 3, I believe)
  • percentage height
  • the standards board release a fully compliant API that can both parse arbitrary strings of style information and have interfaces to help browsers correctly render how they're supposed to
  • (better) expression support
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

More intuitive positioning - I know standard CSS when adhered to by browsers works, but it's spread across too many styles. A little unification would do no harm.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Newspaper columns (CSS3 although I would also like the ability to define the ability to keep text together in a paragraph and set widow and orphan levels).

Every browser to follow the same standard. :wink:
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

Variables...

Think about changing the colours of your site by editing 5 variables at the top of the stylesheet, or being able to seperate them into their own file and changing them by including the appropriate "theme" file...
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Scrap it and use LaTeX/PostScript instead.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

nickvd wrote:Variables...

Think about changing the colours of your site by editing 5 variables at the top of the stylesheet, or being able to seperate them into their own file and changing them by including the appropriate "theme" file...
You could manipulate class inheritance that way. Place the colors you need in some base class and have all the classes which use that scheme extend it.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

d11wtq wrote:You could manipulate class inheritance that way. Place the colors you need in some base class and have all the classes which use that scheme extend it.
What advantage does class inheritance have over using two classes? I can't see it. Besides a small reduction in the amount of code I see no advantage of inheriting in the stylesheet over 'inheriting' using two classes on one element.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

onion2k wrote:
d11wtq wrote:You could manipulate class inheritance that way. Place the colors you need in some base class and have all the classes which use that scheme extend it.
What advantage does class inheritance have over using two classes? I can't see it. Besides a small reduction in the amount of code I see no advantage of inheriting in the stylesheet over 'inheriting' using two classes on one element.
It just means that currently you have to use more markup and more repitition to acheive the same task. Just my personal wishlist item :)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

nickvd wrote:Variables...

Think about changing the colours of your site by editing 5 variables at the top of the stylesheet, or being able to seperate them into their own file and changing them by including the appropriate "theme" file...
This is doable now, you just have to use two different stylesheets (actually, you can get away with one, but separating the layout from the colors has its advantages). Basically you set your layout scheme, then include another stylesheet with the colors for each element you want to color.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

Everah wrote:
nickvd wrote:Variables...

Think about changing the colours of your site by editing 5 variables at the top of the stylesheet, or being able to seperate them into their own file and changing them by including the appropriate "theme" file...
This is doable now, you just have to use two different stylesheets (actually, you can get away with one, but separating the layout from the colors has its advantages). Basically you set your layout scheme, then include another stylesheet with the colors for each element you want to color.
But if you're using the same 4 or 5 colours in say, 20 locations throughout a 30kb stylesheet, changing the colours at the top will change all occurences. Yeah, there's find/replace, but this is neater, and can be used for width, height, font's etc... I think it could be very very useful..
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

You can also have your .css file be a php file and set the colors via php... :)
Post Reply