honestbleeps / Reddit-Enhancement-Suite

Reddit Enhancement Suite
http://redditenhancementsuite.com
GNU General Public License v3.0
4.16k stars 880 forks source link

Replace [](#/RES_SR_Config/NightModeCompatible) by pure CSS #1194

Open matheod opened 10 years ago

matheod commented 10 years ago

I suggest that we replace (or more exactly, add a better way, while keeping old trick for compatibility) the trick :

[This subreddit is night mode compatible](#/RES_SR_Config/NightModeCompatible)

With something in pure CSS.

I.e. Res could add an empty div with the id RES_NightModeCompatible and RES could check his display css value. (or any other css value, for example we could use clear:none).

The main idea is to put the trick in Css, because ... it's only related to css. And this would avoid broke things if someone remove the old trick by error.

matheod commented 10 years ago

02:26:32 andytubaud it would be interesting to create a modules['currentSubredditInfo'] 02:26:45 andytubaud utility module 02:27:27 andytubaud and it would act as the interface between other modules and subreddit settings 02:27:36 matheod yea 02:27:39 matheod I may do that 02:27:47 matheod hidden module ? 02:27:53 andytubaud modules['currentSubredditInfo'].getFlagValue('NightModeCompatible') 02:27:58 matheod yea 02:28:06 andytubaud yeah hidden

honestbleeps commented 10 years ago

I'm personally not sure I'm a fan of the idea of doing it in pure CSS. That seems unintuitive...

"to disable feature X, use 'clear: none;', to disable feature Y, use 'background-color: #fff'" etc.. it seems rather arbitrary... I don't really see drawbacks to the current system.

jewel-andraia commented 10 years ago

the main reason i see for this is to protect inattentive mods who only edit content in the sidebar from accidentally blowing away the config flags.

jewel-andraia commented 10 years ago

(but yeah i'm not super sold on the need to change where the flags live. however, the module seems worth building.)

matheod commented 10 years ago

Well the idea would be to keep a logic on the css property used. I thinked of z-index for bolean value.

jewel-andraia commented 10 years ago

i was just brainstorming new flags the subreddit mods could throw in, like theme colors so RES can automatically set colors like comment backgrounds.

matheod commented 10 years ago

the main reason i see for this is to protect inattentive mods who only edit content in the sidebar from accidentally blowing away the config flags.

Yea, moreover, the #/RES_SR_Config/NightModeCompatible thing is 100% related with the CSS, so it should be directly in the css.

matheod commented 10 years ago

Just an update on this => flag should use the content css property because it allow any text, so more flexible :)