Skip to content

Add spinners for Bootstrap#17822

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

Add spinners for Bootstrap#17822
LKay wants to merge 15 commits intotwbs:v4-devfrom
LKay:v4-dev-spinners

Conversation

@LKay
Copy link
Copy Markdown

@LKay LKay commented Oct 9, 2015

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
Copy link
Copy Markdown
Collaborator

cvrebert commented Oct 9, 2015

(Note: Will need squashing when merging)

@Izopi4a
Copy link
Copy Markdown

Izopi4a commented Oct 9, 2015

niiiice +1

@AntonTrollback
Copy link
Copy Markdown

+1

@cvrebert
Copy link
Copy Markdown
Collaborator

cvrebert commented Dec 1, 2015

CC: @mdo for review

@arg
Copy link
Copy Markdown

arg commented Dec 6, 2015

+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
Copy link
Copy Markdown
Author

LKay commented Apr 4, 2017

@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
Copy link
Copy Markdown
Member

Johann-S commented Apr 4, 2017

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

@januszm
Copy link
Copy Markdown

januszm commented Jun 24, 2017

👍

@mdo
Copy link
Copy Markdown
Member

mdo commented Jul 2, 2017

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