Closed ghost closed 2 years ago
Just asking: Did you test the code yet? Does it work even if used multiple times?
Should you specify that this is JS tips and tricks, or does it include CSS too?
- Is it really necessary to check that the style hasn’t been added already?
Not in this case, but generally it’s better not to add it too many times (& some mods call the function several times). It’s a common practice & related to that tip.
- Wouldn’t an IIFE be recommended to ensure that the multiple different ‘style’ variables do not overlap?
It isn’t related to that tip & there’s no reason to only insert CSS (except for testing if JS mods work). Also, it should only be in the scope of that if
.
- Isn’t the IIFE covered by the “First JS Mod”?
Not yet. It can be taken out at any time.
Just asking: Did you test the code yet? Does it work even if used multiple times?
Works as expected.
Should you specify that this is JS tips and tricks, or does it include CSS too?
See the sections.
Ok, makes sense.
Should you make it clear that myModStyle
MUST be replaced with your mods's name, or is it self-explanatory?
Also, it should only be in the scope of that
if
.
I meant if you take the if
out, which you explained wouldn't be good, although I would (briefly) mention the myModStyle
must be changed or else the if
will prevent multiple mod styles following that code from being inserted.
Would this be the place to show how to pause the UI with the debugger and setting breakpoints ?
Would this be the place to show how to pause the UI with the debugger and setting breakpoints ?
Nope, that’s for some (probably ‘advanced’) devtools guide.
As soon as you can, could you create sections for:
I don’t mean actually write the sections, you could just add a heading and leave it empty for now. If you don’t think they should be in Tips & Tricks that’s fine (but where would you want them to be, if anywhere?).
- Dealing with Vivaldi’s lack of class names (e.g., use :is(.left, .right) because there is no .vertical class for tabs,
- Using higher-priority selectors to override the inbuilt styles
Heehee. Haven’t I recently asked you to put something like these into #38? 😀
or using a title= to select the reload button)
I’m not sure about this, since it is a more specific case. I’ll think about it.
Yeah, I know, I'd mention these things in #38 but I think they may need elaboration*. Let me keep working on it and see how it goes.
*For instance, I will likely use style= as a selector but not title=, will probably not have a chance to use is: but will use not:, will use !important to override but not a selector to override. I guess an option would be to but these extra things in spoilers or quote blocks
Closing, as per #42.
Resolves #26
References #30
For now, blocked by #38