-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
refactor spinners SCSS #27655
refactor spinners SCSS #27655
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't change the modifier classes like that without changing the
width: $spinner-width-sm; | ||
height: $spinner-height-sm; | ||
border-width: $spinner-border-width-sm; | ||
&.spinner-sm { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not use the &
here, we don't do that for other modifiers, eg .btn-lg
:
Line 110 in d96c147
.btn-lg { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the class is not correct
} | ||
|
||
.spinner-border { | ||
%spinner { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Watch out with extends, you idea was probably to generate less code, but with this technique, you've added 2 extra selectors. I would prefer to see a mixin instead, but don't know if @mdo also agrees?
I left a reply to your comment in #22960 about this—we won't be changing to an extend based approach as it adds more selectors. Plus, you've changed the selectors here, which are fine as-is with the base class and modifier classes approach. Thanks though :). |
Hi all,
latest SCSS code from #22960 did not work for me on spinner
-sm
classes.So I went along and refactored a little bit:
%spinner
whichspinner-border
andspinner-grow
both extendspinner-sm
modifier class which is used in combination withspinner-border
andspinner-grow
to make small spinners, this is the way bootstrap treats other classes as well@keyframes
to save more byteAny feedback is heavily welcome.
Have a nice weekend (or start in the week)
midzer