0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00
Commit Graph

159 Commits

Author SHA1 Message Date
Mark Otto
3362c8cf13
Do some CSS and Migration guide cleanup (#36191)
* Do some CSS and Migration guide cleanup

- More code snippet tweaks
- Fix some homepage hero bugs
- Do a cleanup on Migration guide content to highlight more changes and fix some issues from merge conflicts
2022-04-18 20:56:18 -07:00
Mark Otto
3990ff04a0 Fix spacing of code snippets 2022-04-18 18:19:01 -07:00
Mark Otto
195440f2fb
v5.2.0 design refresh, plus responsive offcanvas classes (#35736)
* Add responsive offcanvas classes

- Updates navbar-expand classes to de-dupe some styles—these shouldn't interfere now.
- Adds some JS to the offcanvas component to help with responsiveness

Co-Authored-By: GeoSot <geo.sotis@gmail.com>

* Redesign homepage, docs, and examples

Homepage:

- New Bootstrap purple navbar
- Redesigned masthead
- Rewrote and redesigned homepage content
- Replace Copy text with icons like Bootstrap Icons site across all ClipboardJS instances
- Fixed padding issues in site footer
- Match homepage button styles to examples page, use gap instead of tons of responsive margin utils

Docs:

- New navbar, no more subnav. Migrated search and version picker into the main navbar and refreshed the design of it all, including the responsive toggles.
- New sidebar navigation is always expanded, and now features Bootstrap Icons alongside section headings
- Sidebar navigation autoscrolls to active link for better usability
- Subnav and navbar padding issues ironed out
- Enhanced the version picker in anticipation of v5.2: we can now link right to the same page in the previous version.
- Redesign callouts to add more color to our pages
- Collapse table of contents on mobile
- Cleanup and redesign button styles with CSS variables
- Update design for subnav version dropdown
- Update highlight and example to be full-width until md
- Improve the Added In badges
- Turn the ToC into a well on mobile
- Redesign code snippets to better house two action buttons

Examples:

- Redesign Examples page layout
- Add new example for responsive offcanvases in navbars

* Convert offcanvas to CSS vars

* Feat: add resize handler to Offcanvas.js.

If we could use as default the `.offcanvas` class without modifiers, we then, could add a simplified selector
The selector itself, ignores the .offcanvas class as it doesn't have any responsive behavior
The `aria-modal` addon is to protect us, selection backdrop elements

* Separate examples code, Add some selectors, fix stackblitz btn

Co-authored-by: GeoSot <geo.sotis@gmail.com>
2022-04-17 22:17:50 -07:00
Julien Déramond
fb21233098 Fix Chroma line highlight style 2022-04-14 23:40:32 -07:00
GeoSot
ece1601227
Revamp Scrollspy using Intersection observer (#33421)
* Revamp scrollspy to use IntersectionObserver

* Add smooth scroll support

* Update scrollspy.js/md

* move functionality to method

* Update scrollspy.js

* Add SmoothScroll to docs example

* Refactor Using `Maps` and smaller methods

* Update scrollspy.md/js

* Update scrollspy.spec.js

* Support backwards compatibility

* minor optimizations

* Merge activation functionality

* Update scrollspy.md

* Update scrollspy.js

* Rewording some of the documentation changes

* Update scrollspy.js

* Update scrollspy.md

* tweaking calculation functionality & drop text that suggests, to deactivate target when wrapper is not visible

* tweak calculation

* Fix lint

* Support scrollspy in body & tests

* change doc example to a more valid solution

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
2022-04-13 10:29:13 -07:00
Tiger Oakes
fe257823ec
Use Babel and ES6 in docs JS files (#31607)
* Pass docs js through Babel

* Use ES6 in docs js

* Only run babel on src files

* Allow babel in Hugo

* Update scripts.html

* Inherit from the root .eslintrc.json

* Use `Array.from`

* Drop Babel from docs

* Prefer template

* replace IIFE with arrow functions

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: GeoSot <geo.sotis@gmail.com>
2022-04-12 18:07:25 +03:00
Mark Otto
e206a6021b
Update docs syntax colors head of dark mode (#35984)
* update syntax colors in preparation for dark mode changes

* Improve color contrast
2022-04-11 18:43:18 -07:00
XhmikosR
7648848e04
Update devDependencies (#36120)
* Update devDependencies

* @babel/core                ^7.17.8  →  ^7.17.9
* @popperjs/core             ^2.11.4  →  ^2.11.5
* clean-css-cli               ^5.5.2  →   ^5.6.0
* eslint-plugin-import       ^2.25.4  →  ^2.26.0
* find-unused-sass-variables  ^4.0.3  →   ^4.0.4
* karma-rollup-preprocessor   ^7.0.8  →   ^7.0.7
* sass                      ^1.49.11  →  ^1.50.0
* stylelint                   14.2.0  →  ^14.6.1

* Fix currentcolor case
2022-04-08 09:17:00 +03:00
louismaxime.piton
273ebad151 Changing to btnTitle and btnEdit 2022-04-01 11:26:32 +03:00
Julien Déramond
6b4bdcc657
Fix typo for StackBlitz edit button's tooltip (#36073) 2022-03-29 18:16:11 +03:00
Mark Otto
a9a89debc7
Rewrite docs tables in Markdown with table shortcode (#31337)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: GeoSot <geo.sotis@gmail.com>
2022-03-14 09:38:04 +02:00
Mark Otto
acf6ea74a7
Add additional root variables, rename $variable-prefix to $prefix (#35981)
* Add additional root variables, rename $variable-prefix to $prefix

- Adds new root CSS variables for border-radius, border-width, border-color, and border-style
- Adds new root CSS variables for heading-color, link-colors, code color, and highlight color
- Replaces most instances of Sass variables (for border-radius, border-color, border-style, and border-width) for CSS variables inside _variables.scss
- Updates $mark-padding to be an even pixel number
- Renames $variable-prefix to $prefix throughout

* Bundlewatch
2022-03-13 10:13:09 -07:00
GeoSot
05c6e7dd66
Fix docs error after #35644 (#36002) 2022-03-11 17:56:57 +02:00
Puru Vijay
645f955845
docs: add a StackBlitz "Try It" button in code examples (#35644)
Co-authored-by: GeoSot <geo.sotis@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2022-03-09 17:32:58 +02:00
Mark Otto
2e75ec3c41 Convert popovers to CSS variables 2022-03-08 14:53:53 -08:00
Mark Otto
fdcbbe3d92 Convert tooltips to CSS vars 2022-03-08 14:53:53 -08:00
Julien Déramond
abe9d310ba Site assets: .bd-bg-purple-bright.bd-bg-violet and drop unused .bd-text-purple-bright 2022-02-28 15:17:37 -08:00
Mark Otto
efc5914667 Replace instances of Sass vars for CSS variable versions of border-color and border-width 2022-02-28 11:40:32 -08:00
Mark Otto
12d49f19b0 Remove thicker border on table thead elements
Use the new .table-group-divider to create your own dividers as desired. Would love to find a better way to handle border-color for this, but for now, this is at least opt-in.

I've applied it by default in another way for our docs tables to help differentiate our content vs our components.

Fixes #35342
2022-02-28 11:21:53 -08:00
Mark Otto
1c5ec4c310 Separate override for hr's in component examples 2022-02-25 08:37:38 -08:00
Gaël Poupard
37f3977e6d
Rely on border-width for <hr> size (#35491)
* fix(reboot): revert hr styles to v4 implementation

* docs(cheatsheet): add a hr example

* fix(reboot): currentColor is the initial border-color value

* Document hr element in Reboot docs

* Update migration guide

* Update scss/_variables.scss

Co-authored-by: Mark Otto <markd.otto@gmail.com>
2022-02-22 10:02:47 +02:00
XhmikosR
ae12d645ef
Replace AnchorJS with a Hugo render hook (#32953)
* Replace AnchorJS with a Hugo render hook

* docs(anchors): improve aria-label on anchor links

* docs(anchors): show anchor link when ed

* docs(anchors): add hash in pseudo-element

Co-authored-by: Gaël Poupard <ffoodd@users.noreply.github.com>
2022-02-19 15:16:23 +02:00
Mark Otto
3e6265ac55 Rewrite custom docs buttons
- Use CSS variables wherever possible
- Rename purple-bright to violet for brevity, add CSS vars versions
- Rename download to accent
2022-02-14 19:00:59 -08:00
Mark Otto
ef9d8538a0 Convert .btn and mixins to use CSS variables 2022-02-14 19:00:59 -08:00
GeoSot
96c67a7ff7
Fix empty content of tooltip after 'copy' action in docs (#35773)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2022-02-07 10:05:43 +02:00
XhmikosR
9680e17456
Bump copyright year to 2022 (#35639) 2022-01-03 15:03:42 +02:00
Florian Lacreuse
d17801265e
Add sticky bottom utility (#35518)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-12-16 10:27:00 +02:00
XhmikosR
8cdb6c40bd
Update stylelint and stylelint-config-twbs-bootstrap (#35438) 2021-12-14 09:51:31 +02:00
Mark Otto
a780d74b28
Docs offcanvas navbar (#34487)
* Redesign docs navbar to use offcanvas, tweak overall padding while I'm here

* Match code snippets to new gutter width

* Replace value with docs-specific variable

Opted not to do a CSS variable here since on .bd-content it would be inherited into our examples

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-12-03 10:08:01 +02:00
GeoSot
94a596fbcb
Add a template factory helper to handle all template cases (#34519)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-11-25 19:14:02 +02:00
XhmikosR
c5d03d93fc
Rename e to event (#34979) 2021-09-15 14:27:46 +03:00
XhmikosR
9e1d81a851
Progress page: remove toggle animation button (#34787)
We don't use the same approach with a button on the Placeholders page.
2021-08-21 06:54:53 +03:00
Jaume Sala
39b7c75b13
Add new placeholder component (#31859)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Jaume Sala <jaumesala@gmail.com>
Co-authored-by: Mark Otto <markdotto@gmail.com>
Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
2021-08-03 08:59:00 -07:00
Mark Otto
696996dd4f
Add dynamic, live alerts example to docs (#33866) 2021-06-29 18:46:25 +03:00
Mark Otto
dd824f2d3e
v5.1: Add optional CSS grid (#31813) 2021-06-22 19:51:16 -07:00
Mark Otto
be17444756
Replace / division with multiplication and custom divide() function (#34245)
* Convert bulk of division to multiplication

* Use custom divide() function instead of Dart Sass math module for greater compatibility

* Apply suggestions from code review

* Fix functions
2021-06-14 09:35:30 -07:00
Julien Déramond
e9da490e51
docs(style): fix display of nested <ul><li> (#34223) 2021-06-14 08:45:13 +03:00
Mark Otto
48ae5a7149
Rewrite migration guide (#33834)
- De-duplicates bulk of the content for a migration from v4 to v5
- Adds clear breaking labels where appropriate
- Leaves room for more guidance around doing the actual migration
2021-05-05 18:24:26 +03:00
XhmikosR
df8131a1f8
Update anchor.js to v4.3.1. (#33668) 2021-04-19 07:52:09 +03:00
XhmikosR
c864852135
docs: update clipboard.js to v2.0.8 (#33583) 2021-04-09 07:53:01 +03:00
Mark Otto
a398c500b8 Revert "Update look and feel of examples and copy buttons"
This reverts commit cdf56e0eef.
2021-04-06 21:03:27 -07:00
Mark Otto
cdf56e0eef Update look and feel of examples and copy buttons 2021-04-04 20:21:17 -07:00
Mark Otto
6e7f1a9a34
Add new docs footer (#33453)
* Replace site footer with mega footer to link to various projects and community resources

* Fix broken HTML
2021-03-30 23:08:04 -07:00
Mark Otto
232e392c91
Make offcanvas example fully static (#33446) 2021-03-23 19:06:11 +02:00
GeoSot
1c02ef4f97
Allow offcanvas to be initialized in open state (#33382)
* Update docs to use new .show behavior and clarify some copy for first example

Co-authored-by: Mark Otto <markdotto@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-03-23 08:22:59 +02:00
GeoSot
548be2ed66
Offcanvas as component (#29017)
* Add a new offcanvas component

* offcanvas.js: switch to string constants and `event.key`

* Remove unneeded code

* Sass optimizations

* Fixes

Make sure the element is hidden and not offscreen when inactive
fix close icon negative margins
Add content in right & bottom examples
Re-fix bottom offcanvas height not to cover all viewport

* Wording tweaks

* update tests and offcanvas class

* separate scrollbar functionality and use it in offcanvas

* Update .bundlewatch.config.json

* fix focus

* update btn-close / fix focus on close

* add aria-modal and role
return focus on trigger when offcanvas is closed
change body scrolling timings

* move common code to reusable functions

* add aria-labelledby

* Replace lorem ipsum text

* fix focus when offcanvas is closed

* updates

* revert modal, add tests for scrollbar

* show backdrop by default

* Update offcanvas.md

* Update offcanvas CSS to better match modals

- Add background-clip for borders
- Move from outline to border (less clever, more consistent)
- Add scss-docs in vars

* Revamp offcanvas docs

- Add static example to show and explain the components
- Split live examples and rename them
- Simplify example content
- Expand docs notes elsewhere
- Add sass docs

* Add .offcanvas-title instead of .modal-title

* Rename offcanvas example to offcanvas-navbar to reflect it's purpose

* labelledby references title and not header

* Add default shadow to offcanvas

* enable offcanvas-body to fill all the remaining wrapper area

* Be more descriptive, on Accessibility area

* remove redundant classes

* ensure in case of an already open offcanvas, not to open another one

* bring back backdrop|scroll combinations

* bring back toggling class

* refactor scrollbar method, plus tests

* add check if element is not full-width, according to #30621

* revert all in modal

* use documentElement innerWidth

* Rename classes to -start and -end

Also copyedit some docs wording

* omit some things on scrollbar

* PASS BrowserStack tests

-- IOS devices, Android devices and Browsers on Mac, hide scrollbar by default and appear it, only while scrolling.

* Rename '_handleClosing' to '_addEventListeners'

* change pipe usage to comma

* change Data.getData to Data.get

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Martijn Cuppens <martijn.cuppens@gmail.com>
Co-authored-by: Mark Otto <markdotto@gmail.com>
2021-03-02 19:10:10 +02:00
Gaël Poupard
2bb42a9176
docs(scroll offset): improve a11y for sticky header (#33027)
Our current trick works great for headings or landmarks `:target`ed by links activation, however it still allows focus to be hidden under the sticky header. 

1. Go to any docs page, 
2. use a TOC link to scroll down the page, 
3. then `Shift`+`Tab` to navigate backward using keyboard. 

You should see on some browsers (mainly Firefox from my tests, but it used to do the same in Chrome) that focused elements isn't visible, hidden by our sticky header.

Applying `scroll-padding-top` to the `:root` solves this without any side-effect—but it requires to drop `scroll-margin-top` for anchors to prevent doubling the offset.

FWIW based on my test, Edgium and Chromium don't really care since they seem to have a new heuristic for such cases, making the focused element scroll to the center of the view.
2021-02-10 07:27:43 +02:00
Mark Otto
4167c107f8
Add a live toast example to the docs (#32760) 2021-01-18 15:10:01 +02:00
XhmikosR
f95004f654
Revert "docs: Fix popover example showing above navbar (#32445)" (#32533)
This reverts commit 517446069a.
2021-01-13 22:51:39 +02:00
XhmikosR
f2c504397e
Bump copyright year to 2021 (#32713) 2021-01-07 12:12:53 +02:00