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

Avoid extending classes #128

Open
manuszep opened this issue Mar 30, 2017 · 0 comments
Open

Avoid extending classes #128

manuszep opened this issue Mar 30, 2017 · 0 comments

Comments

@manuszep
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant