Alternate Stylesheets
Original demo by Vincent Hardy, published August 14, 2010.
Open Alternate Stylesheets in the gallery
This demo made a simple point that was easy to miss in 2010: SVG inside a page is styled by the same CSS as the HTML around it. One document held a small control bar and a logo, and three linked stylesheets gave them completely different looks.
The colored sheet used a crimson panel, a green cloud and drop shadows. The neutral sheet went gray, and the third reduced everything to a black and white outline. Each sheet addressed the SVG shapes by ID and set their fills, strokes and filters, while also styling the page background and the controls.
Switching was done with a few lines of script that toggled the disabled property of each link element. That original approach still works in Chromium, Firefox and WebKit, so it was kept.
For this restoration we removed an embedded font that the drawing never used and an unused library reference. A background image became a CSS gradient, and the layout now fits narrow screens. The three controls can be reached and used from the keyboard.
This note was newly written for the reconstruction. Read the original post in the Internet Archive.
Topics: Style