refactor: format code

This commit is contained in:
gcushen 2021-01-09 19:38:09 +00:00 committed by GitHub Action
commit 067b2a7f09
71 changed files with 2612 additions and 2098 deletions

View file

@ -27,5 +27,5 @@
border: 0;
margin: 0;
padding: 1px 0;
font-family: MJXc-TeX-math-I,MJXc-TeX-math-Ix,MJXc-TeX-math-Iw;
font-family: MJXc-TeX-math-I, MJXc-TeX-math-Ix, MJXc-TeX-math-Iw;
}

File diff suppressed because it is too large Load diff

View file

@ -179,7 +179,7 @@ if (typeof Fuse === 'function') {
let fuse = new Fuse(search_index, fuseOptions);
// On page load, check for search query in URL.
let query = getSearchQuery('q')
let query = getSearchQuery('q');
if (query) {
$('body').addClass('searching');
$('.search-results').css({opacity: 0, visibility: 'visible'}).animate({opacity: 1}, 200);

View file

@ -21,7 +21,6 @@
font-weight: $alert-link-font-weight;
}
// Dismissible alerts
//
// Expand the right padding and account for the close button's positioning.
@ -39,13 +38,16 @@
}
}
// Alternate styles
//
// Generate contextual modifier classes for colorizing the alert.
@each $color, $value in $theme-colors {
.alert-#{$color} {
@include alert-variant(theme-color-level($color, $alert-bg-level), theme-color-level($color, $alert-border-level), theme-color-level($color, $alert-color-level));
@include alert-variant(
theme-color-level($color, $alert-bg-level),
theme-color-level($color, $alert-border-level),
theme-color-level($color, $alert-color-level)
);
}
}

View file

@ -58,17 +58,20 @@
//
// Remix the default button sizing classes into new ones for easier manipulation.
.btn-group-sm > .btn { @extend .btn-sm; }
.btn-group-lg > .btn { @extend .btn-lg; }
.btn-group-sm > .btn {
@extend .btn-sm;
}
.btn-group-lg > .btn {
@extend .btn-lg;
}
//
// Split button dropdowns
//
.dropdown-toggle-split {
padding-right: $btn-padding-x * .75;
padding-left: $btn-padding-x * .75;
padding-right: $btn-padding-x * 0.75;
padding-left: $btn-padding-x * 0.75;
&::after,
.dropup &::after,
@ -82,16 +85,15 @@
}
.btn-sm + .dropdown-toggle-split {
padding-right: $btn-padding-x-sm * .75;
padding-left: $btn-padding-x-sm * .75;
padding-right: $btn-padding-x-sm * 0.75;
padding-left: $btn-padding-x-sm * 0.75;
}
.btn-lg + .dropdown-toggle-split {
padding-right: $btn-padding-x-lg * .75;
padding-left: $btn-padding-x-lg * .75;
padding-right: $btn-padding-x-lg * 0.75;
padding-left: $btn-padding-x-lg * 0.75;
}
// The clickable button for toggling the menu
// Set the same inset shadow as the :active state
.btn-group.show .dropdown-toggle {
@ -103,7 +105,6 @@
}
}
//
// Vertical button groups
//
@ -135,7 +136,6 @@
}
}
// Checkbox and radio options
//
// In order to support the browser's form validation feedback, powered by the
@ -153,8 +153,8 @@
> .btn-group > .btn {
margin-bottom: 0; // Override default `<label>` value
input[type="radio"],
input[type="checkbox"] {
input[type='radio'],
input[type='checkbox'] {
position: absolute;
clip: rect(0, 0, 0, 0);
pointer-events: none;

View file

@ -53,7 +53,6 @@ fieldset:disabled a.btn {
pointer-events: none;
}
//
// Alternate buttons
//
@ -70,7 +69,6 @@ fieldset:disabled a.btn {
}
}
//
// Link buttons
//
@ -101,20 +99,30 @@ fieldset:disabled a.btn {
// No need for an active state here
}
//
// Button Sizes
//
.btn-lg {
@include button-size($btn-padding-y-lg, $btn-padding-x-lg, $btn-font-size-lg, $btn-line-height-lg, $btn-border-radius-lg);
@include button-size(
$btn-padding-y-lg,
$btn-padding-x-lg,
$btn-font-size-lg,
$btn-line-height-lg,
$btn-border-radius-lg
);
}
.btn-sm {
@include button-size($btn-padding-y-sm, $btn-padding-x-sm, $btn-font-size-sm, $btn-line-height-sm, $btn-border-radius-sm);
@include button-size(
$btn-padding-y-sm,
$btn-padding-x-sm,
$btn-font-size-sm,
$btn-line-height-sm,
$btn-border-radius-sm
);
}
//
// Block button
//
@ -130,9 +138,9 @@ fieldset:disabled a.btn {
}
// Specificity overrides
input[type="submit"],
input[type="reset"],
input[type="button"] {
input[type='submit'],
input[type='reset'],
input[type='button'] {
&.btn-block {
width: 100%;
}

View file

@ -98,7 +98,6 @@
}
}
//
// Header navs
//
@ -142,7 +141,6 @@
@include border-bottom-radius($card-inner-border-radius);
}
// Card deck
.card-deck {
@ -166,7 +164,6 @@
}
}
//
// Card groups
//
@ -229,7 +226,6 @@
}
}
//
// Columns
//
@ -252,7 +248,6 @@
}
}
//
// Accordion
//

View file

@ -52,7 +52,6 @@
transform: translateX(-100%);
}
//
// Alternate transitions
//
@ -79,7 +78,6 @@
}
}
//
// Left/right controls for nav
//
@ -111,13 +109,13 @@
.carousel-control-prev {
left: 0;
@if $enable-gradients {
background-image: linear-gradient(90deg, rgba($black, .25), rgba($black, .001));
background-image: linear-gradient(90deg, rgba($black, 0.25), rgba($black, 0.001));
}
}
.carousel-control-next {
right: 0;
@if $enable-gradients {
background-image: linear-gradient(270deg, rgba($black, .25), rgba($black, .001));
background-image: linear-gradient(270deg, rgba($black, 0.25), rgba($black, 0.001));
}
}
@ -136,7 +134,6 @@
background-image: escape-svg($carousel-control-next-icon-bg);
}
// Optional indicator pips
//
// Add an ordered list with the following class and add a list item for each
@ -170,7 +167,7 @@
// Use transparent borders to increase the hit area by 10px on top and bottom.
border-top: $carousel-indicator-hit-area-height solid transparent;
border-bottom: $carousel-indicator-hit-area-height solid transparent;
opacity: .5;
opacity: 0.5;
@include transition($carousel-indicator-transition);
}
@ -179,7 +176,6 @@
}
}
// Optional captions
//
//

View file

@ -5,7 +5,7 @@
line-height: 1;
color: $close-color;
text-shadow: $close-text-shadow;
opacity: .5;
opacity: 0.5;
// Override <a>'s hover style
@include hover() {
@ -15,7 +15,7 @@
&:not(:disabled):not(.disabled) {
@include hover-focus() {
opacity: .75;
opacity: 0.75;
}
}
}

View file

@ -2,7 +2,6 @@
// Released under MIT and copyright 2014 Waybury.
// https://useiconic.com/open
// Checkboxes and radios
//
// Base class takes care of all the key behavioral aspects.
@ -87,7 +86,7 @@
width: $custom-control-indicator-size;
height: $custom-control-indicator-size;
pointer-events: none;
content: "";
content: '';
background-color: $custom-control-indicator-bg;
border: $custom-control-indicator-border-color solid $custom-control-indicator-border-width;
@include box-shadow($custom-control-indicator-box-shadow);
@ -101,12 +100,11 @@
display: block;
width: $custom-control-indicator-size;
height: $custom-control-indicator-size;
content: "";
content: '';
background: no-repeat 50% / #{$custom-control-indicator-bg-size};
}
}
// Checkboxes
//
// Tweak just a few things for checkboxes.
@ -166,7 +164,6 @@
}
}
// switches
//
// Tweak a few things for switches
@ -184,14 +181,17 @@
}
&::after {
top: add(($font-size-base * $line-height-base - $custom-control-indicator-size) / 2, $custom-control-indicator-border-width * 2);
top: add(
($font-size-base * $line-height-base - $custom-control-indicator-size) / 2,
$custom-control-indicator-border-width * 2
);
left: add(-($custom-switch-width + $custom-control-gutter), $custom-control-indicator-border-width * 2);
width: $custom-switch-indicator-size;
height: $custom-switch-indicator-size;
background-color: $custom-control-indicator-border-color;
// stylelint-disable-next-line property-blacklist
border-radius: $custom-switch-indicator-border-radius;
@include transition(transform .15s ease-in-out, $custom-forms-transition);
@include transition(transform 0.15s ease-in-out, $custom-forms-transition);
}
}
@ -209,7 +209,6 @@
}
}
// Select
//
// Replaces the browser default select with a custom one, mostly pulled from
@ -220,7 +219,8 @@
display: inline-block;
width: 100%;
height: $custom-select-height;
padding: $custom-select-padding-y ($custom-select-padding-x + $custom-select-indicator-padding) $custom-select-padding-y $custom-select-padding-x;
padding: $custom-select-padding-y ($custom-select-padding-x + $custom-select-indicator-padding)
$custom-select-padding-y $custom-select-padding-x;
font-family: $custom-select-font-family;
@include font-size($custom-select-font-size);
font-weight: $custom-select-font-weight;
@ -254,7 +254,7 @@
}
&[multiple],
&[size]:not([size="1"]) {
&[size]:not([size='1']) {
height: auto;
padding-right: $custom-select-padding-x;
background-image: none;
@ -293,7 +293,6 @@
@include font-size($custom-select-font-size-lg);
}
// File
//
// Custom file input.
@ -364,7 +363,7 @@
padding: $custom-file-padding-y $custom-file-padding-x;
line-height: $custom-file-line-height;
color: $custom-file-button-color;
content: "Browse";
content: 'Browse';
@include gradient-bg($custom-file-button-bg);
border-left: inherit;
@include border-radius(0 $custom-file-border-radius $custom-file-border-radius 0);
@ -389,9 +388,15 @@
// Pseudo-elements must be split across multiple rulesets to have an effect.
// No box-shadow() mixin for focus accessibility.
&::-webkit-slider-thumb { box-shadow: $custom-range-thumb-focus-box-shadow; }
&::-moz-range-thumb { box-shadow: $custom-range-thumb-focus-box-shadow; }
&::-ms-thumb { box-shadow: $custom-range-thumb-focus-box-shadow; }
&::-webkit-slider-thumb {
box-shadow: $custom-range-thumb-focus-box-shadow;
}
&::-moz-range-thumb {
box-shadow: $custom-range-thumb-focus-box-shadow;
}
&::-ms-thumb {
box-shadow: $custom-range-thumb-focus-box-shadow;
}
}
&::-moz-focus-outer {
@ -456,7 +461,7 @@
height: $custom-range-thumb-height;
margin-top: 0; // Edge specific
margin-right: $custom-range-thumb-focus-box-shadow-width; // Workaround that overflowed box-shadow is hidden.
margin-left: $custom-range-thumb-focus-box-shadow-width; // Workaround that overflowed box-shadow is hidden.
margin-left: $custom-range-thumb-focus-box-shadow-width; // Workaround that overflowed box-shadow is hidden.
@include gradient-bg($custom-range-thumb-bg);
border: $custom-range-thumb-border;
@include border-radius($custom-range-thumb-border-radius);

View file

@ -103,10 +103,10 @@
// When enabled Popper.js, reset basic dropdown position
// stylelint-disable-next-line no-duplicate-selectors
.dropdown-menu {
&[x-placement^="top"],
&[x-placement^="right"],
&[x-placement^="bottom"],
&[x-placement^="left"] {
&[x-placement^='top'],
&[x-placement^='right'],
&[x-placement^='bottom'],
&[x-placement^='left'] {
right: auto;
bottom: auto;
}

View file

@ -78,7 +78,6 @@ select.form-control {
width: 100%;
}
//
// Labels
//
@ -107,7 +106,6 @@ select.form-control {
line-height: $input-line-height-sm;
}
// Readonly controls as plain text
//
// Apply class to a readonly input to make it appear like regular plain
@ -132,7 +130,6 @@ select.form-control {
}
}
// Form control sizing
//
// Build on `.form-control` with modifier classes to decrease or increase the
@ -182,7 +179,6 @@ textarea.form-control {
margin-top: $form-text-margin-top;
}
// Form grid
//
// Special replacement for our grid system's `.row` for tighter form layouts.
@ -194,13 +190,12 @@ textarea.form-control {
margin-left: -$form-grid-gutter-width / 2;
> .col,
> [class*="col-"] {
> [class*='col-'] {
padding-right: $form-grid-gutter-width / 2;
padding-left: $form-grid-gutter-width / 2;
}
}
// Checkboxes and radios
//
// Indent the labels to position radios/checkboxes as hanging controls.
@ -242,7 +237,6 @@ textarea.form-control {
}
}
// Form validation
//
// Provide feedback to users when form field values are valid or invalid. Works

View file

@ -8,7 +8,7 @@
$prev-key: null;
$prev-num: null;
@each $key, $num in $map {
@if $prev-num == null or unit($num) == "%" or unit($prev-num) == "%" {
@if $prev-num == null or unit($num) == '%' or unit($prev-num) == '%' {
// Do nothing
} @else if not comparable($prev-num, $num) {
@warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
@ -22,7 +22,7 @@
// Starts at zero
// Used to ensure the min-width of the lowest breakpoint starts at 0.
@mixin _assert-starts-at-zero($map, $map-name: "$grid-breakpoints") {
@mixin _assert-starts-at-zero($map, $map-name: '$grid-breakpoints') {
$values: map-values($map);
$first-value: nth($values, 1);
@if $first-value != 0 {
@ -38,11 +38,12 @@
// @param {String} $search - Substring to replace
// @param {String} $replace ('') - New value
// @return {String} - Updated string
@function str-replace($string, $search, $replace: "") {
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
@return str-slice($string, 1, $index - 1) + $replace +
str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
}
@return $string;
@ -50,7 +51,7 @@
// See https://codepen.io/kevinweber/pen/dXWoRw
@function escape-svg($string) {
@if str-index($string, "data:image/svg+xml") {
@if str-index($string, 'data:image/svg+xml') {
@each $char, $encoded in $escaped-characters {
$string: str-replace($string, $char, $encoded);
}
@ -75,20 +76,20 @@
}
// Retrieve color Sass maps
@function color($key: "blue") {
@function color($key: 'blue') {
@return map-get($colors, $key);
}
@function theme-color($key: "primary") {
@function theme-color($key: 'primary') {
@return map-get($theme-colors, $key);
}
@function gray($key: "100") {
@function gray($key: '100') {
@return map-get($grays, $key);
}
// Request a theme color level
@function theme-color-level($color-name: "primary", $level: 0) {
@function theme-color-level($color-name: 'primary', $level: 0) {
$color: theme-color($color-name);
$color-base: if($level > 0, $black, $white);
$level: abs($level);
@ -110,7 +111,7 @@
@return $value1 + $value2;
}
@return if($return-calc == true, calc(#{$value1} + #{$value2}), $value1 + unquote(" + ") + $value2);
@return if($return-calc == true, calc(#{$value1} + #{$value2}), $value1 + unquote(' + ') + $value2);
}
@function subtract($value1, $value2, $return-calc: true) {
@ -130,5 +131,5 @@
@return $value1 - $value2;
}
@return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(" - ") + $value2);
@return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(' - ') + $value2);
}

View file

@ -36,7 +36,6 @@
}
}
// Row
//
// Rows contain your columns.
@ -53,7 +52,7 @@
margin-left: 0;
> .col,
> [class*="col-"] {
> [class*='col-'] {
padding-right: 0;
padding-left: 0;
}

View file

@ -9,7 +9,6 @@
@include img-fluid();
}
// Image thumbnails
.img-thumbnail {
padding: $thumbnail-padding;

View file

@ -41,8 +41,12 @@
> .form-control,
> .custom-select {
&:not(:last-child) { @include border-right-radius(0); }
&:not(:first-child) { @include border-left-radius(0); }
&:not(:last-child) {
@include border-right-radius(0);
}
&:not(:first-child) {
@include border-left-radius(0);
}
}
// Custom file inputs have more complex markup, thus requiring different
@ -52,12 +56,15 @@
align-items: center;
&:not(:last-child) .custom-file-label,
&:not(:last-child) .custom-file-label::after { @include border-right-radius(0); }
&:not(:first-child) .custom-file-label { @include border-left-radius(0); }
&:not(:last-child) .custom-file-label::after {
@include border-right-radius(0);
}
&:not(:first-child) .custom-file-label {
@include border-left-radius(0);
}
}
}
// Prepend and append
//
// While it requires one extra layer of HTML for each, dedicated prepend and
@ -88,9 +95,12 @@
}
}
.input-group-prepend { margin-right: -$input-border-width; }
.input-group-append { margin-left: -$input-border-width; }
.input-group-prepend {
margin-right: -$input-border-width;
}
.input-group-append {
margin-left: -$input-border-width;
}
// Textual addons
//
@ -113,13 +123,12 @@
@include border-radius($input-border-radius);
// Nuke default margins from checkboxes and radios to vertically center within.
input[type="radio"],
input[type="checkbox"] {
input[type='radio'],
input[type='checkbox'] {
margin-top: 0;
}
}
// Sizing
//
// Remix the default form control sizing classes into new ones for easier
@ -164,14 +173,12 @@
padding-right: $custom-select-padding-x + $custom-select-indicator-padding;
}
// Prepend and append rounded corners
//
// These rulesets must come after the sizing ones to properly override sm and lg
// border-radius values when extending. They're more specific than we'd like
// with the `.input-group >` part, but without it, we cannot override the sizing.
.input-group > .input-group-prepend > .btn,
.input-group > .input-group-prepend > .input-group-text,
.input-group > .input-group-append:not(:last-child) > .btn,

View file

@ -11,7 +11,6 @@
margin-bottom: 0;
}
// Interactive list items
//
// Use anchor or button elements instead of `li`s or `div`s to create interactive
@ -36,7 +35,6 @@
}
}
// Individual list items
//
// Use on `li`s or `div`s within the `.list-group` parent.
@ -82,7 +80,6 @@
}
}
// Horizontal
//
// Change the layout of list group items from vertical (default) to horizontal.
@ -123,7 +120,6 @@
}
}
// Flush list items
//
// Remove borders and border-radius to keep list group items edge-to-edge. Most
@ -147,7 +143,6 @@
}
}
// Contextual variants
//
// Add modifier classes to change text and background color on individual items.

View file

@ -3,45 +3,45 @@
// Used in conjunction with global variables to enable certain theme features.
// Vendor
@import "_vendor/rfs";
@import '_vendor/rfs';
// Deprecate
@import "mixins/deprecate";
@import 'mixins/deprecate';
// Utilities
@import "mixins/breakpoints";
@import "mixins/hover";
@import "mixins/image";
@import "mixins/badge";
@import "mixins/resize";
@import "mixins/screen-reader";
@import "mixins/size";
@import "mixins/reset-text";
@import "mixins/text-emphasis";
@import "mixins/text-hide";
@import "mixins/text-truncate";
@import "mixins/visibility";
@import 'mixins/breakpoints';
@import 'mixins/hover';
@import 'mixins/image';
@import 'mixins/badge';
@import 'mixins/resize';
@import 'mixins/screen-reader';
@import 'mixins/size';
@import 'mixins/reset-text';
@import 'mixins/text-emphasis';
@import 'mixins/text-hide';
@import 'mixins/text-truncate';
@import 'mixins/visibility';
// Components
@import "mixins/alert";
@import "mixins/buttons";
@import "mixins/caret";
@import "mixins/pagination";
@import "mixins/lists";
@import "mixins/list-group";
@import "mixins/nav-divider";
@import "mixins/forms";
@import "mixins/table-row";
@import 'mixins/alert';
@import 'mixins/buttons';
@import 'mixins/caret';
@import 'mixins/pagination';
@import 'mixins/lists';
@import 'mixins/list-group';
@import 'mixins/nav-divider';
@import 'mixins/forms';
@import 'mixins/table-row';
// Skins
@import "mixins/background-variant";
@import "mixins/border-radius";
@import "mixins/box-shadow";
@import "mixins/gradients";
@import "mixins/transition";
@import 'mixins/background-variant';
@import 'mixins/border-radius';
@import 'mixins/box-shadow';
@import 'mixins/gradients';
@import 'mixins/transition';
// Layout
@import "mixins/clearfix";
@import "mixins/grid-framework";
@import "mixins/grid";
@import "mixins/float";
@import 'mixins/clearfix';
@import 'mixins/grid-framework';
@import 'mixins/grid';
@import 'mixins/float';

View file

@ -3,7 +3,6 @@
// .modal-dialog - positioning shell for the actual modal
// .modal-content - actual modal w/ bg and corners and stuff
.modal-open {
// Kill the scroll on the body
overflow: hidden;
@ -83,7 +82,7 @@
&::before {
display: block; // IE10
height: subtract(100vh, $modal-dialog-margin * 2);
content: "";
content: '';
}
// Ensure `.modal-body` shows scrollbar (IE10/11)
@ -131,8 +130,12 @@
background-color: $modal-backdrop-bg;
// Fade for backdrop
&.fade { opacity: 0; }
&.show { opacity: $modal-backdrop-opacity; }
&.fade {
opacity: 0;
}
&.show {
opacity: $modal-backdrop-opacity;
}
}
// Modal header
@ -224,7 +227,9 @@
@include box-shadow($modal-content-box-shadow-sm-up);
}
.modal-sm { max-width: $modal-sm; }
.modal-sm {
max-width: $modal-sm;
}
}
@include media-breakpoint-up(lg) {
@ -235,5 +240,7 @@
}
@include media-breakpoint-up(xl) {
.modal-xl { max-width: $modal-xl; }
.modal-xl {
max-width: $modal-xl;
}
}

View file

@ -68,7 +68,6 @@
}
}
//
// Pills
//
@ -85,7 +84,6 @@
}
}
//
// Justified variants
//
@ -105,7 +103,6 @@
}
}
// Tabbable tabs
//
// Hide tabbable panes to start, show them when `.active`

View file

@ -9,7 +9,6 @@
// Navbar position
// Navbar themes
// Navbar
//
// Provide a static navbar from which we expand to create full-width, fixed, and
@ -44,7 +43,6 @@
}
}
// Navbar brand
//
// Used for brand, project, or site names.
@ -63,7 +61,6 @@
}
}
// Navbar nav
//
// Custom navbar navigation (doesn't require `.nav`, but does make use of `.nav-link`).
@ -86,7 +83,6 @@
}
}
// Navbar text
//
//
@ -97,7 +93,6 @@
padding-bottom: $nav-link-padding-y;
}
// Responsive navbar
//
// Custom styles for responsive collapsing and toggling of navbar contents.
@ -135,7 +130,7 @@
width: 1.5em;
height: 1.5em;
vertical-align: middle;
content: "";
content: '';
background: no-repeat center center;
background-size: 100% 100%;
}
@ -214,7 +209,6 @@
}
}
// Navbar themes
//
// Styles for switching between navbars with light or dark background.

View file

@ -59,15 +59,26 @@
}
}
//
// Sizing
//
.pagination-lg {
@include pagination-size($pagination-padding-y-lg, $pagination-padding-x-lg, $font-size-lg, $line-height-lg, $border-radius-lg);
@include pagination-size(
$pagination-padding-y-lg,
$pagination-padding-x-lg,
$font-size-lg,
$line-height-lg,
$border-radius-lg
);
}
.pagination-sm {
@include pagination-size($pagination-padding-y-sm, $pagination-padding-x-sm, $font-size-sm, $line-height-sm, $border-radius-sm);
@include pagination-size(
$pagination-padding-y-sm,
$pagination-padding-x-sm,
$font-size-sm,
$line-height-sm,
$border-radius-sm
);
}

View file

@ -28,7 +28,7 @@
&::after {
position: absolute;
display: block;
content: "";
content: '';
border-color: transparent;
border-style: solid;
}
@ -105,7 +105,7 @@
display: block;
width: $popover-arrow-width;
margin-left: -$popover-arrow-width / 2;
content: "";
content: '';
border-bottom: $popover-border-width solid $popover-header-bg;
}
}
@ -134,21 +134,20 @@
}
.bs-popover-auto {
&[x-placement^="top"] {
&[x-placement^='top'] {
@extend .bs-popover-top;
}
&[x-placement^="right"] {
&[x-placement^='right'] {
@extend .bs-popover-right;
}
&[x-placement^="bottom"] {
&[x-placement^='bottom'] {
@extend .bs-popover-bottom;
}
&[x-placement^="left"] {
&[x-placement^='left'] {
@extend .bs-popover-left;
}
}
// Offset the popover to account for the popover arrow
.popover-header {
padding: $popover-header-padding-y $popover-header-padding-x;

View file

@ -32,7 +32,7 @@
//}
abbr[title]::after {
content: " (" attr(title) ")";
content: ' (' attr(title) ')';
}
// Bootstrap specific; comment the following selector out

View file

@ -1,8 +1,12 @@
// Disable animation if transitions are disabled
@if $enable-transitions {
@keyframes progress-bar-stripes {
from { background-position: $progress-height 0; }
to { background-position: 0 0; }
from {
background-position: $progress-height 0;
}
to {
background-position: 0 0;
}
}
}

View file

@ -7,7 +7,6 @@
//
// Normalize is licensed MIT. https://github.com/necolas/normalize.css
// Document
//
// 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
@ -32,7 +31,16 @@ html {
// Shim for "new" HTML5 structural elements to display correctly (IE10, older browsers)
// TODO: remove in v5
// stylelint-disable-next-line selector-list-comma-newline-after
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
article,
aside,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section {
display: block;
}
@ -63,11 +71,10 @@ body {
//
// See https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible
// and https://developer.paciellogroup.com/blog/2018/03/focus-visible-and-backwards-compatibility/
[tabindex="-1"]:focus:not(:focus-visible) {
[tabindex='-1']:focus:not(:focus-visible) {
outline: 0 !important;
}
// Content grouping
//
// 1. Add the correct box sizing in Firefox.
@ -79,7 +86,6 @@ hr {
overflow: visible; // 2
}
//
// Typography
//
@ -89,7 +95,12 @@ hr {
// By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
// margin for easier control within type scales as it avoids margin collapsing.
// stylelint-disable-next-line selector-list-comma-newline-after
h1, h2, h3, h4, h5, h6 {
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 0;
margin-bottom: $headings-margin-bottom;
}
@ -112,7 +123,8 @@ p {
// 5. Prevent the text-decoration to be skipped.
abbr[title],
abbr[data-original-title] { // 1
abbr[data-original-title] {
// 1
text-decoration: underline; // 2
text-decoration: underline dotted; // 2
cursor: help; // 3
@ -145,7 +157,7 @@ dt {
}
dd {
margin-bottom: .5rem;
margin-bottom: 0.5rem;
margin-left: 0; // Undo browser default
}
@ -175,9 +187,12 @@ sup {
vertical-align: baseline;
}
sub { bottom: -.25em; }
sup { top: -.5em; }
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
//
// Links
@ -209,7 +224,6 @@ a:not([href]) {
}
}
//
// Code
//
@ -231,7 +245,6 @@ pre {
overflow: auto;
}
//
// Figures
//
@ -241,7 +254,6 @@ figure {
margin: 0 0 1rem;
}
//
// Images and content
//
@ -258,7 +270,6 @@ svg {
vertical-align: middle;
}
//
// Tables
//
@ -281,7 +292,6 @@ th {
text-align: inherit;
}
//
// Forms
//
@ -337,7 +347,6 @@ select {
word-wrap: normal;
}
// 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
// controls in Android 4.
// 2. Correct the inability to style clickable types in iOS and Safari.
@ -351,9 +360,9 @@ button,
// Opinionated: add "hand" cursor to non-disabled button elements.
@if $enable-pointer-cursor-for-buttons {
button,
[type="button"],
[type="reset"],
[type="submit"] {
[type='button'],
[type='reset'],
[type='submit'] {
&:not(:disabled) {
cursor: pointer;
}
@ -362,24 +371,23 @@ button,
// Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
[type='button']::-moz-focus-inner,
[type='reset']::-moz-focus-inner,
[type='submit']::-moz-focus-inner {
padding: 0;
border-style: none;
}
input[type="radio"],
input[type="checkbox"] {
input[type='radio'],
input[type='checkbox'] {
box-sizing: border-box; // 1. Add the correct box sizing in IE 10-
padding: 0; // 2. Remove the padding in IE 10-
}
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
input[type='date'],
input[type='time'],
input[type='datetime-local'],
input[type='month'] {
// Remove the default appearance of temporal inputs to avoid a Mobile Safari
// bug where setting a custom line-height prevents text from being vertically
// centered within the input.
@ -414,7 +422,7 @@ legend {
width: 100%;
max-width: 100%; // 1
padding: 0;
margin-bottom: .5rem;
margin-bottom: 0.5rem;
@include font-size(1.5rem);
line-height: inherit;
color: inherit; // 2
@ -426,12 +434,12 @@ progress {
}
// Correct the cursor style of increment and decrement buttons in Chrome.
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
[type='number']::-webkit-inner-spin-button,
[type='number']::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
[type='search'] {
// This overrides the extra rounded corners on search inputs in iOS so that our
// `.form-control` class can properly style them. Note that this cannot simply
// be added to `.form-control` as it's not specific enough. For details, see
@ -444,7 +452,7 @@ progress {
// Remove the inner padding in Chrome and Safari on macOS.
//
[type="search"]::-webkit-search-decoration {
[type='search']::-webkit-search-decoration {
-webkit-appearance: none;
}

View file

@ -3,7 +3,9 @@
//
@keyframes spinner-border {
to { transform: rotate(360deg); }
to {
transform: rotate(360deg);
}
}
.spinner-border {
@ -15,7 +17,7 @@
border-right-color: transparent;
// stylelint-disable-next-line property-blacklist
border-radius: 50%;
animation: spinner-border .75s linear infinite;
animation: spinner-border 0.75s linear infinite;
}
.spinner-border-sm {
@ -46,7 +48,7 @@
// stylelint-disable-next-line property-blacklist
border-radius: 50%;
opacity: 0;
animation: spinner-grow .75s linear infinite;
animation: spinner-grow 0.75s linear infinite;
}
.spinner-grow-sm {

View file

@ -25,7 +25,6 @@
}
}
//
// Condensed table w/ half padding
//
@ -37,7 +36,6 @@
}
}
// Border versions
//
// Add or remove borders all around the table and between all the columns.
@ -77,7 +75,6 @@
}
}
// Hover effect
//
// Placed here since it has to come after the potential zebra striping
@ -91,19 +88,21 @@
}
}
// Table backgrounds
//
// Exact selectors below required to override `.table-striped` and prevent
// inheritance to nested tables.
@each $color, $value in $theme-colors {
@include table-row-variant($color, theme-color-level($color, $table-bg-level), theme-color-level($color, $table-border-level));
@include table-row-variant(
$color,
theme-color-level($color, $table-bg-level),
theme-color-level($color, $table-border-level)
);
}
@include table-row-variant(active, $table-active-bg);
// Dark styles
//
// Same table markup, but inverted color scheme: dark background and light text.
@ -157,7 +156,6 @@
}
}
// Responsive tables
//
// Generate series of `.table-responsive-*` classes for configuring the screen

View file

@ -12,7 +12,9 @@
word-wrap: break-word;
opacity: 0;
&.show { opacity: $tooltip-opacity; }
&.show {
opacity: $tooltip-opacity;
}
.arrow {
position: absolute;
@ -22,7 +24,7 @@
&::before {
position: absolute;
content: "";
content: '';
border-color: transparent;
border-style: solid;
}
@ -90,16 +92,16 @@
}
.bs-tooltip-auto {
&[x-placement^="top"] {
&[x-placement^='top'] {
@extend .bs-tooltip-top;
}
&[x-placement^="right"] {
&[x-placement^='right'] {
@extend .bs-tooltip-right;
}
&[x-placement^="bottom"] {
&[x-placement^='bottom'] {
@extend .bs-tooltip-bottom;
}
&[x-placement^="left"] {
&[x-placement^='left'] {
@extend .bs-tooltip-left;
}
}

View file

@ -4,8 +4,18 @@
// Headings
//
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
margin-bottom: $headings-margin-bottom;
font-family: $headings-font-family;
font-weight: $headings-font-weight;
@ -13,12 +23,30 @@ h1, h2, h3, h4, h5, h6,
color: $headings-color;
}
h1, .h1 { @include font-size($h1-font-size); }
h2, .h2 { @include font-size($h2-font-size); }
h3, .h3 { @include font-size($h3-font-size); }
h4, .h4 { @include font-size($h4-font-size); }
h5, .h5 { @include font-size($h5-font-size); }
h6, .h6 { @include font-size($h6-font-size); }
h1,
.h1 {
@include font-size($h1-font-size);
}
h2,
.h2 {
@include font-size($h2-font-size);
}
h3,
.h3 {
@include font-size($h3-font-size);
}
h4,
.h4 {
@include font-size($h4-font-size);
}
h5,
.h5 {
@include font-size($h5-font-size);
}
h6,
.h6 {
@include font-size($h6-font-size);
}
.lead {
@include font-size($lead-font-size);
@ -47,7 +75,6 @@ h6, .h6 { @include font-size($h6-font-size); }
line-height: $display-line-height;
}
//
// Horizontal rules
//
@ -59,7 +86,6 @@ hr {
border-top: $hr-border-width solid $hr-border-color;
}
//
// Emphasis
//
@ -76,7 +102,6 @@ mark,
background-color: $mark-bg;
}
//
// Lists
//
@ -97,7 +122,6 @@ mark,
}
}
//
// Misc
//
@ -120,6 +144,6 @@ mark,
color: $blockquote-small-color;
&::before {
content: "\2014\00A0"; // em dash, nbsp
content: '\2014\00A0'; // em dash, nbsp
}
}

View file

@ -1,17 +1,17 @@
@import "utilities/align";
@import "utilities/background";
@import "utilities/borders";
@import "utilities/clearfix";
@import "utilities/display";
@import "utilities/embed";
@import "utilities/flex";
@import "utilities/float";
@import "utilities/overflow";
@import "utilities/position";
@import "utilities/screenreaders";
@import "utilities/shadows";
@import "utilities/sizing";
@import "utilities/stretched-link";
@import "utilities/spacing";
@import "utilities/text";
@import "utilities/visibility";
@import 'utilities/align';
@import 'utilities/background';
@import 'utilities/borders';
@import 'utilities/clearfix';
@import 'utilities/display';
@import 'utilities/embed';
@import 'utilities/flex';
@import 'utilities/float';
@import 'utilities/overflow';
@import 'utilities/position';
@import 'utilities/screenreaders';
@import 'utilities/shadows';
@import 'utilities/sizing';
@import 'utilities/stretched-link';
@import 'utilities/spacing';
@import 'utilities/text';
@import 'utilities/visibility';

File diff suppressed because it is too large Load diff

View file

@ -22,7 +22,7 @@ $rfs-two-dimensional: false !default;
// Factor of decrease
$rfs-factor: 10 !default;
@if type-of($rfs-factor) != "number" or $rfs-factor <= 1 {
@if type-of($rfs-factor) != 'number' or $rfs-factor <= 1 {
@error "`#{$rfs-factor}` is not a valid $rfs-factor, it must be greater than 1.";
}
@ -42,10 +42,9 @@ $enable-responsive-font-sizes: true !default;
$rfs-base-font-size-unit: unit($rfs-base-font-size);
// Remove px-unit from $rfs-base-font-size for calculations
@if $rfs-base-font-size-unit == "px" {
@if $rfs-base-font-size-unit == 'px' {
$rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1);
}
@else if $rfs-base-font-size-unit == "rem" {
} @else if $rfs-base-font-size-unit == 'rem' {
$rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1 / $rfs-rem-value);
}
@ -53,46 +52,41 @@ $rfs-base-font-size-unit: unit($rfs-base-font-size);
$rfs-breakpoint-unit-cache: unit($rfs-breakpoint);
// Remove unit from $rfs-breakpoint for calculations
@if $rfs-breakpoint-unit-cache == "px" {
@if $rfs-breakpoint-unit-cache == 'px' {
$rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1);
}
@else if $rfs-breakpoint-unit-cache == "rem" or $rfs-breakpoint-unit-cache == "em" {
} @else if $rfs-breakpoint-unit-cache == 'rem' or $rfs-breakpoint-unit-cache == 'em' {
$rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1 / $rfs-rem-value);
}
// Responsive font-size mixin
@mixin rfs($fs, $important: false) {
// Cache $fs unit
$fs-unit: if(type-of($fs) == "number", unit($fs), false);
$fs-unit: if(type-of($fs) == 'number', unit($fs), false);
// Add !important suffix if needed
$rfs-suffix: if($important, " !important", "");
$rfs-suffix: if($important, ' !important', '');
// If $fs isn't a number (like inherit) or $fs has a unit (not px or rem, like 1.5em) or $ is 0, just print the value
@if not $fs-unit or $fs-unit != "" and $fs-unit != "px" and $fs-unit != "rem" or $fs == 0 {
@if not $fs-unit or $fs-unit != '' and $fs-unit != 'px' and $fs-unit != 'rem' or $fs == 0 {
font-size: #{$fs}#{$rfs-suffix};
}
@else {
} @else {
// Variables for storing static and fluid rescaling
$rfs-static: null;
$rfs-fluid: null;
// Remove px-unit from $fs for calculations
@if $fs-unit == "px" {
@if $fs-unit == 'px' {
$fs: $fs / ($fs * 0 + 1);
}
@else if $fs-unit == "rem" {
} @else if $fs-unit == 'rem' {
$fs: $fs / ($fs * 0 + 1 / $rfs-rem-value);
}
// Set default font-size
@if $rfs-font-size-unit == rem {
$rfs-static: #{$fs / $rfs-rem-value}rem#{$rfs-suffix};
}
@else if $rfs-font-size-unit == px {
} @else if $rfs-font-size-unit == px {
$rfs-static: #{$fs}px#{$rfs-suffix};
}
@else {
} @else {
@error "`#{$rfs-font-size-unit}` is not a valid unit for $rfs-font-size-unit. Use `px` or `rem`.";
}
@ -126,22 +120,19 @@ $rfs-breakpoint-unit-cache: unit($rfs-breakpoint);
@if $rfs-fluid == null {
// Only render static font-size if no fluid font-size is available
font-size: $rfs-static;
}
@else {
} @else {
$mq-value: null;
// RFS breakpoint formatting
@if $rfs-breakpoint-unit == em or $rfs-breakpoint-unit == rem {
$mq-value: #{$rfs-breakpoint / $rfs-rem-value}#{$rfs-breakpoint-unit};
}
@else if $rfs-breakpoint-unit == px {
} @else if $rfs-breakpoint-unit == px {
$mq-value: #{$rfs-breakpoint}px;
}
@else {
} @else {
@error "`#{$rfs-breakpoint-unit}` is not a valid unit for $rfs-breakpoint-unit. Use `px`, `em` or `rem`.";
}
@if $rfs-class == "disable" {
@if $rfs-class == 'disable' {
// Adding an extra class increases specificity,
// which prevents the media query to override the font size
&,
@ -149,20 +140,18 @@ $rfs-breakpoint-unit-cache: unit($rfs-breakpoint);
&.disable-responsive-font-size {
font-size: $rfs-static;
}
}
@else {
} @else {
font-size: $rfs-static;
}
@if $rfs-two-dimensional {
@media (max-width: #{$mq-value}), (max-height: #{$mq-value}) {
@if $rfs-class == "enable" {
@if $rfs-class == 'enable' {
.enable-responsive-font-size &,
&.enable-responsive-font-size {
font-size: $rfs-fluid;
}
}
@else {
} @else {
font-size: $rfs-fluid;
}
@ -171,16 +160,14 @@ $rfs-breakpoint-unit-cache: unit($rfs-breakpoint);
min-width: 0vw;
}
}
}
@else {
} @else {
@media (max-width: #{$mq-value}) {
@if $rfs-class == "enable" {
@if $rfs-class == 'enable' {
.enable-responsive-font-size &,
&.enable-responsive-font-size {
font-size: $rfs-fluid;
}
}
@else {
} @else {
font-size: $rfs-fluid;
}

View file

@ -16,14 +16,14 @@ html {
box-sizing: inherit;
}
@import "functions";
@import "variables";
@import 'functions';
@import 'variables';
@import "mixins/breakpoints";
@import "mixins/grid-framework";
@import "mixins/grid";
@import 'mixins/breakpoints';
@import 'mixins/grid-framework';
@import 'mixins/grid';
@import "grid";
@import "utilities/display";
@import "utilities/flex";
@import "utilities/spacing";
@import 'grid';
@import 'utilities/display';
@import 'utilities/flex';
@import 'utilities/spacing';

View file

@ -6,7 +6,7 @@
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
@import "functions";
@import "variables";
@import "mixins";
@import "reboot";
@import 'functions';
@import 'variables';
@import 'mixins';
@import 'reboot';

View file

@ -5,40 +5,40 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
@import "functions";
@import "variables";
@import "mixins";
@import "root";
@import "reboot";
@import "type";
@import "images";
@import "code";
@import "grid";
@import "tables";
@import "forms";
@import "buttons";
@import "transitions";
@import "dropdown";
@import "button-group";
@import "input-group";
@import "custom-forms";
@import "nav";
@import "navbar";
@import "card";
@import "breadcrumb";
@import "pagination";
@import "badge";
@import "jumbotron";
@import "alert";
@import "progress";
@import "media";
@import "list-group";
@import "close";
@import "toasts";
@import "modal";
@import "tooltip";
@import "popover";
@import "carousel";
@import "spinners";
@import "utilities";
@import "print";
@import 'functions';
@import 'variables';
@import 'mixins';
@import 'root';
@import 'reboot';
@import 'type';
@import 'images';
@import 'code';
@import 'grid';
@import 'tables';
@import 'forms';
@import 'buttons';
@import 'transitions';
@import 'dropdown';
@import 'button-group';
@import 'input-group';
@import 'custom-forms';
@import 'nav';
@import 'navbar';
@import 'card';
@import 'breadcrumb';
@import 'pagination';
@import 'badge';
@import 'jumbotron';
@import 'alert';
@import 'progress';
@import 'media';
@import 'list-group';
@import 'close';
@import 'toasts';
@import 'modal';
@import 'tooltip';
@import 'popover';
@import 'carousel';
@import 'spinners';
@import 'utilities';
@import 'print';

View file

@ -12,7 +12,7 @@
background-color: darken($color, 10%) !important;
}
}
@include deprecate("The `bg-variant` mixin", "v4.4.0", "v5", $ignore-warning);
@include deprecate('The `bg-variant` mixin', 'v4.4.0', 'v5', $ignore-warning);
}
@mixin bg-gradient-variant($parent, $color) {

View file

@ -11,7 +11,7 @@
&:focus,
&.focus {
outline: 0;
box-shadow: 0 0 0 $badge-focus-width rgba($bg, .5);
box-shadow: 0 0 0 $badge-focus-width rgba($bg, 0.5);
}
}
}

View file

@ -4,8 +4,7 @@
@mixin border-radius($radius: $border-radius, $fallback-border-radius: false) {
@if $enable-rounded {
border-radius: $radius;
}
@else if $fallback-border-radius != false {
} @else if $fallback-border-radius != false {
border-radius: $fallback-border-radius;
}
}

View file

@ -8,8 +8,8 @@
} @else {
// Filter to avoid invalid properties for example `box-shadow: none, 1px 1px black;`
@for $i from 1 through length($shadow) {
@if nth($shadow, $i) != "none" {
$result: append($result, nth($shadow, $i), "comma");
@if nth($shadow, $i) != 'none' {
$result: append($result, nth($shadow, $i), 'comma');
}
}
}

View file

@ -39,7 +39,7 @@
// 767.98px
@function breakpoint-max($name, $breakpoints: $grid-breakpoints) {
$next: breakpoint-next($name, $breakpoints);
@return if($next, breakpoint-min($next, $breakpoints) - .02, null);
@return if($next, breakpoint-min($next, $breakpoints) - 0.02, null);
}
// Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.
@ -50,7 +50,7 @@
// >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
// "-sm"
@function breakpoint-infix($name, $breakpoints: $grid-breakpoints) {
@return if(breakpoint-min($name, $breakpoints) == null, "", "-#{$name}");
@return if(breakpoint-min($name, $breakpoints) == null, '', '-#{$name}');
}
// Media of at least the minimum breakpoint width. No query for the smallest breakpoint.

View file

@ -3,7 +3,14 @@
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons
@mixin button-variant($background, $border, $hover-background: darken($background, 7.5%), $hover-border: darken($border, 10%), $active-background: darken($background, 10%), $active-border: darken($border, 12.5%)) {
@mixin button-variant(
$background,
$border,
$hover-background: darken($background, 7.5%),
$hover-border: darken($border, 10%),
$active-background: darken($background, 10%),
$active-border: darken($border, 12.5%)
) {
color: color-yiq($background);
@include gradient-bg($background);
border-color: $border;
@ -22,9 +29,9 @@
border-color: $hover-border;
// Avoid using mixin so we can pass custom focus shadow properly
@if $enable-shadows {
box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), 0.5);
} @else {
box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), 0.5);
}
}
@ -53,15 +60,20 @@
&:focus {
// Avoid using mixin so we can pass custom focus shadow properly
@if $enable-shadows and $btn-active-box-shadow != none {
box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), 0.5);
} @else {
box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), .5);
box-shadow: 0 0 0 $btn-focus-width rgba(mix(color-yiq($background), $border, 15%), 0.5);
}
}
}
}
@mixin button-outline-variant($color, $color-hover: color-yiq($color), $active-background: $color, $active-border: $color) {
@mixin button-outline-variant(
$color,
$color-hover: color-yiq($color),
$active-background: $color,
$active-border: $color
) {
color: $color;
border-color: $color;
@ -73,7 +85,7 @@
&:focus,
&.focus {
box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
box-shadow: 0 0 0 $btn-focus-width rgba($color, 0.5);
}
&.disabled,
@ -92,9 +104,9 @@
&:focus {
// Avoid using mixin so we can pass custom focus shadow properly
@if $enable-shadows and $btn-active-box-shadow != none {
box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5);
box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, 0.5);
} @else {
box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
box-shadow: 0 0 0 $btn-focus-width rgba($color, 0.5);
}
}
}

View file

@ -31,7 +31,7 @@
display: inline-block;
margin-left: $caret-spacing;
vertical-align: $caret-vertical-align;
content: "";
content: '';
@if $direction == down {
@include caret-down();
} @else if $direction == up {
@ -50,7 +50,7 @@
display: inline-block;
margin-right: $caret-spacing;
vertical-align: $caret-vertical-align;
content: "";
content: '';
@include caret-left();
}
}

View file

@ -2,6 +2,6 @@
&::after {
display: block;
clear: both;
content: "";
content: '';
}
}

View file

@ -2,13 +2,13 @@
@mixin float-left() {
float: left !important;
@include deprecate("The `float-left` mixin", "v4.3.0", "v5");
@include deprecate('The `float-left` mixin', 'v4.3.0', 'v5');
}
@mixin float-right() {
float: right !important;
@include deprecate("The `float-right` mixin", "v4.3.0", "v5");
@include deprecate('The `float-right` mixin', 'v4.3.0', 'v5');
}
@mixin float-none() {
float: none !important;
@include deprecate("The `float-none` mixin", "v4.3.0", "v5");
@include deprecate('The `float-none` mixin', 'v4.3.0', 'v5');
}

View file

@ -23,13 +23,13 @@
box-shadow: $input-focus-box-shadow;
}
}
@include deprecate("The `form-control-focus()` mixin", "v4.4.0", "v5", $ignore-warning);
@include deprecate('The `form-control-focus()` mixin', 'v4.4.0', 'v5', $ignore-warning);
}
// This mixin uses an `if()` technique to be compatible with Dart Sass
// See https://github.com/sass/sass/issues/1873#issuecomment-152293725 for more details
@mixin form-validation-state-selector($state) {
@if ($state == "valid" or $state == "invalid") {
@if ($state == 'valid' or $state == 'invalid') {
.was-validated #{if(&, "&", "")}:#{$state},
#{if(&, "&", "")}.is-#{$state} {
@content;
@ -57,7 +57,7 @@
display: none;
max-width: 100%; // Contain to parent when possible
padding: $form-feedback-tooltip-padding-y $form-feedback-tooltip-padding-x;
margin-top: .1rem;
margin-top: 0.1rem;
@include font-size($form-feedback-tooltip-font-size);
line-height: $form-feedback-tooltip-line-height;
color: color-yiq($color);
@ -86,7 +86,7 @@
&:focus {
border-color: $color;
box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
box-shadow: 0 0 0 $input-focus-width rgba($color, 0.25);
}
}
}
@ -107,12 +107,17 @@
@if $enable-validation-icons {
padding-right: $custom-select-feedback-icon-padding-right;
background: $custom-select-background, escape-svg($icon) $custom-select-bg no-repeat $custom-select-feedback-icon-position / $custom-select-feedback-icon-size;
background: $custom-select-background,
escape-svg($icon)
$custom-select-bg
no-repeat
$custom-select-feedback-icon-position /
$custom-select-feedback-icon-size;
}
&:focus {
border-color: $color;
box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
box-shadow: 0 0 0 $input-focus-width rgba($color, 0.25);
}
}
}
@ -149,7 +154,7 @@
&:focus {
~ .custom-control-label::before {
box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
box-shadow: 0 0 0 $input-focus-width rgba($color, 0.25);
}
&:not(:checked) ~ .custom-control-label::before {
@ -169,7 +174,7 @@
&:focus {
~ .custom-file-label {
border-color: $color;
box-shadow: 0 0 0 $input-focus-width rgba($color, .25);
box-shadow: 0 0 0 $input-focus-width rgba($color, 0.25);
}
}
}

View file

@ -40,6 +40,15 @@
background-image: radial-gradient(circle, $inner-color, $outer-color);
background-repeat: no-repeat;
}
@mixin gradient-striped($color: rgba($white, .15), $angle: 45deg) {
background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
@mixin gradient-striped($color: rgba($white, 0.15), $angle: 45deg) {
background-image: linear-gradient(
$angle,
$color 25%,
transparent 25%,
transparent 50%,
$color 50%,
$color 75%,
transparent 75%,
transparent
);
}

View file

@ -50,17 +50,24 @@
}
}
.order#{$infix}-first { order: -1; }
.order#{$infix}-first {
order: -1;
}
.order#{$infix}-last { order: $columns + 1; }
.order#{$infix}-last {
order: $columns + 1;
}
@for $i from 0 through $columns {
.order#{$infix}-#{$i} { order: $i; }
.order#{$infix}-#{$i} {
order: $i;
}
}
// `$columns - 1` because offsetting by the width of an entire row isn't possible
@for $i from 0 through ($columns - 1) {
@if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0
@if not($infix == '' and $i == 0) {
// Avoid emitting useless .offset-0
.offset#{$infix}-#{$i} {
@include make-col-offset($i, $columns);
}

View file

@ -10,7 +10,6 @@
margin-left: auto;
}
// For each breakpoint, define the maximum width of the container in a media query
@mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) {
@each $breakpoint, $container-max-width in $max-widths {

View file

@ -10,7 +10,9 @@
// Issue: https://github.com/twbs/bootstrap/issues/25195
@mixin hover() {
&:hover { @content; }
&:hover {
@content;
}
}
@mixin hover-focus() {

View file

@ -2,7 +2,6 @@
// - Responsive image
// - Retina image
// Responsive image
//
// Keep images from scaling beyond the width of their parents.
@ -15,7 +14,6 @@
height: auto;
}
// Retina image
//
// Short retina mixin for setting background-image and -size.
@ -27,10 +25,11 @@
// but doesn't convert dppx=>dpi.
// There's no such thing as unprefixed min-device-pixel-ratio since it's nonstandard.
// Compatibility info: https://caniuse.com/#feat=css-media-resolution
@media only screen and (min-resolution: 192dpi), // IE9-11 don't support dppx
only screen and (min-resolution: 2dppx) { // Standardized
@media only screen and (min-resolution: 192dpi),
// IE9-11 don't support dppx only screen and (min-resolution: 2dppx) {
// Standardized
background-image: url($file-2x);
background-size: $width-1x $height-1x;
}
@include deprecate("`img-retina()`", "v4.3.0", "v5");
@include deprecate('`img-retina()`', 'v4.3.0', 'v5');
}

View file

@ -7,5 +7,5 @@
margin: $margin-y 0;
overflow: hidden;
border-top: 1px solid $color;
@include deprecate("The `nav-divider()` mixin", "v4.4.0", "v5", $ignore-warning);
@include deprecate('The `nav-divider()` mixin', 'v4.4.0', 'v5', $ignore-warning);
}

View file

@ -3,5 +3,5 @@
@mixin size($width, $height: $width) {
width: $width;
height: $height;
@include deprecate("`size()`", "v4.3.0", "v5");
@include deprecate('`size()`', 'v4.3.0', 'v5');
}

View file

@ -13,5 +13,5 @@
}
}
}
@include deprecate("`text-emphasis-variant()`", "v4.4.0", "v5", $ignore-warning);
@include deprecate('`text-emphasis-variant()`', 'v4.4.0', 'v5', $ignore-warning);
}

View file

@ -7,5 +7,5 @@
background-color: transparent;
border: 0;
@include deprecate("`text-hide()`", "v4.1.0", "v5", $ignore-warning);
@include deprecate('`text-hide()`', 'v4.1.0', 'v5', $ignore-warning);
}

View file

@ -4,5 +4,5 @@
@mixin invisible($visibility) {
visibility: $visibility !important;
@include deprecate("`invisible()`", "v4.3.0", "v5");
@include deprecate('`invisible()`', 'v4.3.0', 'v5');
}

View file

@ -1,8 +1,20 @@
// stylelint-disable declaration-no-important
.align-baseline { vertical-align: baseline !important; } // Browser default
.align-top { vertical-align: top !important; }
.align-middle { vertical-align: middle !important; }
.align-bottom { vertical-align: bottom !important; }
.align-text-bottom { vertical-align: text-bottom !important; }
.align-text-top { vertical-align: text-top !important; }
.align-baseline {
vertical-align: baseline !important;
} // Browser default
.align-top {
vertical-align: top !important;
}
.align-middle {
vertical-align: middle !important;
}
.align-bottom {
vertical-align: bottom !important;
}
.align-text-bottom {
vertical-align: text-bottom !important;
}
.align-text-top {
vertical-align: text-top !important;
}

View file

@ -1,12 +1,12 @@
// stylelint-disable declaration-no-important
@each $color, $value in $theme-colors {
@include bg-variant(".bg-#{$color}", $value, true);
@include bg-variant('.bg-#{$color}', $value, true);
}
@if $enable-gradients {
@each $color, $value in $theme-colors {
@include bg-gradient-variant(".bg-gradient-#{$color}", $value);
@include bg-gradient-variant('.bg-gradient-#{$color}', $value);
}
}

View file

@ -4,17 +4,37 @@
// Border
//
.border { border: $border-width solid $border-color !important; }
.border-top { border-top: $border-width solid $border-color !important; }
.border-right { border-right: $border-width solid $border-color !important; }
.border-bottom { border-bottom: $border-width solid $border-color !important; }
.border-left { border-left: $border-width solid $border-color !important; }
.border {
border: $border-width solid $border-color !important;
}
.border-top {
border-top: $border-width solid $border-color !important;
}
.border-right {
border-right: $border-width solid $border-color !important;
}
.border-bottom {
border-bottom: $border-width solid $border-color !important;
}
.border-left {
border-left: $border-width solid $border-color !important;
}
.border-0 { border: 0 !important; }
.border-top-0 { border-top: 0 !important; }
.border-right-0 { border-right: 0 !important; }
.border-bottom-0 { border-bottom: 0 !important; }
.border-left-0 { border-left: 0 !important; }
.border-0 {
border: 0 !important;
}
.border-top-0 {
border-top: 0 !important;
}
.border-right-0 {
border-right: 0 !important;
}
.border-bottom-0 {
border-bottom: 0 !important;
}
.border-left-0 {
border-left: 0 !important;
}
@each $color, $value in $theme-colors {
.border-#{$color} {

View file

@ -9,18 +9,21 @@
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@each $value in $displays {
.d#{$infix}-#{$value} { display: $value !important; }
.d#{$infix}-#{$value} {
display: $value !important;
}
}
}
}
//
// Utilities for toggling `display` in print
//
@media print {
@each $value in $displays {
.d-print-#{$value} { display: $value !important; }
.d-print-#{$value} {
display: $value !important;
}
}
}

View file

@ -9,7 +9,7 @@
&::before {
display: block;
content: "";
content: '';
}
.embed-responsive-item,

View file

@ -8,44 +8,112 @@
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
.flex#{$infix}-row { flex-direction: row !important; }
.flex#{$infix}-column { flex-direction: column !important; }
.flex#{$infix}-row-reverse { flex-direction: row-reverse !important; }
.flex#{$infix}-column-reverse { flex-direction: column-reverse !important; }
.flex#{$infix}-row {
flex-direction: row !important;
}
.flex#{$infix}-column {
flex-direction: column !important;
}
.flex#{$infix}-row-reverse {
flex-direction: row-reverse !important;
}
.flex#{$infix}-column-reverse {
flex-direction: column-reverse !important;
}
.flex#{$infix}-wrap { flex-wrap: wrap !important; }
.flex#{$infix}-nowrap { flex-wrap: nowrap !important; }
.flex#{$infix}-wrap-reverse { flex-wrap: wrap-reverse !important; }
.flex#{$infix}-fill { flex: 1 1 auto !important; }
.flex#{$infix}-grow-0 { flex-grow: 0 !important; }
.flex#{$infix}-grow-1 { flex-grow: 1 !important; }
.flex#{$infix}-shrink-0 { flex-shrink: 0 !important; }
.flex#{$infix}-shrink-1 { flex-shrink: 1 !important; }
.flex#{$infix}-wrap {
flex-wrap: wrap !important;
}
.flex#{$infix}-nowrap {
flex-wrap: nowrap !important;
}
.flex#{$infix}-wrap-reverse {
flex-wrap: wrap-reverse !important;
}
.flex#{$infix}-fill {
flex: 1 1 auto !important;
}
.flex#{$infix}-grow-0 {
flex-grow: 0 !important;
}
.flex#{$infix}-grow-1 {
flex-grow: 1 !important;
}
.flex#{$infix}-shrink-0 {
flex-shrink: 0 !important;
}
.flex#{$infix}-shrink-1 {
flex-shrink: 1 !important;
}
.justify-content#{$infix}-start { justify-content: flex-start !important; }
.justify-content#{$infix}-end { justify-content: flex-end !important; }
.justify-content#{$infix}-center { justify-content: center !important; }
.justify-content#{$infix}-between { justify-content: space-between !important; }
.justify-content#{$infix}-around { justify-content: space-around !important; }
.justify-content#{$infix}-start {
justify-content: flex-start !important;
}
.justify-content#{$infix}-end {
justify-content: flex-end !important;
}
.justify-content#{$infix}-center {
justify-content: center !important;
}
.justify-content#{$infix}-between {
justify-content: space-between !important;
}
.justify-content#{$infix}-around {
justify-content: space-around !important;
}
.align-items#{$infix}-start { align-items: flex-start !important; }
.align-items#{$infix}-end { align-items: flex-end !important; }
.align-items#{$infix}-center { align-items: center !important; }
.align-items#{$infix}-baseline { align-items: baseline !important; }
.align-items#{$infix}-stretch { align-items: stretch !important; }
.align-items#{$infix}-start {
align-items: flex-start !important;
}
.align-items#{$infix}-end {
align-items: flex-end !important;
}
.align-items#{$infix}-center {
align-items: center !important;
}
.align-items#{$infix}-baseline {
align-items: baseline !important;
}
.align-items#{$infix}-stretch {
align-items: stretch !important;
}
.align-content#{$infix}-start { align-content: flex-start !important; }
.align-content#{$infix}-end { align-content: flex-end !important; }
.align-content#{$infix}-center { align-content: center !important; }
.align-content#{$infix}-between { align-content: space-between !important; }
.align-content#{$infix}-around { align-content: space-around !important; }
.align-content#{$infix}-stretch { align-content: stretch !important; }
.align-content#{$infix}-start {
align-content: flex-start !important;
}
.align-content#{$infix}-end {
align-content: flex-end !important;
}
.align-content#{$infix}-center {
align-content: center !important;
}
.align-content#{$infix}-between {
align-content: space-between !important;
}
.align-content#{$infix}-around {
align-content: space-around !important;
}
.align-content#{$infix}-stretch {
align-content: stretch !important;
}
.align-self#{$infix}-auto { align-self: auto !important; }
.align-self#{$infix}-start { align-self: flex-start !important; }
.align-self#{$infix}-end { align-self: flex-end !important; }
.align-self#{$infix}-center { align-self: center !important; }
.align-self#{$infix}-baseline { align-self: baseline !important; }
.align-self#{$infix}-stretch { align-self: stretch !important; }
.align-self#{$infix}-auto {
align-self: auto !important;
}
.align-self#{$infix}-start {
align-self: flex-start !important;
}
.align-self#{$infix}-end {
align-self: flex-end !important;
}
.align-self#{$infix}-center {
align-self: center !important;
}
.align-self#{$infix}-baseline {
align-self: baseline !important;
}
.align-self#{$infix}-stretch {
align-self: stretch !important;
}
}
}

View file

@ -4,8 +4,14 @@
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
.float#{$infix}-left { float: left !important; }
.float#{$infix}-right { float: right !important; }
.float#{$infix}-none { float: none !important; }
.float#{$infix}-left {
float: left !important;
}
.float#{$infix}-right {
float: right !important;
}
.float#{$infix}-none {
float: none !important;
}
}
}

View file

@ -1,5 +1,7 @@
// stylelint-disable declaration-no-important
@each $value in $overflows {
.overflow-#{$value} { overflow: $value !important; }
.overflow-#{$value} {
overflow: $value !important;
}
}

View file

@ -2,7 +2,9 @@
// Common values
@each $position in $positions {
.position-#{$position} { position: $position !important; }
.position-#{$position} {
position: $position !important;
}
}
// Shorthand

View file

@ -1,6 +1,14 @@
// stylelint-disable declaration-no-important
.shadow-sm { box-shadow: $box-shadow-sm !important; }
.shadow { box-shadow: $box-shadow !important; }
.shadow-lg { box-shadow: $box-shadow-lg !important; }
.shadow-none { box-shadow: none !important; }
.shadow-sm {
box-shadow: $box-shadow-sm !important;
}
.shadow {
box-shadow: $box-shadow !important;
}
.shadow-lg {
box-shadow: $box-shadow-lg !important;
}
.shadow-none {
box-shadow: none !important;
}

View file

@ -4,17 +4,31 @@
@each $prop, $abbrev in (width: w, height: h) {
@each $size, $length in $sizes {
.#{$abbrev}-#{$size} { #{$prop}: $length !important; }
.#{$abbrev}-#{$size} {
#{$prop}: $length !important;
}
}
}
.mw-100 { max-width: 100% !important; }
.mh-100 { max-height: 100% !important; }
.mw-100 {
max-width: 100% !important;
}
.mh-100 {
max-height: 100% !important;
}
// Viewport additional helpers
.min-vw-100 { min-width: 100vw !important; }
.min-vh-100 { min-height: 100vh !important; }
.min-vw-100 {
min-width: 100vw !important;
}
.min-vh-100 {
min-height: 100vh !important;
}
.vw-100 { width: 100vw !important; }
.vh-100 { height: 100vh !important; }
.vw-100 {
width: 100vw !important;
}
.vh-100 {
height: 100vh !important;
}

View file

@ -8,7 +8,9 @@
@each $prop, $abbrev in (margin: m, padding: p) {
@each $size, $length in $spacers {
.#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; }
.#{$abbrev}#{$infix}-#{$size} {
#{$prop}: $length !important;
}
.#{$abbrev}t#{$infix}-#{$size},
.#{$abbrev}y#{$infix}-#{$size} {
#{$prop}-top: $length !important;
@ -31,7 +33,9 @@
// Negative margins (e.g., where `.mb-n1` is negative version of `.mb-1`)
@each $size, $length in $spacers {
@if $size != 0 {
.m#{$infix}-n#{$size} { margin: -$length !important; }
.m#{$infix}-n#{$size} {
margin: -$length !important;
}
.mt#{$infix}-n#{$size},
.my#{$infix}-n#{$size} {
margin-top: -$length !important;
@ -52,7 +56,9 @@
}
// Some special margin utils
.m#{$infix}-auto { margin: auto !important; }
.m#{$infix}-auto {
margin: auto !important;
}
.mt#{$infix}-auto,
.my#{$infix}-auto {
margin-top: auto !important;

View file

@ -12,7 +12,7 @@
z-index: 1;
// Just in case `pointer-events: none` is set on a parent
pointer-events: auto;
content: "";
content: '';
// IE10 bugfix, see https://stackoverflow.com/questions/16947967/ie10-hover-pseudo-class-doesnt-work-without-background-color
background-color: rgba(0, 0, 0, 0);
}

View file

@ -4,14 +4,24 @@
// Text
//
.text-monospace { font-family: $font-family-monospace !important; }
.text-monospace {
font-family: $font-family-monospace !important;
}
// Alignment
.text-justify { text-align: justify !important; }
.text-wrap { white-space: normal !important; }
.text-nowrap { white-space: nowrap !important; }
.text-truncate { @include text-truncate(); }
.text-justify {
text-align: justify !important;
}
.text-wrap {
white-space: normal !important;
}
.text-nowrap {
white-space: nowrap !important;
}
.text-truncate {
@include text-truncate();
}
// Responsive alignment
@ -19,40 +29,74 @@
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
.text#{$infix}-left { text-align: left !important; }
.text#{$infix}-right { text-align: right !important; }
.text#{$infix}-center { text-align: center !important; }
.text#{$infix}-left {
text-align: left !important;
}
.text#{$infix}-right {
text-align: right !important;
}
.text#{$infix}-center {
text-align: center !important;
}
}
}
// Transformation
.text-lowercase { text-transform: lowercase !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-capitalize { text-transform: capitalize !important; }
.text-lowercase {
text-transform: lowercase !important;
}
.text-uppercase {
text-transform: uppercase !important;
}
.text-capitalize {
text-transform: capitalize !important;
}
// Weight and italics
.font-weight-light { font-weight: $font-weight-light !important; }
.font-weight-lighter { font-weight: $font-weight-lighter !important; }
.font-weight-normal { font-weight: $font-weight-normal !important; }
.font-weight-bold { font-weight: $font-weight-bold !important; }
.font-weight-bolder { font-weight: $font-weight-bolder !important; }
.font-italic { font-style: italic !important; }
.font-weight-light {
font-weight: $font-weight-light !important;
}
.font-weight-lighter {
font-weight: $font-weight-lighter !important;
}
.font-weight-normal {
font-weight: $font-weight-normal !important;
}
.font-weight-bold {
font-weight: $font-weight-bold !important;
}
.font-weight-bolder {
font-weight: $font-weight-bolder !important;
}
.font-italic {
font-style: italic !important;
}
// Contextual colors
.text-white { color: $white !important; }
@each $color, $value in $theme-colors {
@include text-emphasis-variant(".text-#{$color}", $value, true);
.text-white {
color: $white !important;
}
.text-body { color: $body-color !important; }
.text-muted { color: $text-muted !important; }
@each $color, $value in $theme-colors {
@include text-emphasis-variant('.text-#{$color}', $value, true);
}
.text-black-50 { color: rgba($black, .5) !important; }
.text-white-50 { color: rgba($white, .5) !important; }
.text-body {
color: $body-color !important;
}
.text-muted {
color: $text-muted !important;
}
.text-black-50 {
color: rgba($black, 0.5) !important;
}
.text-white-50 {
color: rgba($white, 0.5) !important;
}
// Misc
@ -60,7 +104,9 @@
@include text-hide($ignore-warning: true);
}
.text-decoration-none { text-decoration: none !important; }
.text-decoration-none {
text-decoration: none !important;
}
.text-break {
word-break: break-word !important; // IE & < Edge 18
@ -69,4 +115,6 @@
// Reset
.text-reset { color: inherit !important; }
.text-reset {
color: inherit !important;
}

View file

@ -9,27 +9,25 @@
* 3. This window proceeds to send the current presentation state
* to the notes window
*/
var RevealNotes = (function() {
var RevealNotes = (function () {
var notesPopup = null;
function openNotes( notesFilePath ) {
function openNotes(notesFilePath) {
if (notesPopup && !notesPopup.closed) {
notesPopup.focus();
return;
}
if( !notesFilePath ) {
var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path
jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path
if (!notesFilePath) {
var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path
jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path
notesFilePath = jsFileLocation + 'notes.html';
}
notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' );
notesPopup = window.open(notesFilePath, 'reveal.js - Notes', 'width=1100,height=700');
if( !notesPopup ) {
alert( 'Speaker view popup failed to open. Please make sure popups are allowed and reopen the speaker view.' );
if (!notesPopup) {
alert('Speaker view popup failed to open. Please make sure popups are allowed and reopen the speaker view.');
return;
}
@ -41,51 +39,59 @@ var RevealNotes = (function() {
*/
function connect() {
// Keep trying to connect until we get a 'connected' message back
var connectInterval = setInterval( function() {
notesPopup.postMessage( JSON.stringify( {
namespace: 'reveal-notes',
type: 'connect',
url: window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search,
state: Reveal.getState()
} ), '*' );
}, 500 );
var connectInterval = setInterval(function () {
notesPopup.postMessage(
JSON.stringify({
namespace: 'reveal-notes',
type: 'connect',
url:
window.location.protocol +
'//' +
window.location.host +
window.location.pathname +
window.location.search,
state: Reveal.getState(),
}),
'*',
);
}, 500);
window.addEventListener( 'message', function( event ) {
var data = JSON.parse( event.data );
if( data && data.namespace === 'reveal-notes' && data.type === 'connected' ) {
clearInterval( connectInterval );
window.addEventListener('message', function (event) {
var data = JSON.parse(event.data);
if (data && data.namespace === 'reveal-notes' && data.type === 'connected') {
clearInterval(connectInterval);
onConnected();
}
if( data && data.namespace === 'reveal-notes' && data.type === 'call' ) {
callRevealApi( data.methodName, data.arguments, data.callId );
if (data && data.namespace === 'reveal-notes' && data.type === 'call') {
callRevealApi(data.methodName, data.arguments, data.callId);
}
} );
});
}
/**
* Calls the specified Reveal.js method with the provided argument
* and then pushes the result to the notes frame.
*/
function callRevealApi( methodName, methodArguments, callId ) {
var result = Reveal[methodName].apply( Reveal, methodArguments );
notesPopup.postMessage( JSON.stringify( {
namespace: 'reveal-notes',
type: 'return',
result: result,
callId: callId
} ), '*' );
function callRevealApi(methodName, methodArguments, callId) {
var result = Reveal[methodName].apply(Reveal, methodArguments);
notesPopup.postMessage(
JSON.stringify({
namespace: 'reveal-notes',
type: 'return',
result: result,
callId: callId,
}),
'*',
);
}
/**
* Posts the current slide data to the notes window
*/
function post( event ) {
function post(event) {
var slideElement = Reveal.getCurrentSlide(),
notesElement = slideElement.querySelector( 'aside.notes' ),
fragmentElement = slideElement.querySelector( '.current-fragment' );
notesElement = slideElement.querySelector('aside.notes'),
fragmentElement = slideElement.querySelector('.current-fragment');
var messageData = {
namespace: 'reveal-notes',
@ -93,23 +99,22 @@ var RevealNotes = (function() {
notes: '',
markdown: false,
whitespace: 'normal',
state: Reveal.getState()
state: Reveal.getState(),
};
// Look for notes defined in a slide attribute
if( slideElement.hasAttribute( 'data-notes' ) ) {
messageData.notes = slideElement.getAttribute( 'data-notes' );
if (slideElement.hasAttribute('data-notes')) {
messageData.notes = slideElement.getAttribute('data-notes');
messageData.whitespace = 'pre-wrap';
}
// Look for notes defined in a fragment
if( fragmentElement ) {
var fragmentNotes = fragmentElement.querySelector( 'aside.notes' );
if( fragmentNotes ) {
if (fragmentElement) {
var fragmentNotes = fragmentElement.querySelector('aside.notes');
if (fragmentNotes) {
notesElement = fragmentNotes;
}
else if( fragmentElement.hasAttribute( 'data-notes' ) ) {
messageData.notes = fragmentElement.getAttribute( 'data-notes' );
} else if (fragmentElement.hasAttribute('data-notes')) {
messageData.notes = fragmentElement.getAttribute('data-notes');
messageData.whitespace = 'pre-wrap';
// In case there are slide notes
@ -118,13 +123,12 @@ var RevealNotes = (function() {
}
// Look for notes defined in an aside element
if( notesElement ) {
if (notesElement) {
messageData.notes = notesElement.innerHTML;
messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string';
messageData.markdown = typeof notesElement.getAttribute('data-markdown') === 'string';
}
notesPopup.postMessage( JSON.stringify( messageData ), '*' );
notesPopup.postMessage(JSON.stringify(messageData), '*');
}
/**
@ -132,47 +136,39 @@ var RevealNotes = (function() {
* window.
*/
function onConnected() {
// Monitor events that trigger a change in state
Reveal.addEventListener( 'slidechanged', post );
Reveal.addEventListener( 'fragmentshown', post );
Reveal.addEventListener( 'fragmenthidden', post );
Reveal.addEventListener( 'overviewhidden', post );
Reveal.addEventListener( 'overviewshown', post );
Reveal.addEventListener( 'paused', post );
Reveal.addEventListener( 'resumed', post );
Reveal.addEventListener('slidechanged', post);
Reveal.addEventListener('fragmentshown', post);
Reveal.addEventListener('fragmenthidden', post);
Reveal.addEventListener('overviewhidden', post);
Reveal.addEventListener('overviewshown', post);
Reveal.addEventListener('paused', post);
Reveal.addEventListener('resumed', post);
// Post the initial state
post();
}
connect();
}
return {
init: function() {
if( !/receiver/i.test( window.location.search ) ) {
init: function () {
if (!/receiver/i.test(window.location.search)) {
// If the there's a 'notes' query set, open directly
if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) {
if (window.location.search.match(/(\?|\&)notes/gi) !== null) {
openNotes();
}
// Open the notes when the 's' key is hit
Reveal.addKeyBinding({keyCode: 83, key: 'S', description: 'Speaker notes view'}, function() {
Reveal.addKeyBinding({keyCode: 83, key: 'S', description: 'Speaker notes view'}, function () {
openNotes();
} );
});
}
},
open: openNotes
open: openNotes,
};
})();
Reveal.registerPlugin( 'notes', RevealNotes );
Reveal.registerPlugin('notes', RevealNotes);