Fix wrong body css while toggling visibility #2191

Closed
tae wants to merge 5 commits from gitlab-mr-iid-924 into develop
Member

closes #648

"display: initial" caused the issue. we can avoid this using css class.

closes #648 "display: initial" caused the issue. we can avoid this using css class.
Member

MR is very messy, not clear what's wrong with current implementation, a lot of seemingly unrelated changes.

MR is very messy, not clear what's wrong with current implementation, a lot of seemingly unrelated changes.
Member

why

why
Member

just less ambiguous naming I guess

just less ambiguous naming I guess
Member

well as far as I understand the reason is that global .hidden rule was added, which is IMO bad.

alternatives are BEM-style _hidden_yes (or _hidden) modifier, i.e. .new-status-button_hidden, which is sorta done here and lastly there's .new-status-button.hidden which i would prefer.

overall our CSS needs to be groomed, we just need to agree on style.

well as far as I understand the reason is that global `.hidden` rule was added, which is IMO bad. alternatives are BEM-style `_hidden_yes` (or `_hidden`) modifier, i.e. `.new-status-button_hidden`, which is sorta done here and lastly there's `.new-status-button.hidden` which i would prefer. overall our CSS needs to be groomed, we just need to agree on style.
Author
Member

renamed using BEM

renamed using BEM
Member

if you replace this with body.hidden pretty much all other changes (except for setting the class) will be unnecessary

if you replace this with `body.hidden` pretty much all other changes (except for setting the class) will be unnecessary
Author
Member

that also works 👍

but I'd like to keep it as a global rule since it is very useful to remove duplicated css rules.

that also works :thumbsup: but I'd like to keep it as a global rule since it is very useful to remove duplicated css rules.
Member

it's more harmful than useful since you might need other ways of hiding things and you'll have to undo the display: none somehow in that way

it's more harmful than useful since you might need other ways of hiding things and you'll have to undo the `display: none` somehow in that way
Author
Member

if I need other ways of hiding things instead of display: none (which is very common), I'd rather define another modifier for the specific element.

if I need other ways of hiding things instead of `display: none` (which is very common), I'd rather define another modifier for the specific element.
Member

that's... not entirely bem, at least not canonical way

that's... not entirely bem, at least not canonical way
Author
Member

huh? I used BEM for years. block__element--modifier is the main rule. plz, correct me if wrong.

huh? I used BEM for years. `block__element--modifier` is the main rule. plz, correct me if wrong.
Member
block__element
block_modifier_modifier-value
block__element_element-modifier_element-modifier-value

so in short, __ two underscores for elements, _ one underscore for modifier and modifier value (if given)

at least that's how it was in a certain company related to BEM creation back in 2015, maybe they changed it, which seems to be the case on (new) official site.

again as I mentioned in other place, changing that place will remove necessity for this change altogether

``` block__element block_modifier_modifier-value block__element_element-modifier_element-modifier-value ``` so in short, `__` two underscores for elements, `_` one underscore for modifier and modifier value (if given) at least that's how it was in a **certain company related to BEM creation** back in 2015, maybe they changed it, which seems to be the case on (new) official site. again as I mentioned in other place, changing that place will remove necessity for this change altogether
Member

yeah but it breeds inconsistency and CSS cruft. You have .hidden and you have .some-component_hidden , let's say you want to make a component but the context requires you to use transform: translate(-99999px) instead of display: none but you write rule like .some-other-component.hidden and wonder why it doesn't work properly and have to figure out that you have .hidden rule defined globally and have to do either .tucked-away global rule which does the translate(-9999px) or .some-other-component_hidden and both are kinda screwy.

It's been time-tested that overly-generic global css rules like .hidden .float and others do not do much good and do more harm than intended.

I'm gonna make an issue about grooming our CSS...

yeah but it breeds inconsistency and CSS cruft. You have `.hidden` and you have `.some-component_hidden` , let's say you want to make a component but the context requires you to use `transform: translate(-99999px)` instead of `display: none` but you write rule like `.some-other-component.hidden` and wonder why it doesn't work properly and have to figure out that you have `.hidden` rule defined globally and have to do either `.tucked-away` global rule which does the `translate(-9999px)` or `.some-other-component_hidden` and both are kinda screwy. It's been time-tested that overly-generic global css rules like `.hidden` `.float` and others do not do much good and do more harm than intended. I'm gonna make an issue about grooming our CSS...
Author
Member

rewritten using the classic scheme

rewritten using the classic scheme
Author
Member

are you fine with the current changes using BEM for now or asking me to revert?

are you fine with the current changes using BEM for now or asking me to revert?
Member

either way is fine. It's not that big of a deal, but global .hidden isn't good that's for sure.

either way is fine. It's not that big of a deal, but global `.hidden` isn't good that's for sure.
Author
Member

moved to #2197

moved to https://git.pleroma.social/pleroma/pleroma-fe/pulls/2197

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pleroma/pleroma-fe!2191
No description provided.