Skip to content
Snippets Groups Projects

Fix wrong body css while toggling visibility

Closed Tae Hoon requested to merge tae/pleroma-fe:648 into develop
2 unresolved threads

closes #648 (closed)

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

Edited by Tae Hoon

Merge request reports

Pipeline #16418 passed

Pipeline passed for 89e7e1f3 on tae:648

Closed by Tae HoonTae Hoon 5 years ago (Aug 27, 2019 4:18pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
20 20 </div>
21 21 <button
22 22 class="new-status-button"
23 :class="{ 'hidden': isHidden }"
23 :class="{ 'new-status-button-hidden': isHidden }"
  • Maintainer

    why

  • just less ambiguous naming I guess

  • Maintainer

    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.

  • changed this line in version 3 of the diff

  • Author Contributor

    renamed using BEM

  • Maintainer

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

  • Author Contributor

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

  • Maintainer
    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

  • Author Contributor

    rewritten using the classic scheme

  • Please register or sign in to reply
  • Tae Hoon added 1 commit

    added 1 commit

    Compare with previous version

  • HJ
    HJ @hj started a thread on the diff
  • 51 51 -moz-osx-font-smoothing: grayscale;
    52 52 }
    53 53
    54 .hidden {
    • Maintainer

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

    • Author Contributor

      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.

    • Maintainer

      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 Contributor

      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.

    • Maintainer

      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 Contributor

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

    • Maintainer

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

    • Please register or sign in to reply
  • Tae Hoon added 1 commit

    added 1 commit

    • 1840cdcf - use the classic naming scheme

    Compare with previous version

  • Tae Hoon added 10 commits

    added 10 commits

    Compare with previous version

  • Author Contributor

    moved to !930 (merged)

  • closed

  • Please register or sign in to reply
    Loading