Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sass map trickery for easier customization #23260

Merged
merged 2 commits into from
Aug 13, 2017
Merged

Sass map trickery for easier customization #23260

merged 2 commits into from
Aug 13, 2017

Conversation

mdo
Copy link
Member

@mdo mdo commented Aug 9, 2017

Peep the CodePen demo.

This PR creates a !default empty Sass maps for our $grays, $colors, and $theme-colors lists and map-merges a default setting for all colors into them. This way, anyone can continue to map-merge in additional or replacement key: value pairs as needed without having to replace the entire original Sass map as @martinbean pointed out in #23112.

This technique was pointed out by @hokiecoder in #22891 (comment).


Thoughts? If folks are interested, we'll need to update the options.md docs page to explain this, and add some code comments in our Sass files.

@martinbean
Copy link
Contributor

martinbean commented Aug 9, 2017

@mdo It’s an improvement in that we don’t have to re-define unnecessary variables to override a sub-set now 😀

Curious as to why the move to holding theme colours in a map now though, rather than simple variables? As my feeling is it was a lot easier to reference $brand-primary in custom Sass style sheets than map-get($theme-colors, "primary"). I think for designers and front-end developers not familiar with things like maps in Sass, this change may make Bootstrap less accessible to them and also steepen the learning curve.

@fluke
Copy link

fluke commented Aug 9, 2017

@martinbean They iterate over the map when generating buttons, etc. so just by adding to the array you can add new theme colors for buttons, etc. which is useful.

If it's possible to dynamically generate Sass variables you could maybe iterate through the map and make flat variables which people could use.

@liquidvisual
Copy link

I agree with @martinbean regarding ease of use. I'm a designer, and I find the map-get($theme-colors, "primary") so cumbersome to write. I use $brand-primary everywhere, and it's a no-brainer to type.

@martinbean
Copy link
Contributor

martinbean commented Aug 11, 2017

I’m getting an error when trying to override the primary colour.

My app.scss file:

@import "custom";
@import "node_modules/bootstrap/scss/bootstrap";

My _custom.scss file:

$theme-colors: (
  primary: #c00
);

The error I get when trying to compile:

Error: node_modules/bootstrap/scss/_forms.scss
Error: argument $color of rgba($color, $alpha) must be a color

Backtrace:
  node_modules/bootstrap/scss/_forms.scss:280, in function rgba
  node_modules/bootstrap/scss/_forms.scss:280
    on line 280 of node_modules/bootstrap/scss/_forms.scss
>> background-color: rgba($form-feedback-invalid-color,.8);

Looking at the beta’s _variables.scss, it looks like a default map isn‘t merged with the $theme-colors map, so it’s going to be expecting me to define it—and all of its dependent variables—in my _custom.scss file 😩

@mdo How come the implementation demonstrated in the aforementioned Pen not implemented for the beta? As that’s what I followed.

@mdo
Copy link
Member Author

mdo commented Aug 11, 2017

I'm a designer, and I find the map-get($theme-colors, "primary") so cumbersome to write. I use $brand-primary everywhere, and it's a no-brainer to type.

@liquidvisual You don't have to pull from the map at all times—we have all the variables there still. We use the Sass map to reduce overhead and iterate over all our variables to generate every component's themed modifier classes

How come the implementation demonstrated in the aforementioned Pen not implemented for the beta? As that’s what I followed.

I didn't have time to get this into the beta and this isn't a breaking change. It'll make it into beta 2.

@dfinucane
Copy link

@martinbean I think you are getting that error because you don't import functions before variables

@mdo mdo merged commit 0bc39aa into v4-dev Aug 13, 2017
@mdo mdo deleted the merge-color-maps branch August 13, 2017 21:56
@mdo mdo mentioned this pull request Aug 13, 2017
@ddevault
Copy link

Having to use map-get everywhere is awful. Strong 👎

@notio
Copy link

notio commented Sep 21, 2017

I believe I have read all the tickets related to this issue, and now have no idea how to make basic customizations, thus a plea for updated documentation please! The typical case is: Install Bootstrap, change some colors. Ideally I could use the CDN version of Bootstrap and link to a simple css file with my overrides after the CDN link -- is this expected to work under the Sass map trickery scheme?

@martinbean
Copy link
Contributor

now have no idea how to make basic customizations

This.

Bootstrap used to be so simple to customise. Maps may be a great data structure to hold things like colours of a theme, but they’re not accessible or great for beginners or non-full-time front-end developers to customise.

It’d be great if the top-level $brand- variables were brought back and a map used “under the hood” to hold the colours belonging to the theme, but I think the current solution is just going to frustrate and turn away a lot of users.

@ddevault
Copy link

It definitely turned me away. I reverted back to v4.0.0-alpha.6 and will not be upgrading so long as this is a problem.

@soullivaneuh
Copy link

I didn't have time to get this into the beta and this isn't a breaking change. It'll make it into beta 2.

@mdo You you have any eta for the release of the beta 2?

@braginteractive
Copy link

braginteractive commented Sep 22, 2017

So does anyone know how to change the theme colors so it will edit all the elements that use primary, secondary, etc?

For example, I am looking to change the $primary color, so when I use things like btn-primary it will be my custom color. The following doesn't work:

$custom: #123;

$theme-colors: (
  primary: $custom
);

Is there another step to override and use the map defaults?

@dfinucane
Copy link

dfinucane commented Sep 22, 2017

I have a file I named _custom_bootstrap.scss that contains something like the following

@import './bootstrap/scss/functions';

$gray-100: #f8f9fa;
$gray-600: #868e96;
$gray-800: #343a40;
$black:  #000;
$blue:    #0082cc;
$red:     #dc3545;
$yellow:  #ffc107;
$cyan:    #17a2b8;

$theme-colors:(
    primary: $blue,
    secondary: $gray-600,
    success: $blue,
    info: $cyan,
    warning: $yellow,
    danger: $red,
    light: $gray-100,
    dark: $gray-800
);

then in my applications styles.scss I have the following

@import 'custom_bootstrap';

@import 'bootstrap/scss/bootstrap';

The thing that helped me understand how this had to work was I realized that what SASS calls variables are really constants in that once they are defined they can't be changed. So knowing that all you need to do is import your _custom_bootstrap.scss before bootstrap defines those same 'variables'.

@braginteractive
Copy link

braginteractive commented Sep 22, 2017

@dfinucane worked perfectly. Thanks

I was just trying to do:

$custom: #123;
$theme-colors:(
    primary: $custom
);

And it needed the whole map:

$custom: #123;
$theme-colors:(
    primary: $custom,
   secondary: $gray-600,
   success: $green,
   info: $cyan,
   warning: $yellow,
   danger: $red,
   light: $gray-100,
   dark: $gray-800
);

@fluke
Copy link

fluke commented Sep 25, 2017

@braginteractive This PR is meant to fix the issue you just had. The name is a bit confusing but this is the main part.

This way, anyone can continue to map-merge in additional or replacement key: value pairs as needed without having to replace the entire original Sass map as @martinbean pointed out in #23112.

@philipchristopher
Copy link

@liquidvisual You can reduce some of the complexity of the "map-get" function by using bootstrap's "theme-color" function which simply returns the theme-color. Makes it a little less cumbersome.

@import "~bootstrap/scss/functions";

h2 {
  color: theme-color("primary");
  /* color: map-get( $theme-colors, primary); */
}

@martinbean
Copy link
Contributor

@mdo Thanks for making customisation easier again in beta 2! 😘

@AvverbioPronome
Copy link

I believe the base color constants ($white to $cyan) should probably be separated in a different scss file. So that they can be imported before the maps are created to easily define the logical function colors ($primary to $dark) in customizations.

In beta2 this is really confusing, because you can easily override variables like $body-bg and $body-color after @import "variables"; but you cannot effectively do the same with $primary and the like.

@sazmer
Copy link

sazmer commented Dec 30, 2017

Has this changed or is about to change? I can't really see the logic right now:

// ---- custom.scss

// =========== BOOTSTRAP FUNCTIONS & CORE ===============================
@import "~bootstrap/scss/functions";
@import "~bootstrap/scss/mixins";
// =========== VARIABLES ===================================

//Working fine:
$theme-colors: ( "primary": purple, "danger": #ff4136 );

//Not working. Is it possible?
//$body-bg: $green;

// =========== FULL BOOTSTRAP ===============================

@import '~bootstrap/scss/bootstrap';

// =========== STYLE OVERRIDES ==============================

//Working fine:
.custom-element {
color: gray("100");
background-color: theme-color("dark");
}

Maybe I'm not understanding it correctly, but I can't get my head around how this could be done. Or, if it can't be done, how it should be done. If I cant set $bg-color: $red without redefining red, how am I supposed to use it?

omnichronous added a commit to omnichronous/bootstrap that referenced this pull request Jun 15, 2018
This change follows exactly what was done for the `$grays`, `$colors`, and `$theme-colors` lists in twbs#23260. This allows for easy addition of new breakpoints or grid containers also.
XhmikosR pushed a commit that referenced this pull request Oct 23, 2018
This change follows exactly what was done for the `$grays`, `$colors`, and `$theme-colors` lists in #23260. This allows for easy addition of new breakpoints or grid containers also.
pengzishang added a commit to pengzishang/bootstrap that referenced this pull request Nov 28, 2018
* Consistently re-use input variables

* use bsCustomFileInput in our documentation (twbs#27264)

* docs: switch to font-weight 600. (twbs#27226)

Segoe UI doesn't have font-weight: 500 making things not looking as expected.

* Add new variables for form feedback tooltips (twbs#26959)

Fixes twbs#26886

* Allow multiple ways of padding declaration for modal header (twbs#26976)

* twbs#26967: Allow multiple ways of padding declaration for modal header
* twbs#26976: split vertical and horizontal modal padding

* dist

* dist

* Remove flex utilities from .list-group-item's as they're display: block; meaning the utilities have no affect. Closes twbs#27162.

* Update forms.md

fix duplicate id attribute

* Make release-zip include the root folder.

Also, now it should work cross-platform assuming `zip` is present.

* Add explanation about accordion wrapper.

* Fix examples after the recent JS changes.

`https://example.com` isn't a valid selector.

* Prevent pointer-events on disabled anchor dropdown-item

Fixes twbs#26695

* Prevent pointer events on disabled list-group-item

* Add license headers in js/dist files

By implementing the same approach of rollup.config.js
and replicate it in build-plugins.js, individual plugins
will display license headers.

* Include the plugin's filename in the license header.

* Remove unneeded `path.resolve`.

* remove useless iife

* Tweak build/build-plugins.js.

* updated README (twbs#27349)

* fix - small grammar error

"given move to" -> "given the move to"

* Add overflow-auto and overflow-hidden utilities

* Rename script.

* Update devDependencies and gems.

* refine deprecated holder.js color syntax

* refine deprecated holder.js color syntax
  * remove `#55595c:#373a3c`
* harmonize with all other holder.js examples

* update holder.js image dimensions for sizing example

* update holder.js image dimensions for sizing example
  * use `100%` instead of `100%`
  * 📝 https://github.com/imsky/holder#fluid-placeholders

* Update Travis config.

* remove `dist: trusty` since it's the default
* disable email notifications

* Remove sri-toolbox dependency.

We can achieve the same very easily.

* Add a release npm script.

* Fix invalid selectors in tests and examples.

* Update popper.js in docs.

* build/generate-sri.js: add popperjs.

* docs: fix bundle SRI hash.

Also, remove popper.js from this script since it's not present in the repo.

* Remove the unused `jobs` Jekyll variable.

* Fix a few links.

* fix `/versions/` link
* add missing trailing slashes
* fix a couple of redirects

* js/tests/visual: fix popper script.

Broken after 787441d.

* Move periods outside of links.

* Travis: add `--clean` in `bundle install` command.

* Reduce indentation.

* Change h1 to h2

* Tighten stylelint config. (twbs#27336)

Also improve its formatting.

* Combine examples and simple layouts.

* Rename everything to skippy and center skippy (twbs#27420)

* Include `css-copy` in the `css` script.

* Update devDependencies and gems.

* Move docs .eslintrc in site/.

* Add a CODEOWNERS file (twbs#27271)

* Simplify .gitattributes.

* Move media from layout to components

* Adds a note about the limitations on content being larger than the image.

In the event that the content is larger than the image, the content will continue to be displayed outside the image itself. There are some workarounds but they apply only to browsers that support this option and IE11 is not one of them.

* Adding call out note directly to the page.

Instead of using an external source since this is only a one time note it is safe to be placed within the document itself.

* Delete callout-info-content-iamge-overlay-overflow.md

Deleting external file since it is not needed, the copy of this file will be added directly to card.md.

* Fix btn focus color (twbs#27178)

* npm release-zip: remove the folder before zipping.

* Move lint scripts outside of the main scripts.

This allows us to run `npm run dist` without tests.

* Rename docs production script to production and use `JEKYLL_ENV`. (twbs#27410)

* Travis: stop installing chrome (twbs#27468)

It seems it works without it.

* Fix doc typo

* Fix double border on list-group (twbs#27126)

* Fix size of modal dialogs at different widths (twbs#27094)

* feat: keep contrast on `.table-dark`

In case we set `$body-bg` to a dark color, we have to keep table contrast relevant.

* docs search: take into account the current URL.

* table: Add border color relative to theme for accessibility (twbs#25755)

* Add font weight options for form controls and custom select (twbs#27343)

* Add `show` and `hide` methods to dropdown (twbs#27370)

* Add query string to the start_url to track how often app is launched

Useful suggestion from Google in the Web App Manifest documentation.
https://developers.google.com/web/fundamentals/web-app-manifest/#start-url

* Add touch support in our carousel with HammerJS.

* swipe left/right without hammerjs

* use pointer events if available

* Use correct touch-action values

- my fault, my original advice of using `touch-action: pan-x` is exactly the value we *don't* want to have the browser handle...

* Abandon swipe altogether if more than one touch detected

* Remove unnecessary pointer event listeners

these may also be the cause of weird behavior in Chrome/Surface, where scrolling vertically triggers slide advance

* Refactor (and correct) start/move/end functions

in particular, no need to use originEvent, and preventDefault() only needed for touch events

* Set touch-action to "none"

Firefox currently seems extremely fickle - with `pan-y` if fires pointercancel as soon as a touch strays even a pixel or so vertically.
While `touch-action: pan-y` would be ideal (allowing users to scroll the page even when their finger started the scroll on the carousel), this prevents a swipe that isn't perfectly/only horizontal to be recognised by Firefox.

* avoid drag img

* Remove service worker

* Unregister Service Worker.

* Clean up docs Sass code.

* remove unused rules
* use Sass nesting in more places
* use the core mixins in more places
* use the color variables more

* package.json: add `version_short` and use it in the npm scripts.

* Make use of jekyll-toc's `no_toc_section` class.

Requires jekyll-toc v0.8.0.

* Remove redundant width and height properties

* Custom select inconsistent padding (twbs#27415)

* Fix twbs#26372: disabled btn hover issue (twbs#27407)

When gradients are enabled there is still a hover state on disabled
buttons since the hover rules apply to background-image and disabled
rules apply to background-color. This applies the logic already present
in dropdowns to buttons. This fix was originally proposed by @ysds.

* changes the variables for input font size

* Update _custom-forms.scss (twbs#27276)

user-select has no effect on before/after pseudo elements

* webpack page: Remove precss reference

* Fix for double border on cards in an accordion (twbs#27133)

* Carousel fade cleanup (twbs#27278)

* optimize data URIs (twbs#27284)

* Outline button variant hover mixin (twbs#27289)

The outline button variant mixin should use the hover mixin, as does the non-outline version.

* Re-add carousel control transition (twbs#27277)

* Custom checkboxes and radios retheming (twbs#27064)

* feature/yiq function, add parameters, with default values. (twbs#26917)

* Improve Grid examples. (twbs#26808)

Removes the grid.css file of the grid example and makes use of utility classes

* Example dashboard: Responsive padding-top of the main content (twbs#26332)

* Add dropdown responsive alignment (twbs#26255)

* Card header color theming (twbs#26573)

Define new variable for card header color

* Fix typo in the Popper.js checks. (twbs#27488)

* Simplify theme color usage (twbs#27378)

* Revert "Simplify .gitattributes."

This reverts commit 1c78f70.

Unfortunately some Linux distros use an ancient git version and this change requires git >= 2.10.

* test(Modal): reuse _getScrollbarWidth in tests

* Change erroneous documentation for .flex-fill (twbs#27265)

The current documentation for .flex-fill indicated that the flex
items would have equal widths, regardless of content. This update
ensures that the documentation reflects the fact that the width
of the flex items depends on their actual content.

* Update devDependencies and gems.

* Unitless breakpoints

If I want to customise the breakpoints using `em`, I get compatibility errors.

It is good practice to set breakpoints in `em` instead of `px` when users use browser scaling.
See https://zellwk.com/blog/media-query-units/#concluding-the-experiments for more information why someone would like to do this. Only Safari users can get annoyed: https://adamwathan.me/dont-use-em-for-media-queries/

In any case, using a unitless number at line 42 would be very convenient.

* Disallow transition property (use mixin instead)

* Use the example shortcode in more places.

Now that we don't have the ToC issue with the examples' headers in ToC, we can safely do this.no_toc_section_class

* Remove unneeded check.

Leftover from after 43c20b9.

* Further ToC fixes.

* Cleanup stylelint comments

* Custom select validation padding fix and additional custom select feedback icon variables

* Easy merging of new grid breakpoints and containers (twbs#26714)

This change follows exactly what was done for the `$grays`, `$colors`, and `$theme-colors` lists in twbs#23260. This allows for easy addition of new breakpoints or grid containers also.

* Fix readonly-plain-text with button addon (twbs#25871)

Fixes twbs#25870

* Variable darken percentage for emphasized links

* Added Viewport Height & Width helpers 

This allows the user to make a container (ideally) to use viewport height and width and allow better vertical/horizontal alignments of elements.

* Improve pagination's documentation accessibility.

- Remove `.sr-only` span for previous/next page, there is already`aria-label`
- Add `aria-disabled="true"` and `aria-current="page"`

* calculate modal transition duration based on modal-dialog element

* fix tab fade out (twbs#27533)

* Delete sache.json (twbs#27530)

* Update tab.js

I'm using Tab.js with remove function and get an error "TypeError: container is undefined [more info]", with this check the error is fixed.

* add unit test to test tabs can be removed without throwing error

* Update devDependencies and gems.

* add unit tests for our carousel

* update our coverage required for branches and functions

* Update Travis CI config.

Only run `coveralls` and `check-broken-links` tasks when we run the Test phase.

* Prevent the background to be shown when transitioning

* twbs#27502: Prevent active state border change

* download page: add Yarn (twbs#27544)

* Fix util tests on IE 10 (twbs#27556)

* docs: remove Webpack version reference.

* Remove trailing space.

* refactor(Modal): add `_isTransitioning` default value

Having variables initialised from start `_isTransitioning` is better.
Would be better to add an eslint rule to check for undeclared variables use.
Reordered enter checks for `show` and `hide` by priority.

* test(Modal): check if modal is disposed

* fix dispose modal unit test

* IE10 homepage fix

* Prevent hover/click on disabled .close links.

* Add @MartijnCuppens to our core team ! 🎉 (twbs#27562)

* Fix Edge bounce and restore original transition easing (twbs#27279)

* Fix empty custom-control-label alignment issue (twbs#27566)

* Make meaning of tooltip's `selector` option clearer (twbs#27573)

* robots.txt: disallow crawling when not in production. (twbs#27559)

* Remove the obsolete tooltip-viewport example and redirect it.

* handle detached tooltip when we try to hide a modal

* Add Sass variable for prefers-reduced-motion, add callout to affected components (twbs#27581)

* Tweak the accessibility/reduced motion text

include mention of carousel slides, remove the (now inaccurate, as Firefox 63 includes it too) mention that support is limited to Safari/macOS

xref twbs#27525

* Add new callout for reduced motion

* Add variable to control prefers-reduced-motion media query support

* Add callout about prefers-reduced-motion to all components currently using animation which are affected

* docs: remove false info from v3 suggestion.

* Resolve twbs#26226: Sync with normalize 8.0.0

diff credits: @client9

* Add TODO

* Avoid null value (twbs#27570)

* Jekyll: switch to localhost

`0.0.0.0` has issues on Windows.

* Button group refactoring and fixes (twbs#25395)

* scss/_custom-forms.scss: fix typo in comment.

* Replace touch-action: none with pan-y, remove preventDefault from touch event handling

* broken-link-checker: force follow links.

After 3256a2c, blc honored robots.txt thus it didn't crawl anything.
Ignore robots.txt to work around the issue.

* Travis: stop using a separate stage for Browser tests.

This should be faster.

* Add `.text-wrap` class.

this is the opposite of `.text-nowrap`, and a forces elements to wrap onto new lines.

One use case for this is extra long button text. Bootstrap buttons by default do no wrap, so this class could be used to override that behavior.

* Add `text-wrap` example.

* Use a badge for .text-wrap example

* Update devDependencies and gems.

* Update README.md (twbs#27588)

* remove jobs link
* specify a link in the BrowserStack image

* Ligthen/Darken Button focus shadow color

* Made the disabled state for nav more obvious. (twbs#27382)

* Add japanese to translations (twbs#27599)

* Add Noto Sans to the font stack (twbs#27596)

Fixes twbs#27595

* Remove htmllint. (twbs#27603)

We use the official HTML validator for HTML validation, and we don't really use any of the htmllint features.

* Prevent white line in Firefox (regression) (twbs#27594)

* Reorganize npm scripts.

* Add new `.rounded-pill` utility (twbs#27339)

* Increase readability card columns docs (twbs#27609)

* Travis: exit pipeline if test fails.

* Travis: Add back chrome addon (twbs#27610)

* display chrome version on travis

* Docs: Improve accessibility of disabled link example (twbs#27614)

Add `tabindex="-1"` and `aria-disabled="true"` to disabled link

* Wrap checkboxes in `.form-group` (twbs#27624)

* use bsCustomFileInput in our docs (twbs#27631)

* Move stylesheets to an include.

* Move analytics to an include file.

* Add an examples layout.

Reduces duplication and makes maintenance easier.

* Dashboard example: update 3rd-party libs and use the same CDN.

* Fix modal positioning on Android.

When the address bar is hidden, sometimes the visual position of the controls is out of sync with its logical position.

* Remove custom properties from examples so that they work in IE (twbs#27634)

* Redirect `/extend/` to `/extend/approach/`.

* Allow to add more embed responsive ratios (twbs#25894)

* Minor/Docs: tweak accordion example heading level (twbs#27620)

* Replace `data-src` with `src="..."` in docs. (twbs#27649)

* Update clipboard.js to v2.0.3 (twbs#27657)

* Jekyll: Add wdm gem for Windows. (twbs#27658)

* Add Bootstrap's very first spinners omfg it's actually happening

* spinners: use the animation shorthand property.

* Bump bootstrap.min.css bundle size.

* Spinners: show all color variants.

* Customize browse text of the custom file input with HTML (twbs#27651)

* Add new toasts component

* Create toast JS plugin, add unit tests.

* Fix toast documentation page.

* Implement `data-dismiss="toast"` to allow user to interact itself with the component (twbs#27155)

* Update toast documentation following pull twbs#27155

Also remove close button everywhere just let it when autohide is set to false

* Remove the show delay for our toast plugin

* Nest the `.toast.show` and use `display: block;` as inherit causes broken styles

* Clean up some docs for toasts

- Add headings to examples section
- Clarify styles and customization options in examples
- Add dismiss buttons to all toasts
- Missing period added for consistency
- Update roles, tweak text

* Dist

* Keep input group & form label font size in sync with form control font size (twbs#27663)

* some cleaning and changes for readability

* Use fancy apostrophe in HTML files.

For Markdown files, this isn't needed because the Markdown converter takes care of this.

* Update autoprefixer link to `.browserslistrc` file (twbs#27675)

* Update devDependencies and gems.

* Inherit card header color (twbs#27681)

* Enforce lowercase class name in .stylelintrc (twbs#27668)

* Support custom-select sizing in input-group (twbs#27677)

* Spinners cleanup

* Prevent text decoration skip inc and reorder comments (twbs#27673)

* Add documentation about .font-weight-bolder/lighter (twbs#27678)

* Add documentation about viewport sizing utilities (twbs#27688)

* Add documentation about .text-decoration-none (twbs#27686)

* Allows both OL and UL lists for tab buttons

* Remove `sudo` from Travis config. (twbs#27693)

https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration

* Replace anchor.js with jekyll-anchor-headings.

This allows us to generate the anchor links on build time.

https://github.com/allejo/jekyll-anchor-headings

* Replace holder.js with SVGs.

* Tweak placeholder.svg.

* always include the title
* make it possible to skip adding the title by passing `title=' '`
* remove viewBox since we don't need it

* Fix placeholder image replacement.

* Use the new include in examples too.

* Remove holder.js.

* Reindent.

* docs-sidebar.html: remove commented out code.

Leftover from old times.

* Use wrapping span instead of div (twbs#27695)

* docs: fix path to assets. (twbs#27696)

* reboot: Fix mailto address (twbs#27700)

* Sass precision documentation (twbs#27705)

* Placeholders: use our gray colors (twbs#27701)

Previously we were using the old holder.js colors.

* Add border-radius to dropdown items (twbs#27703)

* Fixed a fixed height issue of input-group size option (twbs#27687)

* Update devDependencies.

* Update DocSearch.js to latest version

The latest (2.6.2) docsearch.js version now displays results as standard `<a href>` links, allowing users to `ctrl`-click on them to trigger default browser behavior of opening in a new tab.

To maintain backward compatibility, this behavior has only been enabled to users that didn't define their own `handleSelected` method.

This PR updates your `docsearch()` code to take advantage of the new `<a href>` template, by removing your custom `handleSelected` and moving its behavior to the `transformData` call. Namely, what you wanted to avoid was jumping to the first `<h1>` of the pages, which would prevent users from seeing the header. This PR checks if the suggestion targets the `#content` anchor (meaning it goes to this first `<h1>`) and remove it.

Behavior should be the same, but at least now you can enjoy the `ctrl`-click :)

* Fix body scrolling issue when modal open (twbs#27698)

* Revert "Replace anchor.js with jekyll-anchor-headings."

This reverts commit b04f97f.

* Add opacity transition

* prevent text selection for floating labels example (twbs#27719)

* prevent text selection for floating labels
  * expand the click target by no selecting the label text
* use `pointer-events: none;` instead of `user-select`
  * thx @MartijnCuppens

* Update devDependencies.

* Dist

* Grow button width to the parent button group (twbs#27717)

* ship.sh: add missing period.

* Add test to make sure we enforce focus on modal (twbs#27723)

* Change OS X to macOS in Sass comments (twbs#27729)

It's been macOS for 3 years now and we use just 'macOS' elsewhere in the Bootstrap documentation.
https://en.wikipedia.org/wiki/MacOS

* Update package-lock.json.

* Update migration page to indicate the info can be used for 4.1.x as well as 4.0.x

* homepage: use srcset.

This should reduce the amount of bytes for non-2x displays.

* Use srcset for examples too.

* Move examples images in assets/img/examples/ folder.

* Use an SVG for the stack image.

Image by @mdo.

* Inline bootstrap-stack.svg.

It's pretty small compressed; a little less than 1 KB with gzip.

* Use `h5` for callouts so that they are not included in ToC.

Callouts are already excluded from ToC, but due to a limitation in jekyll-toc they are still being included.

We should revisit this if the bug is fixed later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.