MozillaZine

Config of Alternate Stylesheet Switcher

Talk about add-ons and extension development.
Zaphod

User avatar
 
Posts: 175
Joined: November 22nd, 2002, 12:07 am
Location: Munich, DE\Europe

Post Posted December 2nd, 2002, 3:50 pm

Can anyone tell me how to config the Alternate Stylesheet Switcher Extension? I only see the option 'Use style\Basic page style' in the Options-menu. How i have to set up my own style? Can i access various styles via hotkey?

clav
 
Posts: 1974
Joined: November 5th, 2002, 3:25 am
Location: Lancaster, UK

Post Posted December 2nd, 2002, 5:00 pm

it only lets you choose alternate stylesheets supplied by the webpage you are viewing (i assume)

I have been working on an extension to let you apply any stylesheet you want to a page, but its far from complete

Zaphod

User avatar
 
Posts: 175
Joined: November 22nd, 2002, 12:07 am
Location: Munich, DE\Europe

Post Posted December 2nd, 2002, 5:06 pm

clav wrote:it only lets you choose alternate stylesheets supplied by the webpage you are viewing (i assume)

Oh ... :-( Thanks for clearing that point.
I thought i can create and choose my own style, to choose it for crappy pages (like User-Mode in Opera).

I have been working on an extension to let you apply any stylesheet you want to a page, but its far from complete

Sounds good :-). Let me know if its finished. I'm always interessted in such an extension.

priior

User avatar
 
Posts: 374
Joined: November 10th, 2002, 3:45 pm
Location: montreal

Post Posted December 2nd, 2002, 6:38 pm

clav wrote:it only lets you choose alternate stylesheets supplied by the webpage you are viewing (i assume)


indeed.

basic page style is the <link rel="stylesheet" ... />

and the other ones the <link rel="alternate stylesheet" ... />

Stefan

User avatar
 
Posts: 2051
Joined: November 5th, 2002, 2:46 am

Post Posted December 2nd, 2002, 7:03 pm

You will probably also need to provide a name for the (alternate) stylesheet eg title="Default"

Zaphod

User avatar
 
Posts: 175
Joined: November 22nd, 2002, 12:07 am
Location: Munich, DE\Europe

Post Posted December 3rd, 2002, 3:07 am

Does anybody know another extension that can switch between user\normal-mode (in opera its called author\user-mode)? Otherwise i will wait for clavs extension ;-)

alanjstr
Moderator

User avatar
 
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here

Post Posted December 3rd, 2002, 7:30 am

Zaphod wrote:Does anybody know another extension that can switch between user\normal-mode (in opera its called author\user-mode)? Otherwise i will wait for clavs extension ;-)


userContent.css ;-)

clav
 
Posts: 1974
Joined: November 5th, 2002, 3:25 am
Location: Lancaster, UK

Post Posted December 3rd, 2002, 8:35 am

you can use the following bookmarklet to toggle stylesheets fro the current page:

javascript:var i=0;if(document.styleSheets.length>0){cs=!document.styleSheets[0].disabled;for(i=0;i<document.styleSheets.length;i++) document.styleSheets[i].disabled=cs;};void(cs=true);

not sure where i got it from.

It doesn't work properly on pages that provide alternate stylesheets though, because when you toggle stylesheets back on with it it enables all the stylesheets for the page simultaneously. Try it at http://www.w3.org/Style/CSS/Test/ to see what i mean

Zaphod

User avatar
 
Posts: 175
Joined: November 22nd, 2002, 12:07 am
Location: Munich, DE\Europe

Post Posted December 3rd, 2002, 10:19 am

clav wrote:you can use the following bookmarklet to toggle stylesheets fro the current page:

javascript:var i=0;if(document.styleSheets.length>0){cs=!document.styleSheets[0].disabled;for(i=0;i<document.styleSheets.length;i++) document.styleSheets[i].disabled=cs;};void(cs=true);

not sure where i got it from.

It doesn't work properly on pages that provide alternate stylesheets though, because when you toggle stylesheets back on with it it enables all the stylesheets for the page simultaneously. Try it at http://www.w3.org/Style/CSS/Test/ to see what i mean

Yeah, seems to work :-) Thanks for that nice bookmarklet.
.... but to have an extension would be much cooler ;-)

richwklein
 
Posts: 331
Joined: November 24th, 2002, 8:20 pm
Location: Iowa

Post Posted December 5th, 2002, 8:02 am

It would be nice it one of the options on the alternate style switch was to remove all styles.

alanjstr
Moderator

User avatar
 
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here

Post Posted December 5th, 2002, 8:36 am

richwklein wrote:It would be nice it one of the options on the alternate style switch was to remove all styles.


I use styles to position elements on my websites (instead of using Tables incorrectly). Removing the style would make my site unreadable (kinda like using Netscape 4).

Stefan

User avatar
 
Posts: 2051
Joined: November 5th, 2002, 2:46 am

Post Posted December 5th, 2002, 9:50 am

alanjstr wrote:I use styles to position elements on my websites (instead of using Tables incorrectly). Removing the style would make my site unreadable .


That is a bad design then.
CSS is not just about making the page look good in a Graphical browser, but also in non graphical browsers (eg text, braille and non CSS browsers).

If your page becomes unreadable without CSS active, you might as well use nested <table>s instead.

alanjstr
Moderator

User avatar
 
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here

Post Posted December 5th, 2002, 10:34 am

Stefan wrote:
alanjstr wrote:I use styles to position elements on my websites (instead of using Tables incorrectly). Removing the style would make my site unreadable .


That is a bad design then.
CSS is not just about making the page look good in a Graphical browser, but also in non graphical browsers (eg text, braille and non CSS browsers).

If your page becomes unreadable without CSS active, you might as well use nested tables instead.


It's readable, it just doesn't look right. And CSS is about layout, not content. Which is exactly why you're not supposed to use tables. If I used tables, it would be purely to make things look 'right' and would be more likely to be mis-interpretted by non-graphical browsers.

My site is standards compliant.

seb

User avatar
 
Posts: 1578
Joined: November 4th, 2002, 11:26 pm
Location: Paris, France

Post Posted December 5th, 2002, 10:42 am

alanjstr wrote:It's readable, it just doesn't look right.

Do you use semantic markup? (ie. <ul>'s & <li>'s for list of links, <h[1-6]>'s for titles, and so on...)
If yes, your site should look right in non-graphical browsers, or in browsers that do not support CSS.
If no, then use semantic markup :)

For example, the page for my Phoenix Installer is totally unreadable when you use Lynx, while this one is correctly displayed under Lynx. (I'll update the Phoenix Installer page soon :)

Stefan

User avatar
 
Posts: 2051
Joined: November 5th, 2002, 2:46 am

Post Posted December 5th, 2002, 11:09 am

alanjstr wrote:CSS is about layout, not content.


Yes, but CSS is also about "degrading gracefully".

My site is standards compliant.


A page that validates at eg http://validator.w3.org doesn't nessecarily mean you are using the markup correctly. The validator can only pick up on syntax and spelling errrors, not logical errors :)

The real advantage of CSS vs tables is that you can make a webpage that looks really good in eg a textbrowser and then use CSS to position everything in just the right place in a graphical browser to make it pretty :)
With tables it's rather an either or situation.
Last edited by Stefan on December 5th, 2002, 11:10 am, edited 1 time in total.

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 2 guests