Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Code Housekeeping #3026

Merged
merged 14 commits into from
Aug 21, 2021
Merged

CSS Code Housekeeping #3026

merged 14 commits into from
Aug 21, 2021

Conversation

SychO9
Copy link
Member

@SychO9 SychO9 commented Aug 15, 2021

Progresses #2600

Changes proposed in this pull request:
General cleanup of certain bits of code, all safe and doesn't change anything.

  • Removed dead code.
  • Used CSS Variables in certain scopes to improve customizability.

Reviewers should focus on:
🤷🏼‍♂️

Confirmed

  • Frontend changes: tested on a local Flarum installation.

@SychO9 SychO9 added this to the 1.1 milestone Aug 15, 2021
@SychO9 SychO9 self-assigned this Aug 15, 2021
@davwheat
Copy link
Member

davwheat commented Aug 15, 2021

I'm definitely in favour of this direction. We should also remove all our vendor mixins (.transition(), .box-shadow()) as part of this PR.

@SychO9
Copy link
Member Author

SychO9 commented Aug 15, 2021

I'm definitely in favour of this direction. We should also remove all our vendor mixins (.transition(), .box-shadow()) as part of this PR.

Yes as part of this PR and not others if you see what I mean :P

@SychO9
Copy link
Member Author

SychO9 commented Aug 15, 2021

Actually, removing the mixins would break any extensions using them 🤔

I'll just remove their usage for now.

Copy link
Member

@davwheat davwheat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to remove the usages of translate3d. We can use normal translate instead.

This was a hack to force a separate compositing layer which was GPU optimised, but modern browsers do this automatically if transform is animated in any way in CSS.

We should also remove the unneeded ~"" surrounding some of the property values.

Couldn't be modify the mixing to only create the unprefixed version of each of the properties? That way extensions using them don't break, but they don't have the vendor prefixes either.

less/common/Modal.less Outdated Show resolved Hide resolved
less/common/Modal.less Outdated Show resolved Hide resolved
less/common/Search.less Outdated Show resolved Hide resolved
Copy link
Member

@davwheat davwheat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the multiple reviews. My fat fingers kept pressing the wrong button on mobile.

less/forum/PostStream.less Outdated Show resolved Hide resolved
less/forum/PostStream.less Outdated Show resolved Hide resolved
less/forum/SignUpModal.less Show resolved Hide resolved
less/common/App.less Outdated Show resolved Hide resolved
less/common/App.less Outdated Show resolved Hide resolved
less/common/Checkbox.less Outdated Show resolved Hide resolved
less/common/Dropdown.less Outdated Show resolved Hide resolved
less/common/Dropdown.less Outdated Show resolved Hide resolved
less/common/mixins/header-background.less Outdated Show resolved Hide resolved
less/forum/Composer.less Outdated Show resolved Hide resolved
less/forum/Composer.less Outdated Show resolved Hide resolved
less/forum/Post.less Outdated Show resolved Hide resolved
less/forum/Slidable.less Outdated Show resolved Hide resolved
@SychO9
Copy link
Member Author

SychO9 commented Aug 20, 2021

We might want to remove the usages of translate3d. We can use normal translate instead.

This was a hack to force a separate compositing layer which was GPU optimised, but modern browsers do this automatically if transform is animated in any way in CSS.

I couldn't find anything online about this to make sure it's no longer necessary :/

Couldn't be modify the mixing to only create the unprefixed version of each of the properties? That way extensions using them don't break, but they don't have the vendor prefixes either.

The deprecated mixins here are all vendor-less though, you removed them in a previous PR.

# Conflicts:
#	less/common/Badge.less
@davwheat
Copy link
Member

Take a look at this: https://www.smashingmagazine.com/2016/12/gpu-animation-doing-it-right/#use-css-transitions-and-animations-whenever-possible

Elements with transform properties, transitions with transform, animations with keyframes that contain transform, or will-change: transform are automatically promoted to compositing layers.

The deprecated mixins here are all vendor-less though, you removed them in a previous PR.

Oops. I forgot I did that. 😅

@SychO9 SychO9 marked this pull request as ready for review August 21, 2021 17:44
@SychO9 SychO9 changed the title [WIP] CSS Code Housekeeping CSS Code Housekeeping Aug 21, 2021
@SychO9 SychO9 requested a review from davwheat August 21, 2021 17:44
@SychO9
Copy link
Member Author

SychO9 commented Aug 21, 2021

This should be enough for now.

@SychO9 SychO9 merged commit af89b23 into master Aug 21, 2021
@SychO9 SychO9 deleted the sm/css-code-cleanup branch August 21, 2021 18:34
askvortsov1 added a commit that referenced this pull request Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants