Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to put relationships/contraints into CSS? [closed]

Tags:

css

In every design tool or art principle I've heard of, relationships are a central theme. By relationships I mean the thing you can do in Adobe Illustrator to specify that the height of one shape is equal to half the height of another. You cannot express this information in CSS. CSS hard-codes all values. Using a language like LESS that allows variables and arithmetic you can get closer to relationships but it's still a CSS variant.

This inability in my mind is the biggest problem with CSS. CSS is supposed to be a language that describes the visual component of a Web page but it ignores relationships and contraints, ideas that are at the core of art.

How possible is it to imagine a new Web design language that can express relationships and contraints that can be implemented in JavaScript using the current CSS properties?

like image 800
hekevintran Avatar asked May 04 '10 05:05

hekevintran


2 Answers

Are you looking for something like CSS Scripting Layout Specification or Constraint Cascading Style Sheets for the Web? Both are still in the research/prototype stage though.

The CSS Scripting Layout Specification has been implemented as a Google Chrome plugin, it seems.

like image 129
Sebastian Avatar answered Sep 26 '22 03:09

Sebastian


If you set the size attributes using a percentage, and place the element as a child of the one you're sizing, you will be able to size an element relatively to another. Then, use positioning to move the child outside the parent physically.

like image 38
Delan Azabani Avatar answered Sep 23 '22 03:09

Delan Azabani