Stylus: Can't disable some buggy styles

Created on 24 Jul 2018  路  10Comments  路  Source: openstyles/stylus

  • Browser: Firefox 61
  • Operating System: MacOS
  • Screenshot:
    screen shot 2018-07-24 at 2 31 37 pm

I keep getting migraines from position:sticky and position:fixed elements, so I have been trying to switch them to position:static or position:absolute. My latest desperate attempt to avoid the migraines involved * {position:absolute} ... it not only broke most pages, it broke the Stylus page so I can't disable and edit it.

Most helpful comment

Right-click the icon:

disable

All 10 comments

Can you disable it in the popup?

If you have the editor still opened (the page moz-extension://e48231ef-34bc-434b-984c-d60f008a59dd/edit.html?id=<number> ) focus URL bar, press tab three times (it focuses the "Enabled" checkbox) and then press spacebar (unchecks it).

Tangentially related, for coping with annoying fixed/sticky elements I often use this bookmarklet that simply removes anything that is "stuck" and enables scroll for elements that had hidden overflow (so it clears modals and such):
javascript:((u,n,s,t,i,c,k)=>n.querySelectorAll('*').forEach(e=>{/fixed|sticky/.test((s=getComputedStyle(e)).position)&&e!==n.documentElement&&e!==(t=n.body)&&t.contains(e)&&e.parentNode.removeChild(e)||/hidden/.test(s[u])&&e.style.setProperty(u,'auto','important')}))('overflow',document)

Sadly, for this task to be univesal the JavaScript is the only option: you cannot target your CSS to computed property values of author styles.

Right-click the icon:

disable

Ah, thanks. Is there a way to manually edit styles?

Code goes in the editor. =)

@MarjaE2, restrain the code to a URL prefix, for example, http, so that it won't apply to Stylus pages.

I talked to her last week on US.o about this. She wants to negate fixed positioning on everything globally, which is pretty much impossible without causing way worse problems than you started with. I sympathize with the argument that "nothing is worse", but completely unusable _is_ worse, and that's what you'll end up with quite often.

It's possible to replace position: sticky and variants in all the incoming web traffic, which might be less destructive. In Firefox this should be possible using an extension. In Chrome it would require using a MitM proxy like Fiddler.

If you are OK with simply destructing anything sticky, I've posted aforementioned bookmarklet as user script : https://greasyfork.org/en/scripts/370572-sweep-stickies/code .

UA string on US.o was FF IIRC. She appears to be learning basic CSS, so I doubt she'll be making her own extension any time soon. Seems like a pretty good cause if anyone's feeling charitable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HoLLy-HaCKeR picture HoLLy-HaCKeR  路  74Comments

darkred picture darkred  路  58Comments

vsemozhetbyt picture vsemozhetbyt  路  39Comments

saxamaphone69 picture saxamaphone69  路  64Comments

Keith94 picture Keith94  路  32Comments