read a CSS file output samples

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Kaervek
Forum Commoner
Posts: 25
Joined: Fri Jul 08, 2005 7:17 am
Location: Newfoundland
Contact:

read a CSS file output samples

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I haven't heard of such a thing. Interesting idea though.
Kaervek
Forum Commoner
Posts: 25
Joined: Fri Jul 08, 2005 7:17 am
Location: Newfoundland
Contact:

Post 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?
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post 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
Kaervek
Forum Commoner
Posts: 25
Joined: Fri Jul 08, 2005 7:17 am
Location: Newfoundland
Contact:

Post by Kaervek »

It is better to be thought a fool and keep silent, than to open your mouth and remove all doubt.
-Mark Twain
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post 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:
Post Reply