From 538f50be5a7c5f9f94c2eb25bf2e15270159df51 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 22 Oct 2022 16:51:44 -0400 Subject: Home imports (#37318) * Update docs homepage to use separate partials for each section Also modifies the homepage code snippets under getting started to remove the code comments, making copy-pasting easier. * Update some copy and examples * newlines * type button * more code review, bring back interactive components * fix hover --- site/assets/scss/_masthead.scss | 10 + site/layouts/_default/home.html | 10 +- .../partials/home/components-utilities.html | 88 +++++ site/layouts/partials/home/css-variables.html | 48 +++ site/layouts/partials/home/customize.html | 58 ++++ site/layouts/partials/home/get-started.html | 58 ++++ site/layouts/partials/home/icons.html | 23 ++ site/layouts/partials/home/masthead-followup.html | 356 --------------------- site/layouts/partials/home/plugins.html | 65 ++++ site/layouts/partials/home/themes.html | 23 ++ 10 files changed, 382 insertions(+), 357 deletions(-) create mode 100644 site/layouts/partials/home/components-utilities.html create mode 100644 site/layouts/partials/home/css-variables.html create mode 100644 site/layouts/partials/home/customize.html create mode 100644 site/layouts/partials/home/get-started.html create mode 100644 site/layouts/partials/home/icons.html delete mode 100644 site/layouts/partials/home/masthead-followup.html create mode 100644 site/layouts/partials/home/plugins.html create mode 100644 site/layouts/partials/home/themes.html diff --git a/site/assets/scss/_masthead.scss b/site/assets/scss/_masthead.scss index 81d4d998cb..6a1d34de47 100644 --- a/site/assets/scss/_masthead.scss +++ b/site/assets/scss/_masthead.scss @@ -94,3 +94,13 @@ background-color: var(--bd-accent); box-shadow: inset 0 -1px 1px rgba(var(--bs-body-color-rgb), .15), 0 .25rem 1.5rem rgba(var(--bs-body-bg-rgb), .75); } + +.animate-img { + > img { + transition: .2s ease-in-out transform; // stylelint-disable-line property-disallowed-list + } + + &:hover > img { + transform: scale(1.1); + } +} diff --git a/site/layouts/_default/home.html b/site/layouts/_default/home.html index 28bcf0c64d..878e77474e 100644 --- a/site/layouts/_default/home.html +++ b/site/layouts/_default/home.html @@ -1,7 +1,15 @@ {{ define "main" }}
{{ partial "home/masthead" . }} - {{ partial "home/masthead-followup" . }} +
+ {{ partial "home/get-started" . }} + {{ partial "home/customize" . }} + {{ partial "home/css-variables" . }} + {{ partial "home/components-utilities" . }} + {{ partial "home/plugins" . }} + {{ partial "home/icons" . }} + {{ partial "home/themes" . }} +
{{ .Content }} diff --git a/site/layouts/partials/home/components-utilities.html b/site/layouts/partials/home/components-utilities.html new file mode 100644 index 0000000000..6806a24b7b --- /dev/null +++ b/site/layouts/partials/home/components-utilities.html @@ -0,0 +1,88 @@ +
+
+
+ +
+ +
+ +
+

Components, meet the Utility API

+

+ New in Bootstrap 5, our utilities are now generated by our Utility API. We built it as a feature-packed Sass map that can be quickly and easily customized. It's never been easier to add, remove, or modify any utility classes. Make utilities responsive, add pseudo-class variants, and give them custom names. +

+
+
+
+

Quickly customize components

+

Apply any of our included utility classes to our components to customize their appearance, like the navigation example below. There are hundreds of classes available—from positioning and sizing to colors and effects. Mix them with CSS variable overrides for even more control.

+
+ + +
+{{ highlight (printf ` +`) "html" "" }} +

+ + Explore customized components + + +

+
+
+

Create and extend utilities

+

Use Bootstrap's utility API to modify any of our included utilities or create your own custom utilities for any project. Import Bootstrap first, then use Sass map functions to modify, add, or remove utilities.

+{{ highlight (printf `@import "bootstrap/scss/bootstrap"; + +$utilities: map-merge( + $utilities, + ( + "cursor": ( + property: cursor, + class: cursor, + responsive: true, + values: auto pointer grab, + ) + ) +); +`) "scss" "" }} + +

+ + Explore the utility API + + +

+
+
+
diff --git a/site/layouts/partials/home/css-variables.html b/site/layouts/partials/home/css-variables.html new file mode 100644 index 0000000000..3006947496 --- /dev/null +++ b/site/layouts/partials/home/css-variables.html @@ -0,0 +1,48 @@ +
+
+
+ +
+

Build and extend in real-time with CSS variables

+

+ Bootstrap 5 is evolving with each release to better utilize CSS variables for global theme styles, individual components, and even utilities. We provide dozens of variables for colors, font styles, and more at a :root level for use anywhere. On components and utilities, CSS variables are scoped to the relevant class and can easily be modified. +

+

+ + Learn more about CSS variables + + +

+
+
+
+

Using CSS variables

+

Use any of our global :root variables to write new styles. CSS variables use the var(--bs-variableName) syntax and can be inherited by children elements.

+ {{ highlight (printf `.component { + color: var(--bs-gray-800); + background-color: var(--bs-gray-100); + border: 1px solid var(--bs-gray-200); + border-radius: .25rem; +} + +.component-header { + color: var(--bs-purple); +}`) "scss" "" }} +
+
+

Customizing via CSS variables

+

Override global, component, or utility class variables to customize Bootstrap just how you like. No need to redeclare each rule, just a new variable value.

+ {{ highlight (printf `body { + --bs-body-font-family: var(--bs-font-monospace); + --bs-body-line-height: 1.4; + --bs-body-bg: var(--bs-gray-100); +} + +.table { + --bs-table-color: var(--bs-gray-600); + --bs-table-bg: var(--bs-gray-100); + --bs-table-border-color: transparent; +}`) "scss" "" }} +
+
+
diff --git a/site/layouts/partials/home/customize.html b/site/layouts/partials/home/customize.html new file mode 100644 index 0000000000..365b524c44 --- /dev/null +++ b/site/layouts/partials/home/customize.html @@ -0,0 +1,58 @@ +
+
+ +
+

Customize everything with Sass

+

+ Bootstrap utilizes Sass for a modular and customizable architecture. Import only the components you need, enable global options like gradients and shadows, and write your own CSS with our variables, maps, functions, and mixins. +

+

+ + Learn more about customizing + + +

+
+ +
+
+

Include all of Bootstrap’s Sass

+

Import one stylesheet and you're off to the races with every feature of our CSS.

+ {{ highlight (printf `// Variable overrides first +$primary: #900; +$enable-shadows: true; +$prefix: "mo-"; + +// Then import Bootstrap +@import "../node_modules/bootstrap/scss/bootstrap"; +`) "scss" "" }} +

Learn more about our global Sass options.

+
+
+

Include what you need

+

The easiest way to customize Bootstrap—include only the CSS you need.

+{{ highlight (printf `// Functions first +@import "../node_modules/bootstrap/scss/functions"; + +// Variable overrides second +$primary: #900; +$enable-shadows: true; +$prefix: "mo-"; + +// Required Bootstrap imports +@import "../node_modules/bootstrap/scss/variables"; +@import "../node_modules/bootstrap/scss/maps"; +@import "../node_modules/bootstrap/scss/mixins"; +@import "../node_modules/bootstrap/scss/root"; + +// Optional components +@import "../node_modules/bootstrap/scss/utilities"; +@import "../node_modules/bootstrap/scss/reboot"; +@import "../node_modules/bootstrap/scss/containers"; +@import "../node_modules/bootstrap/scss/grid"; +@import "../node_modules/bootstrap/scss/helpers"; +@import "../node_modules/bootstrap/scss/utilities/api"; +`) "scss" "" }} +

Learn more about using Bootstrap with Sass.

+
+
diff --git a/site/layouts/partials/home/get-started.html b/site/layouts/partials/home/get-started.html new file mode 100644 index 0000000000..2c3270450f --- /dev/null +++ b/site/layouts/partials/home/get-started.html @@ -0,0 +1,58 @@ +
+
+ +
+

Get started any way you want

+

+ Jump right into building with Bootstrap—use the CDN, install it via package manager, or download the source code. +

+

+ + Read installation docs + + +

+
+ +
+
+ +

Install via package manager

+

+ Install Bootstrap’s source Sass and JavaScript files via npm, RubyGems, Composer, or Meteor. Package managed installs don’t include documentation or our full build scripts. You can also use our npm template repo to quickly generate a Bootstrap project via npm. +

+ {{ highlight (printf ("npm install bootstrap@%s") .Site.Params.current_version) "sh" "" }} + {{ highlight (printf ("gem install bootstrap -v %s") .Site.Params.current_ruby_version) "sh" "" }} +

+ Read our installation docs for more info and additional package managers. +

+
+
+ +

Include via CDN

+

+ When you only need to include Bootstrap’s compiled CSS or JS, you can use jsDelivr. See it in action with our simple quick start, or browse the examples to jumpstart your next project. You can also choose to include Popper and our JS separately. +

+ {{ highlight (printf (``) .Site.Params.cdn.css (.Site.Params.cdn.css_hash | safeHTMLAttr)) "html" "" }} + {{ highlight (printf (``) .Site.Params.cdn.js_bundle (.Site.Params.cdn.js_bundle_hash | safeHTMLAttr)) "html" "" }} +
+ +
+

Read our getting started guides

+

Get a jump on including Bootstrap's source files in a new project with our official guides.

+ +
+
diff --git a/site/layouts/partials/home/icons.html b/site/layouts/partials/home/icons.html new file mode 100644 index 0000000000..c6219b072e --- /dev/null +++ b/site/layouts/partials/home/icons.html @@ -0,0 +1,23 @@ +
+
+
+ {{ partial "icons/circle-square.svg" (dict "width" "32" "height" "32") }} +
+

Personalize it with Bootstrap Icons

+

+ Bootstrap Icons is an open source SVG icon library featuring over 1,800 glyphs, with more added every release. They're designed to work in any project, whether you use Bootstrap itself or not. Use them as SVGs or icon fonts—both options give you vector scaling and easy customization via CSS. +

+

+ + Get Bootstrap Icons + + +

+
+
+ Bootstrap Icons +
+
diff --git a/site/layouts/partials/home/masthead-followup.html b/site/layouts/partials/home/masthead-followup.html deleted file mode 100644 index 58c9fb65f2..0000000000 --- a/site/layouts/partials/home/masthead-followup.html +++ /dev/null @@ -1,356 +0,0 @@ -
-
-
- -
-

Get started any way you want

-

- Jump right into building with Bootstrap—use the CDN, install it via package manager, or download the source code. -

-

- - Read installation docs - - -

-
- -
-
- -

Install via package manager

-

- Install Bootstrap’s source Sass and JavaScript files via npm, RubyGems, Composer, or Meteor. Package managed installs don’t include documentation or our full build scripts. You can also use our npm template repo to quickly generate a Bootstrap project via npm. -

- {{ highlight (printf ("npm install bootstrap@%s") .Site.Params.current_version) "sh" "" }} - {{ highlight (printf ("gem install bootstrap -v %s") .Site.Params.current_ruby_version) "sh" "" }} -

- Read our installation docs for more info and additional package managers. -

-
-
- -

Include via CDN

-

- When you only need to include Bootstrap’s compiled CSS or JS, you can use jsDelivr. See it in action with our simple quick start, or browse the examples to jumpstart your next project. You can also choose to include Popper and our JS separately. -

- {{ highlight (printf (` - -`) .Site.Params.cdn.css (.Site.Params.cdn.css_hash | safeHTMLAttr)) "html" "" }} - {{ highlight (printf (` - -`) .Site.Params.cdn.js_bundle (.Site.Params.cdn.js_bundle_hash | safeHTMLAttr)) "html" "" }} -
- -
-

Read our getting started guides

-

Get a jump on including Bootstrap's source files in a new project with our official guides.

- -
-
- -
-
- -
-

Customize everything with Sass

-

- Bootstrap utilizes Sass for a modular and customizable architecture. Import only the components you need, enable global options like gradients and shadows, and write your own CSS with our variables, maps, functions, and mixins. -

-

- - Learn more about customizing - - -

-
- -
-
-

Include all of Bootstrap’s Sass

-

Import one stylesheet and you're off to the races with every feature of our CSS.

- {{ highlight (printf `// Variable overrides first -$primary: #900; -$enable-shadows: true; -$prefix: "mo-"; - -// Then import Bootstrap -@import "../node_modules/bootstrap/scss/bootstrap"; -`) "scss" "" }} -

Learn more about our global Sass options.

-
-
-

Include what you need

-

The easiest way to customize Bootstrap—include only the CSS you need.

-{{ highlight (printf `// Functions first -@import "../node_modules/bootstrap/scss/functions"; - -// Variable overrides second -$primary: #900; -$enable-shadows: true; -$prefix: "mo-"; - -// Required Bootstrap imports -@import "../node_modules/bootstrap/scss/variables"; -@import "../node_modules/bootstrap/scss/maps"; -@import "../node_modules/bootstrap/scss/mixins"; -@import "../node_modules/bootstrap/scss/root"; - -// Optional components -@import "../node_modules/bootstrap/scss/utilities"; -@import "../node_modules/bootstrap/scss/reboot"; -@import "../node_modules/bootstrap/scss/containers"; -@import "../node_modules/bootstrap/scss/grid"; -@import "../node_modules/bootstrap/scss/helpers"; -@import "../node_modules/bootstrap/scss/utilities/api"; -`) "scss" "" }} -

Learn more about using Bootstrap with Sass.

-
-
- -
-
-
- -
-

Build and extend in real-time with CSS variables

-

- Bootstrap 5 is evolving with each release to better utilize CSS variables for global theme styles, individual components, and even utilities. We provide dozens of variables for colors, font styles, and more at a :root level for use anywhere. On components and utilities, CSS variables are scoped to the relevant class and can easily be modified. -

-

- - Learn more about CSS variables - - -

-
-
-
-

Using CSS variables

-

Use any of our global :root variables to write new styles. CSS variables use the var(--bs-variableName) syntax and can be inherited by children elements.

- {{ highlight (printf `.component { - color: var(--bs-gray-800); - background-color: var(--bs-gray-100); - border: 1px solid var(--bs-gray-200); - border-radius: .25rem; -} - -.component-header { - color: var(--bs-purple); -}`) "scss" "" }} -
-
-

Customizing via CSS variables

-

Override global, component, or utility class variables to customize Bootstrap just how you like. No need to redeclare each rule, just a new variable value.

- {{ highlight (printf `body { - --bs-body-font-family: var(--bs-font-monospace); - --bs-body-line-height: 1.4; - --bs-body-bg: var(--bs-gray-100); -} - -.table { - --bs-table-color: var(--bs-gray-600); - --bs-table-bg: var(--bs-gray-100); - --bs-table-border-color: transparent; -}`) "scss" "" }} -
-
-
- -
-
-
- -
- -
- -
-

Components, meet the Utility API

-

- New in Bootstrap 5, our utilities are now generated by our Utility API. We built it as a feature-packed Sass map that can be quickly and easily customized. It's never been easier to add, remove, or modify any utility classes. Make utilities responsive, add pseudo-class variants, and give them custom names. -

-

- - Learn more about utilities - - - - Explore customized components - - -

-
-
-
-
Quickly customize components
-
- - -
- {{ highlight (printf `// Create and extend utilities with the Utility API - -@import "bootstrap/scss/bootstrap"; - -$utilities: map-merge( - $utilities, - ( - "cursor": ( - property: cursor, - class: cursor, - responsive: true, - values: auto pointer grab, - ) - ) -); -`) "scss" "" }} -
-
- -
-
-
- -
-

Powerful JavaScript plugins without jQuery

-

- Easily add toggleable hidden elements, modals and offcanvas menus, popovers and tooltips, and so much more—all without jQuery. JavaScript in Bootstrap is HTML-first, which means adding plugins is as easy as adding data attributes. Need more control? Include individual plugins programmatically. -

-

- - Learn more about Bootstrap JavaScript - - -

-
-
-
-

Data attribute API

-

Why write more JavaScript when you can write HTML? Nearly all of Bootstrap's JavaScript plugins feature a first-class data API, allowing you to use JavaScript just by adding data attributes.

-
- -
- - {{ highlight (printf ` -`) "html" "" }} -

Learn more about our JavaScript as modules and using the programmatic API.

-
-
-

Comprehensive set of plugins

-

Bootstrap features a dozen plugins that you can drop into any project. Drop them in all at once, or choose just the ones you need.

-
-
- {{- range $plugin := .Site.Data.plugins -}} - {{- $href := printf "/docs/%s/%s" $.Site.Params.docs_version $plugin.link }} - - {{- end }} -
-
-
- -
- -
-
-
- {{ partial "icons/circle-square.svg" (dict "width" "32" "height" "32") }} -
-

Personalize it with Bootstrap Icons

-

- Bootstrap Icons is an open source SVG icon library featuring over 1,500 glyphs, with more added every release. They're designed to work in any project, whether you use Bootstrap itself or not. Use them as SVGs or icon fonts—both options give you vector scaling and easy customization via CSS. -

-

- - Get Bootstrap Icons - - -

-
-
- Bootstrap Icons -
-
- -
-
-
- {{ partial "icons/droplet-fill.svg" (dict "width" "32" "height" "32") }} -
-

Make it yours with official Bootstrap Themes

-

- Take Bootstrap to the next level with premium themes from the official Bootstrap Themes marketplace. Themes are built on Bootstrap as their own extended frameworks, rich with new components and plugins, documentation, and powerful build tools. -

-

- - Browse Bootstrap Themes - - -

-
-
- Bootstrap Themes -
-
-
diff --git a/site/layouts/partials/home/plugins.html b/site/layouts/partials/home/plugins.html new file mode 100644 index 0000000000..b76fe65399 --- /dev/null +++ b/site/layouts/partials/home/plugins.html @@ -0,0 +1,65 @@ +
+
+
+ +
+

Powerful JavaScript plugins without jQuery

+

+ Add toggleable hidden elements, modals and offcanvas menus, popovers and tooltips, and so much more—all without jQuery. Bootstrap's JavaScript is HTML-first, meaning most plugins are added with data attributes in your HTML. Need more control? Include individual plugins programmatically. +

+

+ + Learn more about Bootstrap JavaScript + + +

+
+
+
+

Data attribute API

+

Why write more JavaScript when you can write HTML? Nearly all of Bootstrap's JavaScript plugins feature a first-class data API, allowing you to use JavaScript just by adding data attributes.

+
+ +
+ + {{ highlight (printf ` +`) "html" "" }} +

Learn more about our JavaScript as modules and using the programmatic API.

+
+
+

Comprehensive set of plugins

+

Bootstrap features a dozen plugins that you can drop into any project. Drop them in all at once, or choose just the ones you need.

+
+
+ {{- range $plugin := .Site.Data.plugins -}} + {{- $href := printf "/docs/%s/%s" $.Site.Params.docs_version $plugin.link }} + + {{- end }} +
+
+
+ +
diff --git a/site/layouts/partials/home/themes.html b/site/layouts/partials/home/themes.html new file mode 100644 index 0000000000..e832f2c637 --- /dev/null +++ b/site/layouts/partials/home/themes.html @@ -0,0 +1,23 @@ +
+
+
+ {{ partial "icons/droplet-fill.svg" (dict "width" "32" "height" "32") }} +
+

Make it yours with official Bootstrap Themes

+

+ Take Bootstrap to the next level with premium themes from the official Bootstrap Themes marketplace. Themes are built on Bootstrap as their own extended frameworks, rich with new components and plugins, documentation, and powerful build tools. +

+

+ + Browse Bootstrap Themes + + +

+
+
+ Bootstrap Themes +
+
-- cgit v1.2.3