Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Avoid extending classes #128

@manuszep

Description

@manuszep

Hi,

I noted that @extend .class-name is used quite a bit in the framework. From experience, this is something that can go wrong quite quickly and silently.

If anybody happen to use the extended class in any other selector further in the development, that selector will be parsed and repeated as many times as the original class is extended. Which increases file size and degrades performance.

As this is a bit hard to explain, I've made an example in SassMeister : http://www.sassmeister.com/gist/d81693efe6bf640af06d86e2af983305

It's best to use placeholders. The difference is shown in the example above.

Mixins are even better.
There will be more repetition in the final code but Gzip performs very well on repetition.
It's more efficient to repeat 1000 times exactly the same thing than sharing 1000 unique selectors.

Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions