• Resolved Julianwave

    (@julianwave)


    Hi

    I have set up two stylesheets, one for “standard” and one for a reduced “text only” kind of view.

    I am finding that when I click for the “text only” stylesheet it seems to add the styles to the “standard” set, rather than replacing them.

    When I look in the html, making this choice does not disable or remove the standard styles, it just adds or removes the alternative style sheet to the full set of stylesheets.

    Could it be to do with using wp_enqueue_style?

    What I want is when a user clicks the switcher, all the css files ar edisabled except for the “text only” one.

    Thanks.

    https://www.ads-software.com/plugins/wp-user-stylesheet-switcher/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author vgstef

    (@vgstef)

    Hi,

    Do you have a website I could look at?

    If you want to disable all css files, you should set “Text only” in the plugin settings -> Option to remove stylesheets.

    But this would remove all css.

    hAve you tried it?

    Thread Starter Julianwave

    (@julianwave)

    Cant show you the site, sorry, client privacy etc…

    I can do the “remove all stylesheets – text only” thing, that works fine.

    A true text only is nearly what I am after, but some things, eg unstyled images, look terrible, so it is not quite right. So my intention is to have a very simple alternative stylesheet, that is basically just a tidying up of a “no styles” situation.

    What I need though is the alternative stylesheet to replace the main stylesheet. I was hoping the plugin would do this by disabling the “default” css file and replacing it with my alternative css file.

    However what seems to be happening is that if I click the style switcher, the styles from my alternative stylesheet are enabled (good), but the styles from the main stylesheet are not disabled (not good), meaning that a mixture of styles from both css files is used, which not surprisingly looks a bit messy!

    It may be my fault, something daft I have done – but I was just wondering if you had encountered this before and if so is there a solution you are aware of.

    Thanks,

    Julian

    Plugin Author vgstef

    (@vgstef)

    The plugin works the same way has child themes css files. It replaces the css of the class/id that we redefine.

    The plugin doesn’t know what specific css file to deactivate, because there a many, some from WordPress, some from the parent theme, some from plugins, etc.

    In your text-only css file, you could “reset” all classes/ids you don’t want. See accepted answer here : https://stackoverflow.com/questions/15901030/reset-remove-css-styles-for-element-only

    Hope this helps.

    Thread Starter Julianwave

    (@julianwave)

    Thanks,

    I dont think that will work for me though, there are too many custom styles to reset.

    I think I will try to make my own switcher using cookies to load different css files.

    Cheers and good luck!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘can't get alternative stylesheet to work’ is closed to new replies.