Skip to content

Add spinners for Bootstrap - #17822

Closed
LKay wants to merge 15 commits into
twbs:v4-devfrom
LKay:v4-dev-spinners
Closed

LKay wants to merge 15 commits into
twbs:v4-devfrom
LKay:v4-dev-spinners

Conversation

@LKay

@LKay LKay commented Oct 9, 2015

Copy link
Copy Markdown

Adds simple, lightweight spinners to Bootstrap 4 as it was mentioned on nice to have feature list (#17021).

Includes 4 types of spinners, supports bootstrap colors, sizes and different positioning.

Works out of the box for new browsers. To support IE9, small fallback plugin is included which inserts special element instead of using :before element and basic animation for rotating the element.

Some basic tests are also included.

Can be easily extended with new spinner variations if they are compatible with single element CSS spinner such as Single Element CSS Spinners or Loaders Kit

Comment thread scss/mixins/_spinners.scss Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Properties should be ordered width, height, margin-top, margin-left, font-size, border-width, border-radius

@cvrebert

cvrebert commented Oct 9, 2015

Copy link
Copy Markdown
Collaborator

(Note: Will need squashing when merging)

@Izopi4a

Izopi4a commented Oct 9, 2015

Copy link
Copy Markdown

niiiice +1

@AntonTrollback

Copy link
Copy Markdown

+1

@cvrebert

cvrebert commented Dec 1, 2015

Copy link
Copy Markdown
Collaborator

CC: @mdo for review

@arg

arg commented Dec 6, 2015

Copy link
Copy Markdown

+1

@ThorinDev

Copy link
Copy Markdown

+1

@mdo mdo added this to the v4.1 ideas milestone Sep 8, 2016
Comment thread scss/mixins/_spinners.scss Outdated
border-radius: 50%;
}

&:not(:required):before {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
}

@mixin spinner-dots-variant($color-first, $color-second, $width, $variant: "base") {
&:not(.spinner-fallback):before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated

}

&:not(:required):before {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
}

@mixin spinner-hourglass-variant($color) {
&:not(.spinner-fallback):before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
border-radius: 50%;
}

&:not(:required):before {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
}

@mixin spinner-comet-variant($color) {
&:not(.spinner-fallback):before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
border-radius: 50%;
}

&:not(:required):before {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
}

@mixin spinner-circle-variant($color-first, $color-second) {
&:not(.spinner-fallback):before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
min-width: $size;
min-height: $size;

&:before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/_spinners.scss Outdated
z-index: $zindex-spinner;
text-indent: -99999px;

&:before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
border-radius: 50%;
}

&:not(:required):before {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
}

@mixin spinner-dots-variant($color-first, $color-second, $width, $variant: "base") {
&:not(.spinner-fallback):before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated

}

&:not(:required):before {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
}

@mixin spinner-hourglass-variant($color) {
&:not(.spinner-fallback):before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
border-radius: 50%;
}

&:not(:required):before {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
}

@mixin spinner-comet-variant($color) {
&:not(.spinner-fallback):before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
border-radius: 50%;
}

&:not(:required):before {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
}

@mixin spinner-circle-variant($color-first, $color-second) {
&:not(.spinner-fallback):before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
min-width: $size;
min-height: $size;

&:before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/_spinners.scss Outdated
z-index: $zindex-spinner;
text-indent: -99999px;

&:before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
border-radius: 50%;
}

&:not(:required):before {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
}

@mixin spinner-dots-variant($color-first, $color-second, $width, $variant: "base") {
&:not(.spinner-fallback):before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated

}

&:not(:required):before {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
}

@mixin spinner-hourglass-variant($color) {
&:not(.spinner-fallback):before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
border-radius: 50%;
}

&:not(:required):before {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
}

@mixin spinner-comet-variant($color) {
&:not(.spinner-fallback):before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
border-radius: 50%;
}

&:not(:required):before {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
}

@mixin spinner-circle-variant($color-first, $color-second) {
&:not(.spinner-fallback):before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/mixins/_spinners.scss Outdated
min-width: $size;
min-height: $size;

&:before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

Comment thread scss/_spinners.scss Outdated
z-index: $zindex-spinner;
text-indent: -99999px;

&:before,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Begin pseudo elements with double colons: ::

@LKay

LKay commented Apr 4, 2017

Copy link
Copy Markdown
Author

@mdo It's been while but since IE9 support is officially dropped, I updated the PR and removed all fallbacks as CSS animations are supported natively in IE10+.

Anything left before it could be merged in and included in v4?

@Johann-S

Johann-S commented Apr 4, 2017

Copy link
Copy Markdown
Member

Hi @LKay you have build error see : https://travis-ci.org/twbs/bootstrap/jobs/218307896#L236

@januszm

januszm commented Jun 24, 2017

Copy link
Copy Markdown

👍

@mdo

mdo commented Jul 2, 2017

Copy link
Copy Markdown
Member

Coming in #22960 with v4.1.

@mdo mdo closed this Jul 2, 2017
@mdo mdo removed this from the v4.1 ideas milestone Jul 2, 2017
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.

10 participants