Page 1 of 1

read a CSS file output samples

Posted: Mon Mar 19, 2007 6:04 am
by Kaervek
Is there a php function/file/class or any other utility that i can put on my domain that will open and read a css file and output samples of all the styles therein?

sort of like a css pallet page, that i can look at and select the style i want.

Posted: Mon Mar 19, 2007 9:53 am
by feyd
I haven't heard of such a thing. Interesting idea though.

Posted: Mon Mar 19, 2007 10:58 am
by Kaervek
isnt it tho...
i thought of writing one the other day but decided to look around the net first... why reinvent the wheel right?

Posted: Mon Mar 19, 2007 11:19 am
by mikeq
A quick read of my Javascript book shows you can with Javascript

The DOM makes it possible to traverse stylesheets, they are in a stylesheets array. document.styleSheets[]

Code: Select all

//the first style sheet
var ss = document.styleSheets[0];
each rule is in a cssRules[] array

Code: Select all

var firstRule = ss.cssRules[0];
have a look on google

Posted: Mon Mar 19, 2007 1:17 pm
by Kaervek
It is better to be thought a fool and keep silent, than to open your mouth and remove all doubt.
-Mark Twain

Posted: Tue Mar 20, 2007 3:05 am
by mikeq
Dont know if that is a reply to my post, an insult or just a statement about the quote in my signature :cry: