konami-command icon indicating copy to clipboard operation
konami-command copied to clipboard

remove style from script

Open jerry-sileon opened this issue 1 year ago • 4 comments

I would suggest removing any styles from the script. Functionality and UI should be separated, so style scripts (dark mode etc.) can focus on the UI part. There are several places in the script where elements are added with hard-coded styles. These should be removed, replaced by the css variables that are already available in the MB style (although there are not a lot yet) or existing classes. This also applies to the settings page which is quite unreadable when MusicBrainz Dark is installed, for example.

jerry-sileon avatar May 22 '24 07:05 jerry-sileon

Thank you for this ticket. Could you add some pictures of the culprit elements?

I don't think I can use variable because I guess, but didn't check yet, that they are some .less variables, that are later converted to .css values, at run time.

But I can use MB classes. I usually do so, but mostly in more recent scripts and also I don't use a dark mode CSS. Do I didn't include these tests in my mind, yet.

jesus2099 avatar May 22 '24 11:05 jesus2099

FWIW, this is how the settings look like with my userstyle companion: image But I have to use !important a lot to make some userscript elements readable at all. Maybe these are a good indicator where you can start looking for possible improvements.

kellnerd avatar May 22 '24 11:05 kellnerd

Thanks @kellnerd, I didn't find those css variables/custom properties like --background-accent. Neither in my devtools (F12) nor in https://github.com/search?q=repo%3Ametabrainz%2Fmusicbrainz-server%20background-accent&type=code Where are they? :) I'm sure I didn't search well enough...

jesus2099 avatar May 22 '24 15:05 jesus2099

Oh sorry, these are only defined in my userstyle, I should have mentioned that. I don't think MBS makes use of CSS variables in its bundled CSS currently.

kellnerd avatar May 22 '24 16:05 kellnerd

@jerry-sileon

It is important that userscript content is not confused with genuine MBS content. Otherwise, people could think MBS is very buggy, once an obsolete userscript starts acting weird. And otherwise, people could take some userscript data for granted, although they be wrong. So I will usually not use MBS standard styles.

And I don't think there are MBS style variables that userscripts can use. But if so, or if you have another suggestion, please let me know and I will reopen the ticket. :)

jesus2099 avatar Aug 23 '24 14:08 jesus2099