diff --git a/.babelrc.js b/.babelrc.js new file mode 100644 index 000000000000..51399697f4e5 --- /dev/null +++ b/.babelrc.js @@ -0,0 +1,12 @@ +module.exports = { + presets: [ + [ + '@babel/preset-env', + { + loose: true, + bugfixes: true, + modules: false + } + ] + ] +}; diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 000000000000..cddd23005246 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,12 @@ +# https://github.com/browserslist/browserslist#readme + +>= 0.5% +last 2 major versions +not dead +Chrome >= 60 +Firefox >= 60 +Firefox ESR +iOS >= 12 +Safari >= 12 +not Explorer <= 11 +not kaios <= 2.5 # fix floating label issues in Firefox (see https://github.com/postcss/autoprefixer/issues/1533) diff --git a/.bundlewatch.config.json b/.bundlewatch.config.json new file mode 100644 index 000000000000..6f680664ca67 --- /dev/null +++ b/.bundlewatch.config.json @@ -0,0 +1,66 @@ +{ + "files": [ + { + "path": "./dist/css/bootstrap-grid.css", + "maxSize": "6.5 kB" + }, + { + "path": "./dist/css/bootstrap-grid.min.css", + "maxSize": "6.0 kB" + }, + { + "path": "./dist/css/bootstrap-reboot.css", + "maxSize": "3.5 kB" + }, + { + "path": "./dist/css/bootstrap-reboot.min.css", + "maxSize": "3.25 kB" + }, + { + "path": "./dist/css/bootstrap-utilities.css", + "maxSize": "11.75 kB" + }, + { + "path": "./dist/css/bootstrap-utilities.min.css", + "maxSize": "10.75 kB" + }, + { + "path": "./dist/css/bootstrap.css", + "maxSize": "32.5 kB" + }, + { + "path": "./dist/css/bootstrap.min.css", + "maxSize": "30.25 kB" + }, + { + "path": "./dist/js/bootstrap.bundle.js", + "maxSize": "43.0 kB" + }, + { + "path": "./dist/js/bootstrap.bundle.min.js", + "maxSize": "23.5 kB" + }, + { + "path": "./dist/js/bootstrap.esm.js", + "maxSize": "28.0 kB" + }, + { + "path": "./dist/js/bootstrap.esm.min.js", + "maxSize": "18.25 kB" + }, + { + "path": "./dist/js/bootstrap.js", + "maxSize": "28.75 kB" + }, + { + "path": "./dist/js/bootstrap.min.js", + "maxSize": "16.25 kB" + } + ], + "ci": { + "trackBranches": [ + "main", + "v4-dev" + ] + } +} diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 000000000000..d2434c30a608 --- /dev/null +++ b/.cspell.json @@ -0,0 +1,131 @@ +{ + "version": "0.2", + "words": [ + "affordance", + "allowfullscreen", + "Analyser", + "autohide", + "autohiding", + "autoplay", + "autoplays", + "autoplaying", + "blazingly", + "Blockquotes", + "Bootstrappers", + "borderless", + "Brotli", + "browserslist", + "browserslistrc", + "btncheck", + "btnradio", + "callout", + "callouts", + "camelCase", + "clearfix", + "Codesniffer", + "combinator", + "Contentful", + "Cpath", + "Crossfade", + "crossfading", + "cssgrid", + "Csvg", + "Datalists", + "Deque", + "discoverability", + "docsearch", + "docsref", + "dropend", + "dropleft", + "dropright", + "dropstart", + "dropup", + "dgst", + "errorf", + "favicon", + "favicons", + "fieldsets", + "flexbox", + "fullscreen", + "getbootstrap", + "Grayscale", + "Hoverable", + "hreflang", + "hstack", + "importmap", + "jsdelivr", + "Jumpstart", + "keyframes", + "libera", + "libman", + "Libsass", + "lightboxes", + "Lowercased", + "markdownify", + "mediaqueries", + "minifiers", + "misfunction", + "mkdir", + "monospace", + "mouseleave", + "navbars", + "navs", + "Neue", + "noindex", + "Noto", + "offcanvas", + "offcanvases", + "Packagist", + "popperjs", + "prebuild", + "prefersreducedmotion", + "prepended", + "printf", + "rects", + "relref", + "rgba", + "roboto", + "RTLCSS", + "ruleset", + "sassrc", + "screenreaders", + "scrollbars", + "scrollspy", + "Segoe", + "semibold", + "socio", + "srcset", + "stackblitz", + "stickied", + "Stylelint", + "subnav", + "tabbable", + "textareas", + "toggleable", + "topbar", + "touchend", + "twbs", + "unitless", + "unstylable", + "unstyled", + "Uppercased", + "urlize", + "urlquery", + "vbtn", + "viewports", + "Vite", + "vstack", + "walkthroughs", + "WCAG", + "zindex" + ], + "language": "en-US", + "ignorePaths": [ + ".cspell.json", + "dist/", + "*.min.*", + "**/*rtl*", + "**/tests/**" + ], + "useGitignore": true +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000000..f29d257cc590 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +# editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000000..e42161487a5b --- /dev/null +++ b/.eslintignore @@ -0,0 +1,9 @@ +**/*.min.js +**/dist/ +**/vendor/ +/_site/ +/site/public/ +/js/coverage/ +/site/static/sw.js +/site/static/docs/**/assets/sw.js +/site/layouts/partials/ diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000000..da686166f5a8 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,241 @@ +{ + "root": true, + "extends": [ + "plugin:import/errors", + "plugin:import/warnings", + "plugin:unicorn/recommended", + "xo", + "xo/browser" + ], + "rules": { + "arrow-body-style": "off", + "capitalized-comments": "off", + "comma-dangle": [ + "error", + "never" + ], + "import/extensions": [ + "error", + "ignorePackages", + { + "js": "always" + } + ], + "import/first": "error", + "import/newline-after-import": "error", + "import/no-absolute-path": "error", + "import/no-amd": "error", + "import/no-cycle": [ + "error", + { + "ignoreExternal": true + } + ], + "import/no-duplicates": "error", + "import/no-extraneous-dependencies": "error", + "import/no-mutable-exports": "error", + "import/no-named-as-default": "error", + "import/no-named-as-default-member": "error", + "import/no-named-default": "error", + "import/no-self-import": "error", + "import/no-unassigned-import": [ + "error" + ], + "import/no-useless-path-segments": "error", + "import/order": "error", + "indent": [ + "error", + 2, + { + "MemberExpression": "off", + "SwitchCase": 1 + } + ], + "logical-assignment-operators": "off", + "max-params": [ + "warn", + 5 + ], + "multiline-ternary": [ + "error", + "always-multiline" + ], + "new-cap": [ + "error", + { + "properties": false + } + ], + "no-console": "error", + "no-negated-condition": "off", + "object-curly-spacing": [ + "error", + "always" + ], + "operator-linebreak": [ + "error", + "after" + ], + "prefer-object-has-own": "off", + "prefer-template": "error", + "semi": [ + "error", + "never" + ], + "strict": "error", + "unicorn/explicit-length-check": "off", + "unicorn/filename-case": "off", + "unicorn/no-anonymous-default-export": "off", + "unicorn/no-array-callback-reference": "off", + "unicorn/no-array-method-this-argument": "off", + "unicorn/no-null": "off", + "unicorn/no-typeof-undefined": "off", + "unicorn/no-unused-properties": "error", + "unicorn/numeric-separators-style": "off", + "unicorn/prefer-array-flat": "off", + "unicorn/prefer-at": "off", + "unicorn/prefer-dom-node-dataset": "off", + "unicorn/prefer-global-this": "off", + "unicorn/prefer-module": "off", + "unicorn/prefer-query-selector": "off", + "unicorn/prefer-spread": "off", + "unicorn/prefer-string-raw": "off", + "unicorn/prefer-string-replace-all": "off", + "unicorn/prefer-structured-clone": "off", + "unicorn/prevent-abbreviations": "off" + }, + "overrides": [ + { + "files": [ + "build/**" + ], + "env": { + "browser": false, + "node": true + }, + "parserOptions": { + "sourceType": "module" + }, + "rules": { + "no-console": "off", + "unicorn/prefer-top-level-await": "off" + } + }, + { + "files": [ + "js/**" + ], + "parserOptions": { + "sourceType": "module" + } + }, + { + "files": [ + "js/tests/*.js", + "js/tests/integration/rollup*.js" + ], + "env": { + "node": true + }, + "parserOptions": { + "sourceType": "script" + } + }, + { + "files": [ + "js/tests/unit/**" + ], + "env": { + "jasmine": true + }, + "rules": { + "no-console": "off", + "unicorn/consistent-function-scoping": "off", + "unicorn/no-useless-undefined": "off", + "unicorn/prefer-add-event-listener": "off" + } + }, + { + "files": [ + "js/tests/visual/**" + ], + "plugins": [ + "html" + ], + "settings": { + "html/html-extensions": [ + ".html" + ] + }, + "rules": { + "no-console": "off", + "no-new": "off", + "unicorn/no-array-for-each": "off" + } + }, + { + "files": [ + "scss/tests/**" + ], + "env": { + "node": true + }, + "parserOptions": { + "sourceType": "script" + } + }, + { + "files": [ + "site/**" + ], + "env": { + "browser": true, + "node": false + }, + "parserOptions": { + "sourceType": "script", + "ecmaVersion": 2019 + }, + "rules": { + "no-new": "off", + "unicorn/no-array-for-each": "off" + } + }, + { + "files": [ + "site/src/assets/application.js", + "site/src/assets/partials/*.js", + "site/src/assets/search.js", + "site/src/assets/snippets.js", + "site/src/assets/stackblitz.js", + "site/src/plugins/*.js" + ], + "parserOptions": { + "sourceType": "module", + "ecmaVersion": 2020 + } + }, + { + "files": [ + "**/*.md" + ], + "plugins": [ + "markdown" + ], + "processor": "markdown/markdown" + }, + { + "files": [ + "**/*.md/*.js", + "**/*.md/*.mjs" + ], + "extends": "plugin:markdown/recommended-legacy", + "parserOptions": { + "sourceType": "module" + }, + "rules": { + "unicorn/prefer-node-protocol": "off" + } + } + ] +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000000..40b1c37421a0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +# Enforce Unix newlines +* text=auto eol=lf + +# Don't diff or textually merge source maps +*.map binary + +bootstrap.css linguist-vendored=false +bootstrap.js linguist-vendored=false diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000000..7d3fa99046cc --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +*.js @twbs/js-review +*.css @twbs/css-review +*.scss @twbs/css-review diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 000000000000..a37b01210b5c --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,258 @@ +# Contributing to Bootstrap + +Looking to contribute something to Bootstrap? **Here’s how you can help.** + +Please take a moment to review this document in order to make the contribution +process easy and effective for everyone involved. + +Following these guidelines helps to communicate that you respect the time of +the developers managing and developing this open source project. In return, +they should reciprocate that respect in addressing your issue or assessing +patches and features. + + +## Using the issue tracker + +The [issue tracker](https://github.com/twbs/bootstrap/issues) is +the preferred channel for [bug reports](#bug-reports), [features requests](#feature-requests) +and [submitting pull requests](#pull-requests), but please respect the following +restrictions: + +- Please **do not** use the issue tracker for personal support requests. Stack Overflow ([`bootstrap-5`](https://stackoverflow.com/questions/tagged/bootstrap-5) tag), [our GitHub Discussions](https://github.com/twbs/bootstrap/discussions) or [IRC](/README.md#community) are better places to get help. + +- Please **do not** derail or troll issues. Keep the discussion on topic and + respect the opinions of others. + +- Please **do not** post comments consisting solely of "+1" or ":thumbsup:". + Use [GitHub's "reactions" feature](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) + instead. We reserve the right to delete comments which violate this rule. + +- Please **do not** open issues regarding the official themes offered on . + Instead, please email any questions or feedback regarding those themes to `themes AT getbootstrap DOT com`. + + +## Issues assignment + +The core team will be looking at the open issues, analyze them, and provide guidance on how to proceed. **Issues won’t be assigned to anyone outside the core team.** However, contributors are welcome to participate in the discussion and provide their input on how to best solve the issue, and even submit a PR if they want to. Please wait that the issue is ready to be worked on before submitting a PR, we don’t want to waste your time. + +Please keep in mind that the core team is small, has limited resources and that we are not always able to respond immediately. We will try to provide feedback as soon as possible, but please be patient. If you don’t get a response immediately, it doesn’t mean that we are ignoring you or that we don’t care about your issue or PR. We will get back to you as soon as we can. + + +## Issues and labels + +Our bug tracker utilizes several labels to help organize and identify issues. Here’s what they represent and how we use them: + +- `browser bug` - Issues that are reported to us, but actually are the result of a browser-specific bug. These are diagnosed with reduced test cases and result in an issue opened on that browser's own bug tracker. +- `confirmed` - Issues that have been confirmed with a reduced test case and identify a bug in Bootstrap. +- `css` - Issues stemming from our compiled CSS or source Sass files. +- `docs` - Issues for improving or updating our documentation. +- `examples` - Issues involving the example templates included in our docs. +- `feature` - Issues asking for a new feature to be added, or an existing one to be extended or modified. New features require a minor version bump (e.g., `v3.0.0` to `v3.1.0`). +- `build` - Issues with our build system, which is used to run all our tests, concatenate and compile source files, and more. +- `help wanted` - Issues we need or would love help from the community to resolve. +- `js` - Issues stemming from our compiled or source JavaScript files. +- `meta` - Issues with the project itself or our GitHub repository. + +For a complete look at our labels, see the [project labels page](https://github.com/twbs/bootstrap/labels). + + +## Bug reports + +A bug is a _demonstrable problem_ that is caused by the code in the repository. +Good bug reports are extremely helpful, so thanks! + +Guidelines for bug reports: + +0. **[Validate your HTML](https://html5.validator.nu/)** to ensure your + problem isn’t caused by a simple error in your own code. + +1. **Use the GitHub issue search** — check if the issue has already been + reported. + +2. **Check if the issue has been fixed** — try to reproduce it using the + latest `main` (or `v4-dev` branch if the issue is about v4) in the repository. + +3. **Isolate the problem** — ideally create a [reduced test + case](https://css-tricks.com/reduced-test-cases/) and a live example. + These [v4 CodePen](https://codepen.io/team/bootstrap/pen/yLabNQL) and [v5 CodePen](https://codepen.io/team/bootstrap/pen/qBamdLj) are helpful templates. + + +A good bug report shouldn’t leave others needing to chase you up for more +information. Please try to be as detailed as possible in your report. What is +your environment? What steps will reproduce the issue? What browser(s) and OS +experience the problem? Do other browsers show the bug differently? What +would you expect to be the outcome? All these details will help people to fix +any potential bugs. + +Example: + +> Short and descriptive example bug report title +> +> A summary of the issue and the browser/OS environment in which it occurs. If +> suitable, include the steps required to reproduce the bug. +> +> 1. This is the first step +> 2. This is the second step +> 3. Further steps, etc. +> +> `` - a link to the reduced test case +> +> Any other information you want to share that is relevant to the issue being +> reported. This might include the lines of code that you have identified as +> causing the bug, and potential solutions (and your opinions on their +> merits). + +### Reporting upstream browser bugs + +Sometimes bugs reported to us are actually caused by bugs in the browser(s) themselves, not bugs in Bootstrap per se. + +| Vendor(s) | Browser(s) | Rendering engine | Bug reporting website(s) | Notes | +| ------------- | ---------------------------- | ---------------- | ------------------------------------------------------ | -------------------------------------------------------- | +| Mozilla | Firefox | Gecko | | "Core" is normally the right product option to choose. | +| Apple | Safari | WebKit | | In Apple’s bug reporter, choose "Safari" as the product. | +| Google, Opera | Chrome, Chromium, Opera v15+ | Blink | | Click the "New issue" button. | +| Microsoft | Edge | Blink | | Go to "Help > Send Feedback" from the browser | + + +## Feature requests + +Feature requests are welcome. But take a moment to find out whether your idea +fits with the scope and aims of the project. It’s up to _you_ to make a strong +case to convince the project’s developers of the merits of this feature. Please +provide as much detail and context as possible. + + +## Pull requests + +Good pull requests—patches, improvements, new features—are a fantastic +help. They should remain focused in scope and avoid containing unrelated +commits. + +**Please ask first** before embarking on any **significant** pull request (e.g. +implementing features, refactoring code, porting to a different language), +otherwise you risk spending a lot of time working on something that the +project’s developers might not want to merge into the project. For trivial +things, or things that don’t require a lot of your time, you can go ahead and +make a PR. + +Please adhere to the [coding guidelines](#code-guidelines) used throughout the +project (indentation, accurate comments, etc.) and any other requirements +(such as test coverage). + +**Do not edit `bootstrap.css` or `bootstrap.js`, and do not commit +any dist files (`dist/` or `js/dist`).** Those files are automatically generated by our build tools. You should +edit the source files in [`/bootstrap/scss/`](https://github.com/twbs/bootstrap/tree/main/scss) +and/or [`/bootstrap/js/src/`](https://github.com/twbs/bootstrap/tree/main/js/src) instead. + +Similarly, when contributing to Bootstrap’s documentation, you should edit the +documentation source files in +[the `/bootstrap/site/content/docs/` directory of the `main` branch](https://github.com/twbs/bootstrap/tree/main/site/content/docs). +**Do not edit the `gh-pages` branch.** That branch is generated from the +documentation source files and is managed separately by the Bootstrap Core Team. + +Adhering to the following process is the best way to get your work +included in the project: + +1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, + and configure the remotes: + + ```bash + # Clone your fork of the repo into the current directory + git clone https://github.com//bootstrap.git + # Navigate to the newly cloned directory + cd bootstrap + # Assign the original repo to a remote called "upstream" + git remote add upstream https://github.com/twbs/bootstrap.git + ``` + +2. If you cloned a while ago, get the latest changes from upstream: + + ```bash + git checkout main + git pull upstream main + ``` + +3. Install or update project dependencies with npm: + + ```bash + npm install + ``` + +4. Create a new topic branch (off the main project development branch) to + contain your feature, change, or fix: + + ```bash + git checkout -b + ``` + +5. Commit your changes in logical chunks. Please adhere to these [git commit + message guidelines](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) + or your code is unlikely be merged into the main project. Use Git’s + [interactive rebase](https://help.github.com/articles/about-git-rebase/) + feature to tidy up your commits before making them public. + +6. Ensure your changes compile the dist CSS and JS files in the `dist/` directory. Verify + the build succeeds locally without errors. + + ```bash + npm run dist + ``` + +7. Locally merge (or rebase) the upstream development branch into your topic branch: + + ```bash + git pull [--rebase] upstream main + ``` + +8. Commit your changes, but **do not push compiled CSS and JS files in `dist` and `js/dist`**. + Push your topic branch up to your fork: + + ```bash + git push origin + ``` + +9. [Open a pull request](https://help.github.com/articles/about-pull-requests/) + with a clear title and description against the `main` branch. + +**IMPORTANT**: By submitting a patch, you agree to allow the project owners to +license your work under the terms of the [MIT License](../LICENSE) (if it +includes code changes) and under the terms of the +[Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/) +(if it includes documentation changes). + + +## Code guidelines + +### HTML + +[Adhere to the Code Guide.](https://codeguide.co/#html) + +- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags). +- Use CDNs and HTTPS for third-party JS when possible. We don’t use protocol-relative URLs in this case because they break when viewing the page locally via `file://`. +- Use [WAI-ARIA](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) attributes in documentation examples to promote accessibility. + +### CSS + +[Adhere to the Code Guide.](https://codeguide.co/#css) + +- When feasible, default color palettes should comply with [WCAG color contrast guidelines](https://www.w3.org/TR/WCAG/#distinguishable). +- Except in rare cases, don’t remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](https://www.a11yproject.com/posts/2013-01-25-never-remove-css-outlines/) for more details. + +### JS + +- No semicolons (in client-side JS) +- 2 spaces (no tabs) +- strict mode +- "Attractive" + +### Checking coding style + +Run `npm run test` before committing to ensure your changes follow our coding standards. + + +## License + +By contributing your code, you agree to license your contribution under the [MIT License](../LICENSE). +By contributing to the documentation, you agree to license your contribution under the [Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/). + +Prior to v3.1.0, Bootstrap’s code was released under the Apache License v2.0. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000000..3e3d6b9e55f7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,62 @@ +name: Report a bug +description: Tell us about a bug or issue you may have identified in Bootstrap. +title: "Provide a general summary of the issue" +labels: [bug] +assignees: "-" +body: + - type: checkboxes + attributes: + label: Prerequisites + description: Take a couple minutes to help our maintainers work faster. + options: + - label: I have [searched](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue) for duplicate or closed issues + required: true + - label: I have [validated](https://html5.validator.nu/) any HTML to avoid common problems + required: true + - label: I have read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md) + required: true + - type: textarea + id: what-happened + attributes: + label: Describe the issue + description: Provide a summary of the issue and what you expected to happen, including specific steps to reproduce. + validations: + required: true + - type: textarea + id: reduced-test-case + attributes: + label: Reduced test cases + description: Include links [reduced test case](https://css-tricks.com/reduced-test-cases/) links or suggested fixes using CodePen ([v4 template](https://codepen.io/team/bootstrap/pen/yLabNQL) or [v5 template](https://codepen.io/team/bootstrap/pen/qBamdLj)). + validations: + required: true + - type: dropdown + id: os + attributes: + label: What operating system(s) are you seeing the problem on? + multiple: true + options: + - Windows + - macOS + - Android + - iOS + - Linux + validations: + required: true + - type: dropdown + id: browser + attributes: + label: What browser(s) are you seeing the problem on? + multiple: true + options: + - Chrome + - Safari + - Firefox + - Microsoft Edge + - Opera + - type: input + id: version + attributes: + label: What version of Bootstrap are you using? + placeholder: "e.g., v5.1.0 or v4.5.2" + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000000..f1520711335c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: Ask the community + url: https://github.com/twbs/bootstrap/discussions/new + about: Ask and discuss questions with other Bootstrap community members. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000000..4b757b1d6753 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,29 @@ +name: Feature request +description: Suggest new or updated features to include in Bootstrap. +title: "Suggest a new feature" +labels: [feature] +assignees: [] +body: + - type: checkboxes + attributes: + label: Prerequisites + description: Take a couple minutes to help our maintainers work faster. + options: + - label: I have [searched](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue) for duplicate or closed feature requests + required: true + - label: I have read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md) + required: true + - type: textarea + id: proposal + attributes: + label: Proposal + description: Provide detailed information for what we should add, including relevant links to prior art, screenshots, or live demos whenever possible. + validations: + required: true + - type: textarea + id: motivation + attributes: + label: Motivation and context + description: Tell us why this change is needed or helpful, and what problems it may help solve. + validations: + required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000000..04df74f36a56 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,38 @@ +### Description + + + +### Motivation & Context + + + +### Type of changes + + + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Refactoring (non-breaking change) +- [ ] Breaking change (fix or feature that would change existing functionality) + +### Checklist + + + + +- [ ] I have read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md) +- [ ] My code follows the code style of the project _(using `npm run lint`)_ +- [ ] My change introduces changes to the documentation +- [ ] I have updated the documentation accordingly +- [ ] I have added tests to cover my changes +- [ ] All new and existing tests passed + +#### Live previews + + + +- + +### Related issues + + diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md new file mode 100644 index 000000000000..26b3be42c5b5 --- /dev/null +++ b/.github/SUPPORT.md @@ -0,0 +1,11 @@ +### Bug reports + +See the [contributing guidelines](CONTRIBUTING.md) for sharing bug reports. + +### How-to + +For general troubleshooting or help getting started: + +- Ask and explore [our GitHub Discussions](https://github.com/twbs/bootstrap/discussions). +- Chat with fellow Bootstrappers in IRC. On the `irc.libera.chat` server, in the `#bootstrap` channel. +- Ask and explore Stack Overflow with the [`bootstrap-5`](https://stackoverflow.com/questions/tagged/bootstrap-5) tag. diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 000000000000..957877282f68 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,3 @@ +name: "CodeQL config" +paths-ignore: + - dist diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000000..77d364498f50 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,26 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: weekly + day: tuesday + time: "12:00" + timezone: Europe/Athens + - package-ecosystem: npm + directory: "/" + labels: + - dependencies + - v5 + schedule: + interval: weekly + day: tuesday + time: "12:00" + timezone: Europe/Athens + versioning-strategy: increase + rebase-strategy: disabled + groups: + production-dependencies: + dependency-type: "production" + development-dependencies: + dependency-type: "development" diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 000000000000..0289984bec06 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,60 @@ +name-template: 'v$NEXT_MAJOR_VERSION' +tag-template: 'v$NEXT_MAJOR_VERSION' +prerelease: true +exclude-labels: + - 'skip-changelog' +categories: + - title: '❗ Breaking Changes' + labels: + - 'breaking-change' + - title: '🚀 Highlights' + labels: + - 'release-highlight' + - title: '🚀 Features' + labels: + - 'new-feature' + - 'feature' + - 'enhancement' + - title: '🐛 Bug fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '⚡ Performance improvements' + labels: + - 'performance' + - title: '🎨 CSS' + labels: + - 'css' + - title: '☕️ JavaScript' + labels: + - 'js' + - title: '📖 Docs' + labels: + - 'docs' + - title: '🛠 Examples' + labels: + - 'examples' + - title: '🌎 Accessibility' + labels: + - 'accessibility' + - title: '🔧 Utility API' + labels: + - 'utility API' + - 'utilities' + - title: '🏭 Tests' + labels: + - 'tests' + - title: '🧰 Misc' + labels: + - 'build' + - 'meta' + - 'chore' + - 'CI' + - title: '📦 Dependencies' + labels: + - 'dependencies' +change-template: '- #$NUMBER: $TITLE' +template: | + ## Changes + $CHANGES diff --git a/.github/workflows/browserstack.yml b/.github/workflows/browserstack.yml new file mode 100644 index 000000000000..e22b9804cd2e --- /dev/null +++ b/.github/workflows/browserstack.yml @@ -0,0 +1,46 @@ +name: BrowserStack + +on: + push: + branches: + - "**" + - "!dependabot/**" + workflow_dispatch: + +env: + FORCE_COLOR: 2 + NODE: 22 + +permissions: + contents: read + +jobs: + browserstack: + runs-on: ubuntu-latest + if: github.repository == 'twbs/bootstrap' + timeout-minutes: 30 + + steps: + - name: Clone repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "${{ env.NODE }}" + cache: npm + + - name: Install npm dependencies + run: npm ci + + - name: Run dist + run: npm run dist + + - name: Run BrowserStack tests + run: npm run js-test-cloud + env: + BROWSER_STACK_ACCESS_KEY: "${{ secrets.BROWSER_STACK_ACCESS_KEY }}" + BROWSER_STACK_USERNAME: "${{ secrets.BROWSER_STACK_USERNAME }}" + GITHUB_SHA: "${{ github.sha }}" diff --git a/.github/workflows/bundlewatch.yml b/.github/workflows/bundlewatch.yml new file mode 100644 index 000000000000..f196df1b88bb --- /dev/null +++ b/.github/workflows/bundlewatch.yml @@ -0,0 +1,43 @@ +name: Bundlewatch + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +env: + FORCE_COLOR: 2 + NODE: 22 + +permissions: + contents: read + +jobs: + bundlewatch: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "${{ env.NODE }}" + cache: npm + + - name: Install npm dependencies + run: npm ci + + - name: Run dist + run: npm run dist + + - name: Run bundlewatch + run: npm run bundlewatch + env: + BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}" + CI_BRANCH_BASE: main diff --git a/.github/workflows/calibreapp-image-actions.yml b/.github/workflows/calibreapp-image-actions.yml new file mode 100644 index 000000000000..08987b3aae69 --- /dev/null +++ b/.github/workflows/calibreapp-image-actions.yml @@ -0,0 +1,32 @@ +name: Compress Images + +on: + pull_request: + paths: + - '**.jpg' + - '**.jpeg' + - '**.png' + - '**.webp' + +permissions: + contents: read + +jobs: + build: + # Only run on Pull Requests within the same repository, and not from forks. + if: github.event.pull_request.head.repo.full_name == github.repository + name: calibreapp/image-actions + runs-on: ubuntu-latest + permissions: + # allow calibreapp/image-actions to update PRs + pull-requests: write + steps: + - name: Clone repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Compress Images + uses: calibreapp/image-actions@1.1.0 + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000000..dd7f6e7ef8d5 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,44 @@ +name: "CodeQL" + +on: + push: + branches: + - main + - v4-dev + - "!dependabot/**" + pull_request: + branches: + - main + - v4-dev + - "!dependabot/**" + schedule: + - cron: "0 2 * * 4" + workflow_dispatch: + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + security-events: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + config-file: ./.github/codeql/codeql-config.yml + languages: "javascript" + queries: +security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:javascript" diff --git a/.github/workflows/cspell.yml b/.github/workflows/cspell.yml new file mode 100644 index 000000000000..44eb025fd845 --- /dev/null +++ b/.github/workflows/cspell.yml @@ -0,0 +1,36 @@ +name: cspell + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +env: + FORCE_COLOR: 2 + +permissions: + contents: read + +jobs: + cspell: + permissions: + # allow streetsidesoftware/cspell-action to fetch files for commits and PRs + contents: read + pull-requests: read + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Run cspell + uses: streetsidesoftware/cspell-action@v7 + with: + config: ".cspell.json" + files: "**/*.{md,mdx}" + inline: error + incremental_files_only: false diff --git a/.github/workflows/css.yml b/.github/workflows/css.yml new file mode 100644 index 000000000000..1c231ac88b62 --- /dev/null +++ b/.github/workflows/css.yml @@ -0,0 +1,40 @@ +name: CSS + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +env: + FORCE_COLOR: 2 + NODE: 22 + +permissions: + contents: read + +jobs: + css: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "${{ env.NODE }}" + cache: npm + + - name: Install npm dependencies + run: npm ci + + - name: Build CSS + run: npm run css + + - name: Run CSS tests + run: npm run css-test diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000000..8cdf39327909 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,50 @@ +name: Docs + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +env: + FORCE_COLOR: 2 + NODE: 22 + +permissions: + contents: read + +jobs: + docs: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "${{ env.NODE }}" + cache: npm + + - run: java -version + + - name: Install npm dependencies + run: npm ci + + - name: Build docs + run: npm run docs-build + + - name: Validate HTML + run: npm run docs-vnu + + - name: Run linkinator + uses: JustinBeckwith/linkinator-action@v1 + with: + paths: _site + recurse: true + verbosity: error + skip: "^(?!http://localhost)" diff --git a/.github/workflows/issue-close-require.yml b/.github/workflows/issue-close-require.yml new file mode 100644 index 000000000000..b5000d8b4350 --- /dev/null +++ b/.github/workflows/issue-close-require.yml @@ -0,0 +1,26 @@ +name: Close Issue Awaiting Reply + +on: + schedule: + - cron: "0 0 * * *" + +permissions: + contents: read + +jobs: + issue-close-require: + permissions: + # allow actions-cool/issues-helper to update issues and PRs + issues: write + pull-requests: write + runs-on: ubuntu-latest + if: github.repository == 'twbs/bootstrap' + steps: + - name: awaiting reply + uses: actions-cool/issues-helper@v3 + with: + actions: "close-issues" + labels: "awaiting-reply" + inactive-day: 14 + body: | + As the issue was labeled with `awaiting-reply`, but there has been no response in 14 days, this issue will be closed. If you have any questions, you can comment/reply. diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml new file mode 100644 index 000000000000..584879dd80cf --- /dev/null +++ b/.github/workflows/issue-labeled.yml @@ -0,0 +1,26 @@ +name: Issue Labeled + +on: + issues: + types: [labeled] + +permissions: + contents: read + +jobs: + issue-labeled: + permissions: + # allow actions-cool/issues-helper to update issues and PRs + issues: write + pull-requests: write + if: github.repository == 'twbs/bootstrap' + runs-on: ubuntu-latest + steps: + - name: awaiting reply + if: github.event.label.name == 'needs-example' + uses: actions-cool/issues-helper@v3 + with: + actions: "create-comment" + token: ${{ secrets.GITHUB_TOKEN }} + body: | + Hello @${{ github.event.issue.user.login }}. Bug reports must include a **live demo** of the issue. Per our [contributing guidelines](https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md), please create a reduced test case on [CodePen](https://codepen.io/) or [StackBlitz](https://stackblitz.com/) and report back with your link, Bootstrap version, and specific browser and Operating System details. diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml new file mode 100644 index 000000000000..fdc24889b1fc --- /dev/null +++ b/.github/workflows/js.yml @@ -0,0 +1,52 @@ +name: JS Tests + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +env: + FORCE_COLOR: 2 + NODE: 22 + +permissions: + contents: read + +jobs: + run: + permissions: + # allow coverallsapp/github-action to create new checks issues and fetch code + checks: write + contents: read + name: JS Tests + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE }} + cache: npm + + - name: Install npm dependencies + run: npm ci + + - name: Run dist + run: npm run js + + - name: Run JS tests + run: npm run js-test + + - name: Run Coveralls + uses: coverallsapp/github-action@v2 + if: ${{ !github.event.repository.fork }} + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + path-to-lcov: "./js/coverage/lcov.info" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000000..1c7aa54f55dc --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,37 @@ +name: Lint + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +env: + FORCE_COLOR: 2 + NODE: 22 + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "${{ env.NODE }}" + cache: npm + + - name: Install npm dependencies + run: npm ci + + - name: Lint + run: npm run lint diff --git a/.github/workflows/node-sass.yml b/.github/workflows/node-sass.yml new file mode 100644 index 000000000000..bdb7dbeaf4b5 --- /dev/null +++ b/.github/workflows/node-sass.yml @@ -0,0 +1,49 @@ +name: CSS (node-sass) + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +env: + FORCE_COLOR: 2 + NODE: 22 + +permissions: + contents: read + +jobs: + css: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "${{ env.NODE }}" + + - name: Build CSS with node-sass + run: | + npx --package node-sass@latest node-sass --version + npx --package node-sass@latest node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 scss/ -o dist-sass/css/ + ls -Al dist-sass/css + + - name: Check built CSS files for Sass variables + shell: bash + run: | + SASS_VARS_FOUND=$(find "dist-sass/css/" -type f -name "*.css" -print0 | xargs -0 --no-run-if-empty grep -F "\$" || true) + if [[ -z "$SASS_VARS_FOUND" ]]; then + echo "All good, no Sass variables found!" + exit 0 + else + echo "Found $(echo "$SASS_VARS_FOUND" | wc -l | bc) Sass variables:" + echo "$SASS_VARS_FOUND" + exit 1 + fi diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml new file mode 100644 index 000000000000..813956af2033 --- /dev/null +++ b/.github/workflows/release-notes.yml @@ -0,0 +1,23 @@ +name: Release notes + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + +jobs: + update_release_draft: + permissions: + # allow release-drafter/release-drafter to create GitHub releases and add labels to PRs + contents: write + pull-requests: write + runs-on: ubuntu-latest + if: github.repository == 'twbs/bootstrap' + steps: + - uses: release-drafter/release-drafter@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 3b10ffb38483..235ad54948dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,37 +1,45 @@ +# Ignore docs files +/_site/ + # Numerous always-ignore extensions *.diff *.err -*.orig *.log +*.orig *.rej *.swo *.swp -*.zip *.vi +*.zip *~ -*.sass-cache # OS or Editor folders -.DS_Store ._* -Thumbs.db .cache +.DS_Store +.idea .project .settings .tmproj *.esproj -nbproject *.sublime-project *.sublime-workspace +nbproject +Thumbs.db +# Local Netlify folder +.netlify # Komodo -*.komodoproject .komodotools +*.komodoproject # Folders to ignore -.hg -.svn -.CVS -.idea -node_modules -dist +/dist-sass/ +/js/coverage/ +/node_modules/ + +# Site +/site/dist +/site/node_modules +/site/.astro +/site/public diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000000..32442e87a0db --- /dev/null +++ b/.prettierignore @@ -0,0 +1,12 @@ +# Prettier is only used for the website + +site/.astro +site/dist +site/public +site/src/assets +site/src/scss +site/src/pages/**/*.md +site/src/pages/**/*.mdx +site/src/content/**/*.mdx +site/src/layouts/RedirectLayout.astro +site/static diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 000000000000..b7013de7ef81 --- /dev/null +++ b/.stylelintignore @@ -0,0 +1,6 @@ +**/*.min.css +**/dist/ +**/vendor/ +/_site/ +/site/public/ +/js/coverage/ diff --git a/.stylelintrc.json b/.stylelintrc.json new file mode 100644 index 000000000000..589884aae7ab --- /dev/null +++ b/.stylelintrc.json @@ -0,0 +1,60 @@ +{ + "extends": [ + "stylelint-config-twbs-bootstrap" + ], + "reportInvalidScopeDisables": true, + "reportNeedlessDisables": true, + "overrides": [ + { + "files": "**/*.scss", + "rules": { + "declaration-property-value-disallowed-list": { + "border": "none", + "outline": "none" + }, + "function-disallowed-list": [ + "calc", + "lighten", + "darken" + ], + "property-disallowed-list": [ + "border-radius", + "border-top-left-radius", + "border-top-right-radius", + "border-bottom-right-radius", + "border-bottom-left-radius", + "transition" + ], + "scss/dollar-variable-default": [ + true, + { + "ignore": "local" + } + ], + "scss/selector-no-union-class-name": true + } + }, + { + "files": "scss/**/*.{test,spec}.scss", + "rules": { + "scss/dollar-variable-default": null, + "declaration-no-important": null + } + }, + { + "files": "site/**/*.scss", + "rules": { + "scss/dollar-variable-default": null + } + }, + { + "files": "site/**/examples/**/*.css", + "rules": { + "comment-empty-line-before": null, + "property-no-vendor-prefix": null, + "selector-no-qualifying-type": null, + "value-no-vendor-prefix": null + } + } + ] +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b8e1f17207d7..000000000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000000..bc5df00e1618 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + "recommendations": [ + "astro-build.astro-vscode", + "dbaeumer.vscode-eslint", + "EditorConfig.EditorConfig", + "hossaini.bootstrap-intellisense", + "streetsidesoftware.code-spell-checker", + "stylelint.vscode-stylelint" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000000..9c6ae2d622a3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "source.fixAll.stylelint": "always" + }, + "editor.renderWhitespace": "all", + "scss.validate": false, + "stylelint.enable": true, + "stylelint.validate": ["scss"] +} diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 68e2850bb92b..000000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,350 +0,0 @@ -## 2.3.0 (February 7, 2013) - -Minor release to add carousel indicators, improve tooltips, improve dev setup, and fix hella bugs. - -- **Repository changes:** - - **Local instead of global dependencies** for our makefile and install process. Now getting started is way easier—just run `npm install`. - - Upgraded to jQuery 1.9. No changes were needed, but we did upgrade the included jQuery file to the latest release. - - Moved changelog to be within the repo instead of as a wiki page. -- **New and improved features:** - - **Added carousel indicators!** Add the HTML and it automagically works. - - **Added `container` option to tooltips.** The default option is still `insertAfter`, but now you may specify where to insert tooltips (and by extension, popovers) with the optional container parameter. - - Improved popovers now utilize `max-width` instead of `width`, have been widened from 240px to 280px, and will automatically hide the title if one has not been set via CSS `:empty` selector. - - Improved tooltip alignment on edges with [#6713](https://github.com/twitter/bootstrap/pull/6713). - - **Improved accessibility for links in all components.** After merging [#6441](https://github.com/twitter/bootstrap/pull/6441), link hover states now apply to the `:focus` state as well. This goes for basic `` tags, as well as buttons, navs, dropdowns, and more. - - Added print utility classes to show and hide content between `screen` and `print` via CSS. - - Updated input groups to make them behave more like default form controls. Added `display: inline-block;`, increased `margin-bottom`, and added `vertical-align: middle;` to match `` styles. - - Added `.horizontal-three-colors()` gradient mixin (with example in the CSS tests file). - - Added `.text-left`, `.text-center`, and `.text-right` utility classes for easy typographic alignment. - - Added `@ms-viewport` so IE10 can use responsive CSS when in split-screen mode. -- **Docs changes:** - - Added [new justified navigation example](https://f.cloud.github.com/assets/98681/25869/5e2f812c-4afa-11e2-9293-501cd689232d.png). - - Added sticky footer with fixed navbar example. - -See more on the [2.3.0 pull request](https://github.com/twitter/bootstrap/pull/6346). - - -## 2.2.2 (December 8, 2012) - -Bugfix release addressing docs, CSS, and some JavaScript issues. Key changes include: - -- **Docs:** - - Assets (illustrations and examples) are now retina-ready. - - Replaced [Placehold.it](http://placehold.it) with [Holder.js](http://imsky.github.com/holder/), a client-side and retina-ready placeholder image tool. -- **Dropdowns:** Temporary fix added for dropdowns on mobile to prevent them from closing early. -- **Popovers:** - - No longer inherits `font-size: 0;` when placed in button groups. - - Arrows refactored to work in IE8, and use less code. - - Plugin no longer inserts popover content into a `

`, but rather directly into `.popover-content`. -- **Labels and badges:** Now [automatically collapse](https://github.com/twitter/bootstrap/commit/ead5dbeba5cd7acfa560bfb353f5e7c4f4a19256) if they have no content. -- **Tables:** Nesting support with `.table-bordered` and `.table-striped` greatly improved. -- **Typeahead:** - - Now [inserts dropdown menu after the input](https://github.com/twitter/bootstrap/commit/1747caf19d59cad7fdc90ae56a00e0e2849f95f4) instead of at the close of the document. - - Hitting escape will place focus back on the ``. -- Print styles, from HTML5 Boilerplate, have been added. - -See more on the [2.2.2 milestone](https://github.com/twitter/bootstrap/issues?milestone=17&state=closed). - - -## 2.2.1 (October 30, 2012) - -Hotfix release to address the carousel bug reports. - - -## 2.2.0 (October 29, 2012) - -### tl;dr - -2.1.2 is now 2.2.0: four new example templates, added media component, new typographic scale, fixed that box-shadow mixin bug, fixed z-index issues, and [more](https://github.com/twitter/bootstrap/issues?milestone=15&page=1&state=closed). - -### Highlights - -- **Added four new example templates** to the docs, including a narrow marketing page, sign in form, sticky footer, and a fancy carousel (created for an upcoming .net magazine article). -- **Added the media component**, to create larger common components like comments, Tweets, etc. -- **New variable-driven typographic scale** based on `@baseFontSize` and `@baseLineHeight`. -- Revamped mini, small, and large padding via new variables for inputs and buttons so everything is the same size. -- Reverted 2.1.1's `.box-shadow();` mixin change that caused compiler errors. -- Improved dropdown submenus to support dropups and left-aligned submenus. -- Fixed z-index issues with tooltips and popovers in modals. -- Hero unit now sets basic type styles for the entire component, rather than on `.hero-unit p { ... }`. -- Updated JavaScript plugins and docs to jQuery 1.8.1. -- Added Contributing.md file. -- Added support for installing Bootstrap via [Bower](http://twitter.github.com/bower). -- Miscellaneous variable improvements across the board. -- Miscellaneous documentation typos fixed. - -For the full list of issues included in this release, visit the [2.2.0 milestone on GitHub](https://github.com/twitter/bootstrap/issues?milestone=15&page=1&state=closed) - - - -## 2.1.1 (September 4, 2012) - -* New feature: alert text. We documented these new classes, like `.text-success`, at the bottom of the [Typography section](http://twitter.github.com/bootstrap/base-css.html#typography) along with the long undocumented `.muted`. -* Fixed a lot of typos in the docs. Spelling is hard. -* Made the `.box-shadow()` mixin more durable. It no longer requires escaping for multiple shadows, meaning you can easily use variables and functions in them once again. -* Widened `.dl-horizontal dt` and `.horizontal-form .control-group` to better handle the increased font-size. -* Dropdown submenus improved: now you only see the next level, not all levels, on hover of the submenu toggle. -* Clarified jQuery and Bootstrap template requirements in Getting Started section. -* `select` now utilizes `@inputBorder`. -* `.lead` now scales up from `@baseFontSize` instead of being a fixed font-size and line-height. -* Fixed the vertical three color gradient in latest Firefox. -* Reordered some variables that caused errors in certain Less compilers. - -View all closed issues on the [2.1.1 milestone](https://github.com/twitter/bootstrap/issues?milestone=14&state=closed). - - -## 2.1.0 (August 20, 2012) - -### Key changes - -* Submenu support on dropdowns -* Affix JavaScript plugin -* Block level buttons -* State classes on table rows -* Improved disabled states on navs and dropdowns -* The navbar component is now white by default, with an optional class to darken it -* Improved prepended and appended inputs -* New base font-size and line-height -* Added variable for navbar collapse trigger point -* Fluid grid offsets -* Fluid grid system variables are no longer fixed percentages -* Removed LESS docs page - -For full set of changes, see the completed milestone: https://github.com/twitter/bootstrap/issues?milestone=7&page=1&state=closed - -## 2.0.4 (June 1, 2012) - - -### Docs - -- Added `type="button"` to all dismiss buttons in alerts and modals to avoid a bug in which they prevent their parent's `form` from properly submitting. -- Added simple documentation to Base CSS for `.lead`. -- Added new CSS test to illustrate how the navbar, static and fixed, behaves. -- Clarified grid sizing copy to include mention of responsive variations. -- Reformatted the LESS docs page to prevent terrible table displays at smaller grid sizes. -- Miscellaneous typos and tweaks. - -### CSS - -- Refactored forms.less to make our selectors more specific for fewer overrides and less code. Instead of a generic `input` selector and various resets, we target each type of input like `input[type="text"]`, `input[type="password"]`, etc. -- Form field state (e.g., success or error) now applies to checkbox and radio labels. -- Removed redundant CSS on `

` for `font-family`, `font-size`, and `line-height`. -- Removed redundant `color` declaration from the ` - - - -# [Bootstrap v2.3.0](http://twitter.github.com/bootstrap) [![Build Status](https://secure.travis-ci.org/twitter/bootstrap.png)](http://travis-ci.org/twitter/bootstrap) - -Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created and maintained by [Mark Otto](http://twitter.com/mdo) and [Jacob Thornton](http://twitter.com/fat). - -To get started, checkout [http://getbootstrap.com](http://getbootstrap.com)! - +

+ + Bootstrap logo + +

+ +

Bootstrap

+ +

+ Sleek, intuitive, and powerful front-end framework for faster and easier web development. +
+ Explore Bootstrap docs » +
+
+ Report bug + · + Request feature + · + Themes + · + Blog +

+ + +## Bootstrap 5 + +Our default branch is for development of our Bootstrap 5 release. Head to the [`v4-dev` branch](https://github.com/twbs/bootstrap/tree/v4-dev) to view the readme, documentation, and source code for Bootstrap 4. + + +## Table of contents + +- [Quick start](#quick-start) +- [Status](#status) +- [What’s included](#whats-included) +- [Bugs and feature requests](#bugs-and-feature-requests) +- [Documentation](#documentation) +- [Contributing](#contributing) +- [Community](#community) +- [Versioning](#versioning) +- [Creators](#creators) +- [Thanks](#thanks) +- [Copyright and license](#copyright-and-license) ## Quick start -Three quick start options are available: - -* [Download the latest release](https://github.com/twitter/bootstrap/zipball/master). -* Clone the repo: `git clone git://github.com/twitter/bootstrap.git`. -* Install with Twitter's [Bower](http://twitter.github.com/bower): `bower install bootstrap`. - - - -## Versioning - -For transparency and insight into our release cycle, and for striving to maintain backward compatibility, Bootstrap will be maintained under the Semantic Versioning guidelines as much as possible. - -Releases will be numbered with the following format: - -`..` - -And constructed with the following guidelines: - -* Breaking backward compatibility bumps the major (and resets the minor and patch) -* New additions without breaking backward compatibility bumps the minor (and resets the patch) -* Bug fixes and misc changes bumps the patch - -For more information on SemVer, please visit [http://semver.org/](http://semver.org/). +Several quick start options are available: + +- [Download the latest release](https://github.com/twbs/bootstrap/archive/v5.3.7.zip) +- Clone the repo: `git clone https://github.com/twbs/bootstrap.git` +- Install with [npm](https://www.npmjs.com/): `npm install bootstrap@v5.3.7` +- Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap@v5.3.7` +- Install with [Bun](https://bun.sh/): `bun add bootstrap@v5.3.7` +- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:5.3.7` +- Install with [NuGet](https://www.nuget.org/): CSS: `Install-Package bootstrap` Sass: `Install-Package bootstrap.sass` + +Read the [Getting started page](https://getbootstrap.com/docs/5.3/getting-started/introduction/) for information on the framework contents, templates, examples, and more. + + +## Status + +[![Build Status](https://img.shields.io/github/actions/workflow/status/twbs/bootstrap/js.yml?branch=main&label=JS%20Tests&logo=github)](https://github.com/twbs/bootstrap/actions/workflows/js.yml?query=workflow%3AJS+branch%3Amain) +[![npm version](https://img.shields.io/npm/v/bootstrap?logo=npm&logoColor=fff)](https://www.npmjs.com/package/bootstrap) +[![Gem version](https://img.shields.io/gem/v/bootstrap?logo=rubygems&logoColor=fff)](https://rubygems.org/gems/bootstrap) +[![Meteor Atmosphere](https://img.shields.io/badge/meteor-twbs%3Abootstrap-blue?logo=meteor&logoColor=fff)](https://atmospherejs.com/twbs/bootstrap) +[![Packagist Prerelease](https://img.shields.io/packagist/vpre/twbs/bootstrap?logo=packagist&logoColor=fff)](https://packagist.org/packages/twbs/bootstrap) +[![NuGet](https://img.shields.io/nuget/vpre/bootstrap?logo=nuget&logoColor=fff)](https://www.nuget.org/packages/bootstrap/absoluteLatest) +[![Coverage Status](https://img.shields.io/coveralls/github/twbs/bootstrap/main?logo=coveralls&logoColor=fff)](https://coveralls.io/github/twbs/bootstrap?branch=main) +[![CSS gzip size](https://img.badgesize.io/twbs/bootstrap/main/dist/css/bootstrap.min.css?compression=gzip&label=CSS%20gzip%20size)](https://github.com/twbs/bootstrap/blob/main/dist/css/bootstrap.min.css) +[![CSS Brotli size](https://img.badgesize.io/twbs/bootstrap/main/dist/css/bootstrap.min.css?compression=brotli&label=CSS%20Brotli%20size)](https://github.com/twbs/bootstrap/blob/main/dist/css/bootstrap.min.css) +[![JS gzip size](https://img.badgesize.io/twbs/bootstrap/main/dist/js/bootstrap.min.js?compression=gzip&label=JS%20gzip%20size)](https://github.com/twbs/bootstrap/blob/main/dist/js/bootstrap.min.js) +[![JS Brotli size](https://img.badgesize.io/twbs/bootstrap/main/dist/js/bootstrap.min.js?compression=brotli&label=JS%20Brotli%20size)](https://github.com/twbs/bootstrap/blob/main/dist/js/bootstrap.min.js) +[![Backers on Open Collective](https://img.shields.io/opencollective/backers/bootstrap?logo=opencollective&logoColor=fff)](#backers) +[![Sponsors on Open Collective](https://img.shields.io/opencollective/sponsors/bootstrap?logo=opencollective&logoColor=fff)](#sponsors) + + +## What’s included + +Within the download you’ll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. + +
+ Download contents + + ```text + bootstrap/ + ├── css/ + │ ├── bootstrap-grid.css + │ ├── bootstrap-grid.css.map + │ ├── bootstrap-grid.min.css + │ ├── bootstrap-grid.min.css.map + │ ├── bootstrap-grid.rtl.css + │ ├── bootstrap-grid.rtl.css.map + │ ├── bootstrap-grid.rtl.min.css + │ ├── bootstrap-grid.rtl.min.css.map + │ ├── bootstrap-reboot.css + │ ├── bootstrap-reboot.css.map + │ ├── bootstrap-reboot.min.css + │ ├── bootstrap-reboot.min.css.map + │ ├── bootstrap-reboot.rtl.css + │ ├── bootstrap-reboot.rtl.css.map + │ ├── bootstrap-reboot.rtl.min.css + │ ├── bootstrap-reboot.rtl.min.css.map + │ ├── bootstrap-utilities.css + │ ├── bootstrap-utilities.css.map + │ ├── bootstrap-utilities.min.css + │ ├── bootstrap-utilities.min.css.map + │ ├── bootstrap-utilities.rtl.css + │ ├── bootstrap-utilities.rtl.css.map + │ ├── bootstrap-utilities.rtl.min.css + │ ├── bootstrap-utilities.rtl.min.css.map + │ ├── bootstrap.css + │ ├── bootstrap.css.map + │ ├── bootstrap.min.css + │ ├── bootstrap.min.css.map + │ ├── bootstrap.rtl.css + │ ├── bootstrap.rtl.css.map + │ ├── bootstrap.rtl.min.css + │ └── bootstrap.rtl.min.css.map + └── js/ + ├── bootstrap.bundle.js + ├── bootstrap.bundle.js.map + ├── bootstrap.bundle.min.js + ├── bootstrap.bundle.min.js.map + ├── bootstrap.esm.js + ├── bootstrap.esm.js.map + ├── bootstrap.esm.min.js + ├── bootstrap.esm.min.js.map + ├── bootstrap.js + ├── bootstrap.js.map + ├── bootstrap.min.js + └── bootstrap.min.js.map + ``` +
+ +We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). [Source maps](https://web.dev/articles/source-maps) (`bootstrap.*.map`) are available for use with certain browsers’ developer tools. Bundled JS files (`bootstrap.bundle.js` and minified `bootstrap.bundle.min.js`) include [Popper](https://popper.js.org/docs/v2/). + + +## Bugs and feature requests + +Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/twbs/bootstrap/issues/new/choose). + + +## Documentation + +Bootstrap’s documentation, included in this repo in the root directory, is built with [Astro](https://astro.build/) and publicly hosted on GitHub Pages at . The docs may also be run locally. + +Documentation search is powered by [Algolia's DocSearch](https://docsearch.algolia.com/). + +### Running documentation locally + +1. Run `npm install` to install the Node.js dependencies, including Astro (the site builder). +2. Run `npm run test` (or a specific npm script) to rebuild distributed CSS and JavaScript files, as well as our docs assets. +3. From the root `/bootstrap` directory, run `npm run docs-serve` in the command line. +4. Open `http://localhost:9001/` in your browser, and voilà. + +Learn more about using Astro by reading its [documentation](https://docs.astro.build/en/getting-started/). + +### Documentation for previous releases + +You can find all our previous releases docs on . + +[Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download. +## Contributing -## Bug tracker +Please read through our [contributing guidelines](https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development. -Have a bug or a feature request? [Please open a new issue](https://github.com/twitter/bootstrap/issues). Before opening any issue, please search for existing issues and read the [Issue Guidelines](https://github.com/necolas/issue-guidelines), written by [Nicolas Gallagher](https://github.com/necolas/). +Moreover, if your pull request contains JavaScript patches or features, you must include [relevant unit tests](https://github.com/twbs/bootstrap/tree/main/js/tests). All HTML and CSS should conform to the [Code Guide](https://github.com/mdo/code-guide), maintained by [Mark Otto](https://github.com/mdo). +Editor preferences are available in the [editor config](https://github.com/twbs/bootstrap/blob/main/.editorconfig) for easy use in common text editors. Read more and download plugins at . ## Community -Keep track of development and community news. - -* Follow [@twbootstrap on Twitter](http://twitter.com/twbootstrap). -* Read and subscribe to the [The Official Twitter Bootstrap Blog](http://blog.getbootstrap.com). -* Have a question that's not a feature request or bug report? [Ask on the mailing list.](http://groups.google.com/group/twitter-bootstrap) -* Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##twitter-bootstrap` channel. - +Get updates on Bootstrap’s development and chat with the project maintainers and community members. +- Follow [@getbootstrap on X](https://x.com/getbootstrap). +- Read and subscribe to [The Official Bootstrap Blog](https://blog.getbootstrap.com/). +- Ask questions and explore [our GitHub Discussions](https://github.com/twbs/bootstrap/discussions). +- Discuss, ask questions, and more on [the community Discord](https://discord.gg/bZUvakRU3M) or [Bootstrap subreddit](https://www.reddit.com/r/bootstrap/). +- Chat with fellow Bootstrappers in IRC. On the `irc.libera.chat` server, in the `#bootstrap` channel. +- Implementation help may be found at Stack Overflow (tagged [`bootstrap-5`](https://stackoverflow.com/questions/tagged/bootstrap-5)). +- Developers should use the keyword `bootstrap` on packages which modify or add to the functionality of Bootstrap when distributing through [npm](https://www.npmjs.com/browse/keyword/bootstrap) or similar delivery mechanisms for maximum discoverability. -## Compiling CSS and JavaScript -Bootstrap includes a [makefile](Makefile) with convenient methods for working with the framework. Before getting started, be sure to install [the necessary local dependencies](package.json): +## Versioning -``` -$ npm install -``` +For transparency into our release cycle and in striving to maintain backward compatibility, Bootstrap is maintained under [the Semantic Versioning guidelines](https://semver.org/). Sometimes we screw up, but we adhere to those rules whenever possible. -When completed, you'll be able to run the various make commands provided: +See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap. Release announcement posts on [the official Bootstrap blog](https://blog.getbootstrap.com/) contain summaries of the most noteworthy changes made in each release. -#### build - `make` -Runs the recess compiler to rebuild the `/less` files and compiles the docs. Requires recess and uglify-js. -#### test - `make test` -Runs jshint and qunit tests headlessly in [phantomjs](http://code.google.com/p/phantomjs/) (used for ci). Depends on having phantomjs installed. +## Creators -#### watch - `make watch` -This is a convenience method for watching just Less files and automatically building them whenever you save. Requires the Watchr gem. +**Mark Otto** -Should you encounter problems with installing dependencies or running the makefile commands, be sure to first uninstall any previous versions (global and local) you may have installed, and then rerun `npm install`. +- +- +**Jacob Thornton** +- +- -## Contributing -Please submit all pull requests against *-wip branches. If your pull request contains JavaScript patches or features, you must include relevant unit tests. All HTML and CSS should conform to the [Code Guide](http://github.com/mdo/code-guide), maintained by [Mark Otto](http://github.com/mdo). +## Thanks -Thanks! + + BrowserStack + +Thanks to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to test in real browsers! + + Netlify + -## Authors +Thanks to [Netlify](https://www.netlify.com/) for providing us with Deploy Previews! -**Mark Otto** -+ [http://twitter.com/mdo](http://twitter.com/mdo) -+ [http://github.com/mdo](http://github.com/mdo) +## Sponsors -**Jacob Thornton** +Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/bootstrap#sponsor)] -+ [http://twitter.com/fat](http://twitter.com/fat) -+ [http://github.com/fat](http://github.com/fat) +[![OC sponsor 0](https://opencollective.com/bootstrap/sponsor/0/avatar.svg)](https://opencollective.com/bootstrap/sponsor/0/website) +[![OC sponsor 1](https://opencollective.com/bootstrap/sponsor/1/avatar.svg)](https://opencollective.com/bootstrap/sponsor/1/website) +[![OC sponsor 2](https://opencollective.com/bootstrap/sponsor/2/avatar.svg)](https://opencollective.com/bootstrap/sponsor/2/website) +[![OC sponsor 3](https://opencollective.com/bootstrap/sponsor/3/avatar.svg)](https://opencollective.com/bootstrap/sponsor/3/website) +[![OC sponsor 4](https://opencollective.com/bootstrap/sponsor/4/avatar.svg)](https://opencollective.com/bootstrap/sponsor/4/website) +[![OC sponsor 5](https://opencollective.com/bootstrap/sponsor/5/avatar.svg)](https://opencollective.com/bootstrap/sponsor/5/website) +[![OC sponsor 6](https://opencollective.com/bootstrap/sponsor/6/avatar.svg)](https://opencollective.com/bootstrap/sponsor/6/website) +[![OC sponsor 7](https://opencollective.com/bootstrap/sponsor/7/avatar.svg)](https://opencollective.com/bootstrap/sponsor/7/website) +[![OC sponsor 8](https://opencollective.com/bootstrap/sponsor/8/avatar.svg)](https://opencollective.com/bootstrap/sponsor/8/website) +[![OC sponsor 9](https://opencollective.com/bootstrap/sponsor/9/avatar.svg)](https://opencollective.com/bootstrap/sponsor/9/website) +## Backers -## Copyright and license +Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/bootstrap#backer)] -Copyright 2012 Twitter, Inc. +[![Backers](https://opencollective.com/bootstrap/backers.svg?width=890)](https://opencollective.com/bootstrap#backers) -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this work except in compliance with the License. -You may obtain a copy of the License in the LICENSE file, or at: - [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) +## Copyright and license -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +Code and documentation copyright 2011-2025 the [Bootstrap Authors](https://github.com/twbs/bootstrap/graphs/contributors). Code released under the [MIT License](https://github.com/twbs/bootstrap/blob/main/LICENSE). Docs released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000000..e79dcd8d2038 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Reporting Security Issues + +The Bootstrap team and community take security issues in Bootstrap seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions. + +To report a security issue, email [security@getbootstrap.com](mailto:security@getbootstrap.com) and include the word "SECURITY" in the subject line. + +We'll endeavor to respond quickly, and will keep you updated throughout the process. diff --git a/build/banner.mjs b/build/banner.mjs new file mode 100644 index 000000000000..3fea93c8f1d2 --- /dev/null +++ b/build/banner.mjs @@ -0,0 +1,20 @@ +import fs from 'node:fs/promises' +import path from 'node:path' +import { fileURLToPath } from 'node:url' + +const __dirname = path.dirname(fileURLToPath(import.meta.url)) + +const pkgJson = path.join(__dirname, '../package.json') +const pkg = JSON.parse(await fs.readFile(pkgJson, 'utf8')) + +const year = new Date().getFullYear() + +function getBanner(pluginFilename) { + return `/*! + * Bootstrap${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage}) + * Copyright 2011-${year} ${pkg.author} + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */` +} + +export default getBanner diff --git a/build/build-plugins.mjs b/build/build-plugins.mjs new file mode 100644 index 000000000000..f56cd213f511 --- /dev/null +++ b/build/build-plugins.mjs @@ -0,0 +1,108 @@ +#!/usr/bin/env node + +/*! + * Script to build our plugins to use them separately. + * Copyright 2020-2025 The Bootstrap Authors + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ + +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { babel } from '@rollup/plugin-babel' +import { globby } from 'globby' +import { rollup } from 'rollup' +import banner from './banner.mjs' + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(fileURLToPath(import.meta.url)) + +const sourcePath = path.resolve(__dirname, '../js/src/').replace(/\\/g, '/') +const jsFiles = await globby(`${sourcePath}/**/*.js`) + +// Array which holds the resolved plugins +const resolvedPlugins = [] + +// Trims the "js" extension and uppercases => first letter, hyphens, backslashes & slashes +const filenameToEntity = filename => filename.replace('.js', '') + .replace(/(?:^|-|\/|\\)[a-z]/g, str => str.slice(-1).toUpperCase()) + +for (const file of jsFiles) { + resolvedPlugins.push({ + src: file, + dist: file.replace('src', 'dist'), + fileName: path.basename(file), + className: filenameToEntity(path.basename(file)) + // safeClassName: filenameToEntity(path.relative(sourcePath, file)) + }) +} + +const build = async plugin => { + /** + * @type {import('rollup').GlobalsOption} + */ + const globals = {} + + const bundle = await rollup({ + input: plugin.src, + plugins: [ + babel({ + // Only transpile our source code + exclude: 'node_modules/**', + // Include the helpers in each file, at most one copy of each + babelHelpers: 'bundled' + }) + ], + external(source) { + // Pattern to identify local files + const pattern = /^(\.{1,2})\// + + // It's not a local file, e.g a Node.js package + if (!pattern.test(source)) { + globals[source] = source + return true + } + + const usedPlugin = resolvedPlugins.find(plugin => { + return plugin.src.includes(source.replace(pattern, '')) + }) + + if (!usedPlugin) { + throw new Error(`Source ${source} is not mapped!`) + } + + // We can change `Index` with `UtilIndex` etc if we use + // `safeClassName` instead of `className` everywhere + globals[path.normalize(usedPlugin.src)] = usedPlugin.className + return true + } + }) + + await bundle.write({ + banner: banner(plugin.fileName), + format: 'umd', + name: plugin.className, + sourcemap: true, + globals, + generatedCode: 'es2015', + file: plugin.dist + }) + + console.log(`Built ${plugin.className}`) +} + +(async () => { + try { + const basename = path.basename(__filename) + const timeLabel = `[${basename}] finished` + + console.log('Building individual plugins...') + console.time(timeLabel) + + await Promise.all(Object.values(resolvedPlugins).map(plugin => build(plugin))) + + console.timeEnd(timeLabel) + } catch (error) { + console.error(error) + process.exit(1) + } +})() diff --git a/build/change-version.mjs b/build/change-version.mjs new file mode 100644 index 000000000000..1400274c446e --- /dev/null +++ b/build/change-version.mjs @@ -0,0 +1,113 @@ +#!/usr/bin/env node + +/*! + * Script to update version number references in the project. + * Copyright 2017-2025 The Bootstrap Authors + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ + +import { execFile } from 'node:child_process' +import fs from 'node:fs/promises' +import process from 'node:process' + +const VERBOSE = process.argv.includes('--verbose') +const DRY_RUN = process.argv.includes('--dry') || process.argv.includes('--dry-run') + +// These are the files we only care about replacing the version +const FILES = [ + 'README.md', + 'config.yml', + 'js/src/base-component.js', + 'package.js', + 'scss/mixins/_banner.scss', + 'site/data/docs-versions.yml' +] + +// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37 +function regExpQuote(string) { + return string.replace(/[$()*+-.?[\\\]^{|}]/g, '\\$&') +} + +function regExpQuoteReplacement(string) { + return string.replace(/\$/g, '$$') +} + +async function replaceRecursively(file, oldVersion, newVersion) { + const originalString = await fs.readFile(file, 'utf8') + const newString = originalString + .replace( + new RegExp(regExpQuote(oldVersion), 'g'), + regExpQuoteReplacement(newVersion) + ) + // Also replace the version used by the rubygem, + // which is using periods (`.`) instead of hyphens (`-`) + .replace( + new RegExp(regExpQuote(oldVersion.replace(/-/g, '.')), 'g'), + regExpQuoteReplacement(newVersion.replace(/-/g, '.')) + ) + + // No need to move any further if the strings are identical + if (originalString === newString) { + return + } + + if (VERBOSE) { + console.log(`Found ${oldVersion} in ${file}`) + } + + if (DRY_RUN) { + return + } + + await fs.writeFile(file, newString, 'utf8') +} + +function bumpNpmVersion(newVersion) { + if (DRY_RUN) { + return + } + + execFile('npm', ['version', newVersion, '--no-git-tag'], { shell: true }, error => { + if (error) { + console.error(error) + process.exit(1) + } + }) +} + +function showUsage(args) { + console.error('USAGE: change-version old_version new_version [--verbose] [--dry[-run]]') + console.error('Got arguments:', args) + process.exit(1) +} + +async function main(args) { + let [oldVersion, newVersion] = args + + if (!oldVersion || !newVersion) { + showUsage(args) + } + + // Strip any leading `v` from arguments because + // otherwise we will end up with duplicate `v`s + [oldVersion, newVersion] = [oldVersion, newVersion].map(arg => { + return arg.startsWith('v') ? arg.slice(1) : arg + }) + + if (oldVersion === newVersion) { + showUsage(args) + } + + bumpNpmVersion(newVersion) + + try { + await Promise.all( + FILES.map(file => replaceRecursively(file, oldVersion, newVersion)) + ) + } catch (error) { + console.error(error) + process.exit(1) + } +} + +main(process.argv.slice(2)) diff --git a/build/docs-prep.sh b/build/docs-prep.sh new file mode 100755 index 000000000000..b0054257e7b1 --- /dev/null +++ b/build/docs-prep.sh @@ -0,0 +1,181 @@ +#!/bin/bash + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Default branch suffix +BRANCH_SUFFIX="release" + +# Check if a custom version parameter was provided +if [ $# -eq 1 ]; then + BRANCH_SUFFIX="$1" +fi + +# Branch name to create +NEW_BRANCH="gh-pages-${BRANCH_SUFFIX}" + +# Function to print colored messages +print_success() { + echo -e "${GREEN}✓ $1${NC}" +} + +print_error() { + echo -e "${RED}✗ $1${NC}" + exit 1 +} + +print_info() { + echo -e "${BLUE}ℹ $1${NC}" +} + +print_warning() { + echo -e "${YELLOW}⚠ $1${NC}" +} + +# Function to execute command with error handling +execute() { + print_info "Running: $1" + eval $1 + if [ $? -ne 0 ]; then + print_error "Failed to execute: $1" + else + print_success "Successfully executed: $1" + fi +} + +# Check if /tmp/_site directory exists from a previous run +if [ -d "/tmp/_site" ]; then + print_warning "Found existing /tmp/_site directory. Removing it…" + rm -rf /tmp/_site +fi + +# Main process +print_info "Starting documentation deployment process…" + +# Step 1: Build documentation +print_info "Building documentation with npm run docs…" +npm run docs +if [ $? -ne 0 ]; then + print_error "Documentation build failed!" +fi +print_success "Documentation built successfully" + +# Step 2: Move _site to /tmp/ +print_info "Moving _site to temporary location…" +execute "mv _site /tmp/" + +# Step 3: Switch to gh-pages branch +print_info "Checking out gh-pages branch…" +git checkout gh-pages +if [ $? -ne 0 ]; then + print_error "Failed to checkout gh-pages branch. Make sure it exists." +fi +print_success "Switched to gh-pages branch" + +git reset --hard origin/gh-pages +if [ $? -ne 0 ]; then + print_error "Failed to reset to origin/gh-pages. Check your git configuration." +fi +print_success "Reset to origin/gh-pages" + +git pull origin gh-pages +if [ $? -ne 0 ]; then + print_error "Failed to pull from origin/gh-pages. Check your network connection and git configuration." +fi +print_success "Pulled latest changes from origin/gh-pages" + +# Step 4: Create a new branch for the update +print_info "Creating new branch ${NEW_BRANCH}…" +execute "git checkout -b ${NEW_BRANCH}" + +# Step 5: Move root files +print_info "Moving root files from temporary location…" +ROOT_FILES=("404.html" "CNAME" "apple-touch-icon.png" "favicon.ico" "index.html" "robots.txt" "sitemap-0.xml" "sitemap-index.xml" "sw.js") +for file in "${ROOT_FILES[@]}"; do + if [ -f "/tmp/_site/$file" ]; then + execute "mv /tmp/_site/$file ." + else + print_warning "File /tmp/_site/$file not found. Skipping." + fi +done + +# Step 6: Move directories with cleanup +print_info "Moving directories from temporary location…" +DIRS=("about" "components" "docsref" "examples" "getting-started" "migration") +for dir in "${DIRS[@]}"; do + if [ -d "/tmp/_site/$dir" ]; then + if [ -d "$dir" ]; then + execute "rm -rf $dir" + fi + execute "mv /tmp/_site/$dir ." + else + print_warning "Directory /tmp/_site/$dir not found. Skipping." + fi +done + +# Step 7: Handle special doc directories +print_info "Handling special documentation directories…" +SPECIAL_DOCS=("docs/getting-started" "docs/versions") +for dir in "${SPECIAL_DOCS[@]}"; do + if [ -d "/tmp/_site/$dir" ]; then + if [ -d "$dir" ]; then + execute "rm -rf $dir" + fi + # Make sure parent directory exists + parent_dir=$(dirname "$dir") + mkdir -p "$parent_dir" + execute "mv /tmp/_site/$dir $parent_dir/" + else + print_warning "Directory /tmp/_site/$dir not found. Skipping." + fi +done + +# Step 8: Move docs index.html +if [ -f "/tmp/_site/docs/index.html" ]; then + execute "mv /tmp/_site/docs/index.html docs/index.html" +else + print_warning "File /tmp/_site/docs/index.html not found. Skipping." +fi + +# Step 9: Handle docs/5.3 +if [ -d "/tmp/_site/docs/5.3" ]; then + if [ -d "docs/5.3" ]; then + execute "rm -rf docs/5.3" + fi + execute "mv /tmp/_site/docs/5.3 docs/" +else + print_warning "Directory /tmp/_site/docs/5.3 not found. Skipping." +fi + +# Clean up remaining files in /tmp/_site if any +if [ -d "/tmp/_site" ]; then + remaining_files=$(find /tmp/_site -type f | wc -l) + remaining_dirs=$(find /tmp/_site -type d | wc -l) + if [ $remaining_files -gt 0 ] || [ $remaining_dirs -gt 1 ]; then + print_warning "There are still some files or directories in /tmp/_site that weren't moved." + print_warning "You may want to inspect /tmp/_site to see if anything important was missed." + else + print_info "Cleaning up temporary directory…" + rm -rf /tmp/_site + print_success "Temporary directory cleaned up" + fi +fi + +# Step 10: Remove empty site directory if it exists +if [ -d "site" ]; then + print_info "Removing empty site directory…" + execute "rm -rf site" +fi + +print_success "Docs prep complete!" +print_info "Review changes before committing and pushing." +print_info "Next steps:" +print_info " 1. Run a local server to review changes" +print_info " 2. Check browser and web inspector for any errors" +print_info " 3. git add ." +print_info " 4. git commit -m \"Update documentation\"" +print_info " 5. git push origin ${NEW_BRANCH}" diff --git a/build/generate-sri.mjs b/build/generate-sri.mjs new file mode 100644 index 000000000000..5622843f3479 --- /dev/null +++ b/build/generate-sri.mjs @@ -0,0 +1,64 @@ +#!/usr/bin/env node + +/*! + * Script to generate SRI hashes for use in our docs. + * Remember to use the same vendor files as the CDN ones, + * otherwise the hashes won't match! + * + * Copyright 2017-2025 The Bootstrap Authors + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ + +import crypto from 'node:crypto' +import fs from 'node:fs' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import sh from 'shelljs' + +const __dirname = path.dirname(fileURLToPath(import.meta.url)) + +sh.config.fatal = true + +const configFile = path.join(__dirname, '../config.yml') + +// Array of objects which holds the files to generate SRI hashes for. +// `file` is the path from the root folder +// `configPropertyName` is the config.yml variable's name of the file +const files = [ + { + file: 'dist/css/bootstrap.min.css', + configPropertyName: 'css_hash' + }, + { + file: 'dist/css/bootstrap.rtl.min.css', + configPropertyName: 'css_rtl_hash' + }, + { + file: 'dist/js/bootstrap.min.js', + configPropertyName: 'js_hash' + }, + { + file: 'dist/js/bootstrap.bundle.min.js', + configPropertyName: 'js_bundle_hash' + }, + { + file: 'node_modules/@popperjs/core/dist/umd/popper.min.js', + configPropertyName: 'popper_hash' + } +] + +for (const { file, configPropertyName } of files) { + fs.readFile(file, 'utf8', (error, data) => { + if (error) { + throw error + } + + const algorithm = 'sha384' + const hash = crypto.createHash(algorithm).update(data, 'utf8').digest('base64') + const integrity = `${algorithm}-${hash}` + + console.log(`${configPropertyName}: ${integrity}`) + + sh.sed('-i', new RegExp(`^(\\s+${configPropertyName}:\\s+["'])\\S*(["'])`), `$1${integrity}$2`, configFile) + }) +} diff --git a/build/postcss.config.mjs b/build/postcss.config.mjs new file mode 100644 index 000000000000..7717cfc3f1f6 --- /dev/null +++ b/build/postcss.config.mjs @@ -0,0 +1,17 @@ +const mapConfig = { + inline: false, + annotation: true, + sourcesContent: true +} + +export default context => { + return { + map: context.file.dirname.includes('examples') ? false : mapConfig, + plugins: { + autoprefixer: { + cascade: false + }, + rtlcss: context.env === 'RTL' + } + } +} diff --git a/build/rollup.config.mjs b/build/rollup.config.mjs new file mode 100644 index 000000000000..dd6c7d13e66f --- /dev/null +++ b/build/rollup.config.mjs @@ -0,0 +1,59 @@ +import path from 'node:path' +import process from 'node:process' +import { fileURLToPath } from 'node:url' +import { babel } from '@rollup/plugin-babel' +import { nodeResolve } from '@rollup/plugin-node-resolve' +import replace from '@rollup/plugin-replace' +import banner from './banner.mjs' + +const __dirname = path.dirname(fileURLToPath(import.meta.url)) + +const BUNDLE = process.env.BUNDLE === 'true' +const ESM = process.env.ESM === 'true' + +let destinationFile = `bootstrap${ESM ? '.esm' : ''}` +const external = ['@popperjs/core'] +const plugins = [ + babel({ + // Only transpile our source code + exclude: 'node_modules/**', + // Include the helpers in the bundle, at most one copy of each + babelHelpers: 'bundled' + }) +] +const globals = { + '@popperjs/core': 'Popper' +} + +if (BUNDLE) { + destinationFile += '.bundle' + // Remove last entry in external array to bundle Popper + external.pop() + delete globals['@popperjs/core'] + plugins.push( + replace({ + 'process.env.NODE_ENV': '"production"', + preventAssignment: true + }), + nodeResolve() + ) +} + +const rollupConfig = { + input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.js`), + output: { + banner: banner(), + file: path.resolve(__dirname, `../dist/js/${destinationFile}.js`), + format: ESM ? 'esm' : 'umd', + globals, + generatedCode: 'es2015' + }, + external, + plugins +} + +if (!ESM) { + rollupConfig.output.name = 'bootstrap' +} + +export default rollupConfig diff --git a/build/vnu-jar.mjs b/build/vnu-jar.mjs new file mode 100644 index 000000000000..4eedb1bedc42 --- /dev/null +++ b/build/vnu-jar.mjs @@ -0,0 +1,66 @@ +#!/usr/bin/env node + +/*! + * Script to run vnu-jar if Java is available. + * Copyright 2017-2025 The Bootstrap Authors + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ + +import { execFile, spawn } from 'node:child_process' +import vnu from 'vnu-jar' + +execFile('java', ['-version'], (error, stdout, stderr) => { + if (error) { + console.error('Skipping vnu-jar test; Java is probably missing.') + console.error(error) + return + } + + console.log('Running vnu-jar validation...') + + const is32bitJava = !/64-Bit/.test(stderr) + + // vnu-jar accepts multiple ignores joined with a `|`. + // Also note that the ignores are string regular expressions. + const ignores = [ + // "autocomplete" is included in - Bootstrap - - - - - - -
-
-

Components

-

Dozens of reusable components built to provide navigation, alerts, popovers, and more.

-
-
- - -
- - -
- -
- - - - - - - - - - -
- - -

Examples

-

Two basic options, along with two more specific variations.

- -

Single button group

-

Wrap a series of buttons with .btn in .btn-group.

-
-
- - - -
-
-
-<div class="btn-group">
-  <button class="btn">Left</button>
-  <button class="btn">Middle</button>
-  <button class="btn">Right</button>
-</div>
-
- -

Multiple button groups

-

Combine sets of <div class="btn-group"> into a <div class="btn-toolbar"> for more complex components.

-
-
-
- - - - -
-
- - - -
-
- -
-
-
-
-<div class="btn-toolbar">
-  <div class="btn-group">
-    ...
-  </div>
-</div>
-
- -

Vertical button groups

-

Make a set of buttons appear vertically stacked rather than horizontally.

-
-
- - - - -
-
-
-<div class="btn-group btn-group-vertical">
-  ...
-</div>
-
- - -
- - -

Checkbox and radio flavors

-

Button groups can also function as radios, where only one button may be active, or checkboxes, where any number of buttons may be active. View the JavaScript docs for that.

- -

Dropdowns in button groups

-

Heads up! Buttons with dropdowns must be individually wrapped in their own .btn-group within a .btn-toolbar for proper rendering.

-
- - - - -
- - - -

Overview and examples

-

Use any button to trigger a dropdown menu by placing it within a .btn-group and providing the proper menu markup.

- -
-<div class="btn-group">
-  <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
-    Action
-    <span class="caret"></span>
-  </a>
-  <ul class="dropdown-menu">
-    <!-- dropdown menu links -->
-  </ul>
-</div>
-
- -

Works with all button sizes

-

Button dropdowns work at any size: .btn-large, .btn-small, or .btn-mini.

-
-
-
- - -
-
- - -
- -
-
- -

Requires JavaScript

-

Button dropdowns require the Bootstrap dropdown plugin to function.

-

In some cases—like mobile—dropdown menus will extend outside the viewport. You need to resolve the alignment manually or with custom JavaScript.

- - -
- - -

Split button dropdowns

-

Building on the button group styles and markup, we can easily create a split button. Split buttons feature a standard action on the left and a dropdown toggle on the right with contextual links.

- -
-<div class="btn-group">
-  <button class="btn">Action</button>
-  <button class="btn dropdown-toggle" data-toggle="dropdown">
-    <span class="caret"></span>
-  </button>
-  <ul class="dropdown-menu">
-    <!-- dropdown menu links -->
-  </ul>
-</div>
-
- -

Sizes

-

Utilize the extra button classes .btn-mini, .btn-small, or .btn-large for sizing.

-
-
-
- - - -
-
-
-
- - - -
-
-
-
- - - -
-
-
-
-<div class="btn-group">
-  <button class="btn btn-mini">Action</button>
-  <button class="btn btn-mini dropdown-toggle" data-toggle="dropdown">
-    <span class="caret"></span>
-  </button>
-  <ul class="dropdown-menu">
-    <!-- dropdown menu links -->
-  </ul>
-</div>
-
- -

Dropup menus

-

Dropdown menus can also be toggled from the bottom up by adding a single class to the immediate parent of .dropdown-menu. It will flip the direction of the .caret and reposition the menu itself to move from the bottom up instead of top down.

-
-
- -
- - - -
-
-
-
-<div class="btn-group dropup">
-  <button class="btn">Dropup</button>
-  <button class="btn dropdown-toggle" data-toggle="dropdown">
-    <span class="caret"></span>
-  </button>
-  <ul class="dropdown-menu">
-    <!-- dropdown menu links -->
-  </ul>
-</div>
-
- -
- - - - - - - - - - - - - - - - - - - -
- - -

Standard pagination

-

Simple pagination inspired by Rdio, great for apps and search results. The large block is hard to miss, easily scalable, and provides large click areas.

-
- -
-
-<div class="pagination">
-  <ul>
-    <li><a href="#">Prev</a></li>
-    <li><a href="#">1</a></li>
-    <li><a href="#">2</a></li>
-    <li><a href="#">3</a></li>
-    <li><a href="#">4</a></li>
-    <li><a href="#">5</a></li>
-    <li><a href="#">Next</a></li>
-  </ul>
-</div>
-
- - -
- - -

Options

- -

Disabled and active states

-

Links are customizable for different circumstances. Use .disabled for unclickable links and .active to indicate the current page.

-
- -
-
-<div class="pagination">
-  <ul>
-    <li class="disabled"><a href="#">&laquo;</a></li>
-    <li class="active"><a href="#">1</a></li>
-    ...
-  </ul>
-</div>
-
-

You can optionally swap out active or disabled anchors for spans to remove click functionality while retaining intended styles.

-
-<div class="pagination">
-  <ul>
-    <li class="disabled"><span>&laquo;</span></li>
-    <li class="active"><span>1</span></li>
-    ...
-  </ul>
-</div>
-
- -

Sizes

-

Fancy larger or smaller pagination? Add .pagination-large, .pagination-small, or .pagination-mini for additional sizes.

-
- - - - -
-
-<div class="pagination pagination-large">
-  <ul>
-    ...
-  </ul>
-</div>
-<div class="pagination">
-  <ul>
-    ...
-  </ul>
-</div>
-<div class="pagination pagination-small">
-  <ul>
-    ...
-  </ul>
-</div>
-<div class="pagination pagination-mini">
-  <ul>
-    ...
-  </ul>
-</div>
-
- -

Alignment

-

Add one of two optional classes to change the alignment of pagination links: .pagination-centered and .pagination-right.

-
- -
-
-<div class="pagination pagination-centered">
-  ...
-</div>
-
-
- -
-
-<div class="pagination pagination-right">
-  ...
-</div>
-
- - -
- - -

Pager

-

Quick previous and next links for simple pagination implementations with light markup and styles. It's great for simple sites like blogs or magazines.

- -

Default example

-

By default, the pager centers links.

-
- -
-
-<ul class="pager">
-  <li><a href="#">Previous</a></li>
-  <li><a href="#">Next</a></li>
-</ul>
-
- -

Aligned links

-

Alternatively, you can align each link to the sides:

-
- -
-
-<ul class="pager">
-  <li class="previous">
-    <a href="#">&larr; Older</a>
-  </li>
-  <li class="next">
-    <a href="#">Newer &rarr;</a>
-  </li>
-</ul>
-
- -

Optional disabled state

-

Pager links also use the general .disabled utility class from the pagination.

-
- -
-
-<ul class="pager">
-  <li class="previous disabled">
-    <a href="#">&larr; Older</a>
-  </li>
-  ...
-</ul>
-
- -
- - - - -
- -

Labels

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LabelsMarkup
- Default - - <span class="label">Default</span> -
- Success - - <span class="label label-success">Success</span> -
- Warning - - <span class="label label-warning">Warning</span> -
- Important - - <span class="label label-important">Important</span> -
- Info - - <span class="label label-info">Info</span> -
- Inverse - - <span class="label label-inverse">Inverse</span> -
- -

Badges

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExampleMarkup
- Default - - 1 - - <span class="badge">1</span> -
- Success - - 2 - - <span class="badge badge-success">2</span> -
- Warning - - 4 - - <span class="badge badge-warning">4</span> -
- Important - - 6 - - <span class="badge badge-important">6</span> -
- Info - - 8 - - <span class="badge badge-info">8</span> -
- Inverse - - 10 - - <span class="badge badge-inverse">10</span> -
- -

Easily collapsible

-

For easy implementation, labels and badges will simply collapse (via CSS's :empty selector) when no content exists within.

- -
- - - - -
- - -

Hero unit

-

A lightweight, flexible component to showcase key content on your site. It works well on marketing and content-heavy sites.

-
-
-

Hello, world!

-

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

-

Learn more

-
-
-
-<div class="hero-unit">
-  <h1>Heading</h1>
-  <p>Tagline</p>
-  <p>
-    <a class="btn btn-primary btn-large">
-      Learn more
-    </a>
-  </p>
-</div>
-
- -

Page header

-

A simple shell for an h1 to appropriately space out and segment sections of content on a page. It can utilize the h1's default small, element as well most other components (with additional styles).

-
- -
-
-<div class="page-header">
-  <h1>Example page header <small>Subtext for header</small></h1>
-</div>
-
- -
- - - - -
- - -

Default thumbnails

-

By default, Bootstrap's thumbnails are designed to showcase linked images with minimal required markup.

-
- -
- -

Highly customizable

-

With a bit of extra markup, it's possible to add any kind of HTML content like headings, paragraphs, or buttons into thumbnails.

-
-
    -
  • -
    - -
    -

    Thumbnail label

    -

    Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    -

    Action Action

    -
    -
    -
  • -
  • -
    - -
    -

    Thumbnail label

    -

    Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    -

    Action Action

    -
    -
    -
  • -
  • -
    - -
    -

    Thumbnail label

    -

    Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    -

    Action Action

    -
    -
    -
  • -
-
- -

Why use thumbnails

-

Thumbnails (previously .media-grid up until v1.4) are great for grids of photos or videos, image search results, retail products, portfolios, and much more. They can be links or static content.

- -

Simple, flexible markup

-

Thumbnail markup is simple—a ul with any number of li elements is all that is required. It's also super flexible, allowing for any type of content with just a bit more markup to wrap your contents.

- -

Uses grid column sizes

-

Lastly, the thumbnails component uses existing grid system classes—like .span2 or .span3—for control of thumbnail dimensions.

- -

Markup

-

As mentioned previously, the required markup for thumbnails is light and straightforward. Here's a look at the default setup for linked images:

-
-<ul class="thumbnails">
-  <li class="span4">
-    <a href="#" class="thumbnail">
-      <img data-src="holder.js/300x200" alt="">
-    </a>
-  </li>
-  ...
-</ul>
-
-

For custom HTML content in thumbnails, the markup changes slightly. To allow block level content anywhere, we swap the <a> for a <div> like so:

-
-<ul class="thumbnails">
-  <li class="span4">
-    <div class="thumbnail">
-      <img data-src="holder.js/300x200" alt="">
-      <h3>Thumbnail label</h3>
-      <p>Thumbnail caption...</p>
-    </div>
-  </li>
-  ...
-</ul>
-
- -

More examples

-

Explore all your options with the various grid classes available to you. You can also mix and match different sizes.

- - -
- - - - - -
- - -

Default alert

-

Wrap any text and an optional dismiss button in .alert for a basic warning alert message.

-
-
- - Warning! Best check yo self, you're not looking too good. -
-
-
-<div class="alert">
-  <button type="button" class="close" data-dismiss="alert">&times;</button>
-  <strong>Warning!</strong> Best check yo self, you're not looking too good.
-</div>
-
- -

Dismiss buttons

-

Mobile Safari and Mobile Opera browsers, in addition to the data-dismiss="alert" attribute, require an href="#" for the dismissal of alerts when using an <a> tag.

-
<a href="#" class="close" data-dismiss="alert">&times;</a>
-

Alternatively, you may use a <button> element with the data attribute, which we have opted to do for our docs. When using <button>, you must include type="button" or your forms may not submit.

-
<button type="button" class="close" data-dismiss="alert">&times;</button>
- -

Dismiss alerts via JavaScript

-

Use the alerts jQuery plugin for quick and easy dismissal of alerts.

- - -
- - -

Options

-

For longer messages, increase the padding on the top and bottom of the alert wrapper by adding .alert-block.

-
-
- -

Warning!

-

Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

-
-
-
-<div class="alert alert-block">
-  <button type="button" class="close" data-dismiss="alert">&times;</button>
-  <h4>Warning!</h4>
-  Best check yo self, you're not...
-</div>
-
- - -
- - -

Contextual alternatives

-

Add optional classes to change an alert's connotation.

- -

Error or danger

-
-
- - Oh snap! Change a few things up and try submitting again. -
-
-
-<div class="alert alert-error">
-  ...
-</div>
-
- -

Success

-
-
- - Well done! You successfully read this important alert message. -
-
-
-<div class="alert alert-success">
-  ...
-</div>
-
- -

Information

-
-
- - Heads up! This alert needs your attention, but it's not super important. -
-
-
-<div class="alert alert-info">
-  ...
-</div>
-
- -
- - - - - -
- - -

Examples and markup

- -

Basic

-

Default progress bar with a vertical gradient.

-
-
-
-
-
-
-<div class="progress">
-  <div class="bar" style="width: 60%;"></div>
-</div>
-
- -

Striped

-

Uses a gradient to create a striped effect. Not available in IE7-8.

-
-
-
-
-
-
-<div class="progress progress-striped">
-  <div class="bar" style="width: 20%;"></div>
-</div>
-
- -

Animated

-

Add .active to .progress-striped to animate the stripes right to left. Not available in all versions of IE.

-
-
-
-
-
-
-<div class="progress progress-striped active">
-  <div class="bar" style="width: 40%;"></div>
-</div>
-
- -

Stacked

-

Place multiple bars into the same .progress to stack them.

-
-
-
-
-
-
-
-
-<div class="progress">
-  <div class="bar bar-success" style="width: 35%;"></div>
-  <div class="bar bar-warning" style="width: 20%;"></div>
-  <div class="bar bar-danger" style="width: 10%;"></div>
-</div>
-
- - -
- - -

Options

- -

Additional colors

-

Progress bars use some of the same button and alert classes for consistent styles.

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<div class="progress progress-info">
-  <div class="bar" style="width: 20%"></div>
-</div>
-<div class="progress progress-success">
-  <div class="bar" style="width: 40%"></div>
-</div>
-<div class="progress progress-warning">
-  <div class="bar" style="width: 60%"></div>
-</div>
-<div class="progress progress-danger">
-  <div class="bar" style="width: 80%"></div>
-</div>
-
- -

Striped bars

-

Similar to the solid colors, we have varied striped progress bars.

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<div class="progress progress-info progress-striped">
-  <div class="bar" style="width: 20%"></div>
-</div>
-<div class="progress progress-success progress-striped">
-  <div class="bar" style="width: 40%"></div>
-</div>
-<div class="progress progress-warning progress-striped">
-  <div class="bar" style="width: 60%"></div>
-</div>
-<div class="progress progress-danger progress-striped">
-  <div class="bar" style="width: 80%"></div>
-</div>
-
- - -
- - -

Browser support

-

Progress bars use CSS3 gradients, transitions, and animations to achieve all their effects. These features are not supported in IE7-9 or older versions of Firefox.

-

Versions earlier than Internet Explorer 10 and Opera 12 do not support animations.

- -
- - - - - -
- -

Abstract object styles for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content.

- -

Default example

-

The default media allow to float a media object (images, video, audio) to the left or right of a content block.

-
-
- - - -
-

Media heading

- Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. -
-
-
- - - -
-

Media heading

- Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. -
- - - -
-

Media heading

- Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. -
-
-
-
-
-
-<div class="media">
-  <a class="pull-left" href="#">
-    <img class="media-object" data-src="holder.js/64x64">
-  </a>
-  <div class="media-body">
-    <h4 class="media-heading">Media heading</h4>
-    ...
-
-    <!-- Nested media object -->
-    <div class="media">
-      ...
-    </div>
-  </div>
-</div>
-
- - -
- - -

Media list

-

With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).

-
-
    -
  • - - - -
    -

    Media heading

    -

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.

    - -
    - - - -
    -

    Nested media heading

    - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. - -
    - - - -
    -

    Nested media heading

    - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. -
    -
    -
    -
    - -
    - - - -
    -

    Nested media heading

    - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. -
    -
    -
    -
  • -
  • - - - -
    -

    Media heading

    - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. -
    -
  • -
-
-
-<ul class="media-list">
-  <li class="media">
-    <a class="pull-left" href="#">
-      <img class="media-object" data-src="holder.js/64x64">
-    </a>
-    <div class="media-body">
-      <h4 class="media-heading">Media heading</h4>
-      ...
-
-      <!-- Nested media object -->
-      <div class="media">
-        ...
-     </div>
-    </div>
-  </li>
-</ul>
-
- -
- - - - - - -
- - -

Wells

-

Use the well as a simple effect on an element to give it an inset effect.

-
-
- Look, I'm in a well! -
-
-
-<div class="well">
-  ...
-</div>
-
-

Optional classes

-

Control padding and rounded corners with two optional modifier classes.

-
-
- Look, I'm in a well! -
-
-
-<div class="well well-large">
-  ...
-</div>
-
-
-
- Look, I'm in a well! -
-
-
-<div class="well well-small">
-  ...
-</div>
-
- -

Close icon

-

Use the generic close icon for dismissing content like modals and alerts.

-
-

-
-
<button class="close">&times;</button>
-

iOS devices require an href="#" for click events if you would rather use an anchor.

-
<a class="close" href="#">&times;</a>
- -

Helper classes

-

Simple, focused classes for small display or behavior tweaks.

- -

.pull-left

-

Float an element left

-
-class="pull-left"
-
-
-.pull-left {
-  float: left;
-}
-
- -

.pull-right

-

Float an element right

-
-class="pull-right"
-
-
-.pull-right {
-  float: right;
-}
-
- -

.muted

-

Change an element's color to #999

-
-class="muted"
-
-
-.muted {
-  color: #999;
-}
-
- -

.clearfix

-

Clear the float on any element

-
-class="clearfix"
-
-
-.clearfix {
-  *zoom: 1;
-  &:before,
-  &:after {
-    display: table;
-    content: "";
-  }
-  &:after {
-    clear: both;
-  }
-}
-
- -
- - - -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/customize.html b/docs/customize.html deleted file mode 100644 index a3c6ec688758..000000000000 --- a/docs/customize.html +++ /dev/null @@ -1,514 +0,0 @@ - - - - - Customize · Bootstrap - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

Customize and download

-

Download Bootstrap or customize variables, components, JavaScript plugins, and more.

-
-
- - -
- - -
- -
- - - -
-
- -
-
-

Scaffolding

- - - - -

Base CSS

- - - - - - - -
-
-

Components

- - - - - - - - - - - -

JS Components

- - - - - - -
-
-

Miscellaneous

- - - - -

Responsive

- - - - - -
-
-
- -
- -
-
- - - - - - - -
-
- - - - - - -
-
-

Heads up!

-

All checked plugins will be compiled into a single file, bootstrap.js. All plugins require the latest version of jQuery to be included.

-
-
-
- - -
- -
-
-

Scaffolding

- - - - - -

Links

- - - - -

Colors

- - - - - - - - - - - - - - - -

Sprites

- - - - - -

Grid system

- - - - - - - - - - - - - - - -
-
- -

Typography

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Tables

- - - - - - - - - -

Forms

- - - - - - - - - - - - - - - - - -
-
- -

Form states & alerts

- - - - - - - - - - - - - - - - - -

Navbar

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Dropdowns

- - - - - - - - - - -
-
-
- -
- -
- Customize and Download -

What's included?

-

Downloads include compiled CSS, compiled and minified CSS, and compiled jQuery plugins, all nicely packed up into a zipball for your convenience.

-
-
-
- - - -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/examples/carousel.html b/docs/examples/carousel.html deleted file mode 100644 index 81d1a28a180b..000000000000 --- a/docs/examples/carousel.html +++ /dev/null @@ -1,454 +0,0 @@ - - - - - Carousel Template · Bootstrap - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
- -

Heading

-

Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

-

View details »

-
-
- -

Heading

-

Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

-

View details »

-
-
- -

Heading

-

Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

-

View details »

-
-
- - - - -
- -
- -

First featurette headling. It'll blow your mind.

-

Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.

-
- -
- -
- -

Oh yeah, it's that good. See for yourself.

-

Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.

-
- -
- -
- -

And lastly, this one. Checkmate.

-

Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.

-
- -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/examples/fluid.html b/docs/examples/fluid.html deleted file mode 100644 index 502062a2737f..000000000000 --- a/docs/examples/fluid.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - Bootstrap, from Twitter - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- -
-
-
-

Hello, world!

-

This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.

-

Learn more »

-
-
-
-

Heading

-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

-

View details »

-
-
-

Heading

-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

-

View details »

-
-
-

Heading

-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

-

View details »

-
-
-
-
-

Heading

-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

-

View details »

-
-
-

Heading

-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

-

View details »

-
-
-

Heading

-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

-

View details »

-
-
-
-
- -
- -
-

© Company 2013

-
- -
- - - - - - - - - - - - - - - - - - - diff --git a/docs/examples/hero.html b/docs/examples/hero.html deleted file mode 100644 index 6fb7a2c4e01f..000000000000 --- a/docs/examples/hero.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - Bootstrap, from Twitter - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-

Hello, world!

-

This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.

-

Learn more »

-
- - -
-
-

Heading

-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

-

View details »

-
-
-

Heading

-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

-

View details »

-
-
-

Heading

-

Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

-

View details »

-
-
- -
- -
-

© Company 2013

-
- -
- - - - - - - - - - - - - - - - - - - diff --git a/docs/examples/justified-nav.html b/docs/examples/justified-nav.html deleted file mode 100644 index ef8f8d428671..000000000000 --- a/docs/examples/justified-nav.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - Template · Bootstrap - - - - - - - - - - - - - - - - - - - - - - -
- -
-

Project name

- -
- - -
-

Marketing stuff!

-

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

- Get started today -
- -
- - -
-
-

Heading

-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

-

View details »

-
-
-

Heading

-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

-

View details »

-
-
-

Heading

-

Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa.

-

View details »

-
-
- -
- - - -
- - - - - - - - - - - - - - - - - - - diff --git a/docs/examples/marketing-narrow.html b/docs/examples/marketing-narrow.html deleted file mode 100644 index f6f5d1685122..000000000000 --- a/docs/examples/marketing-narrow.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - - Template · Bootstrap - - - - - - - - - - - - - - - - - - - - - - -
- -
- -

Project name

-
- -
- -
-

Super awesome marketing speak!

-

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

- Sign up today -
- -
- -
-
-

Subheading

-

Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.

- -

Subheading

-

Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.

- -

Subheading

-

Maecenas sed diam eget risus varius blandit sit amet non magna.

-
- -
-

Subheading

-

Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.

- -

Subheading

-

Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.

- -

Subheading

-

Maecenas sed diam eget risus varius blandit sit amet non magna.

-
-
- -
- - - -
- - - - - - - - - - - - - - - - - - - diff --git a/docs/examples/signin.html b/docs/examples/signin.html deleted file mode 100644 index 031052789da0..000000000000 --- a/docs/examples/signin.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - Sign in · Twitter Bootstrap - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - diff --git a/docs/examples/starter-template.html b/docs/examples/starter-template.html deleted file mode 100644 index 29c47a89c9c6..000000000000 --- a/docs/examples/starter-template.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - Bootstrap, from Twitter - - - - - - - - - - - - - - - - - - - - - - - - -
- -

Bootstrap starter template

-

Use this document as a way to quick start any new project.
All you get is this message and a barebones HTML document.

- -
- - - - - - - - - - - - - - - - - - - diff --git a/docs/examples/sticky-footer-navbar.html b/docs/examples/sticky-footer-navbar.html deleted file mode 100644 index a9027c8c2809..000000000000 --- a/docs/examples/sticky-footer-navbar.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - - Sticky footer · Twitter Bootstrap - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
- -

Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS. A fixed navbar has been added within #wrap with padding-top: 60px; on the .container.

-

Back to the sticky footer minus the navbar.

-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/examples/sticky-footer.html b/docs/examples/sticky-footer.html deleted file mode 100644 index d307d79387f2..000000000000 --- a/docs/examples/sticky-footer.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - Sticky footer · Twitter Bootstrap - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- -

Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS.

-

Use the sticky footer with a fixed navbar if need be, too.

-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/extend.html b/docs/extend.html deleted file mode 100644 index 592812934491..000000000000 --- a/docs/extend.html +++ /dev/null @@ -1,282 +0,0 @@ - - - - - Extend · Bootstrap - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

Extending Bootstrap

-

Extend Bootstrap to take advantage of included styles and components, as well as LESS variables and mixins.

-
-
- -
- - -
- -
- - - - -
- - - LESS CSS -

Bootstrap is made with LESS at its core, a dynamic stylesheet language created by our good friend, Alexis Sellier. It makes developing systems-based CSS faster, easier, and more fun.

- -

Why LESS?

-

One of Bootstrap's creators wrote a quick blog post about this, summarized here:

-
    -
  • Bootstrap compiles faster ~6x faster with Less compared to Sass
  • -
  • Less is written in JavaScript, making it easier to us to dive in and patch compared to Ruby with Sass.
  • -
  • Less is more; we want to feel like we're writing CSS and making Bootstrap approachable to all.
  • -
- -

What's included?

-

As an extension of CSS, LESS includes variables, mixins for reusable snippets of code, operations for simple math, nesting, and even color functions.

- -

Learn more

-

Visit the official website at http://lesscss.org to learn more.

-
- - - - -
- - -

Since our CSS is written with Less and utilizes variables and mixins, it needs to be compiled for final production implementation. Here's how.

- -
- Note: If you're submitting a pull request to GitHub with modified CSS, you must recompile the CSS via any of these methods. -
- -

Tools for compiling

- -

Command line

-

Follow the instructions in the project readme on GitHub for compiling via command line.

- -

JavaScript

-

Download the latest Less.js and include the path to it (and Bootstrap) in the <head>.

-
-<link rel="stylesheet/less" href="/path/to/bootstrap.less">
-<script src="/path/to/less.js"></script>
-
-

To recompile the .less files, just save them and reload your page. Less.js compiles them and stores them in local storage.

- -

Unofficial Mac app

-

The unofficial Mac app watches directories of .less files and compiles the code to local files after every save of a watched .less file. If you like, you can toggle preferences in the app for automatic minifying and which directory the compiled files end up in.

- -

More apps

-

Crunch

-

Crunch is a great looking LESS editor and compiler built on Adobe Air.

-

CodeKit

-

Created by the same guy as the unofficial Mac app, CodeKit is a Mac app that compiles LESS, SASS, Stylus, and CoffeeScript.

-

Simpless

-

Mac, Linux, and Windows app for drag and drop compiling of LESS files. Plus, the source code is on GitHub.

- -
- - - - -
- -

Quickly start any web project by dropping in the compiled or minified CSS and JS. Layer on custom styles separately for easy upgrades and maintenance moving forward.

- -

Setup file structure

-

Download the latest compiled Bootstrap and place into your project. For example, you might have something like this:

-
-   app/
-       layouts/
-       templates/
-   public/
-       css/
-           bootstrap.min.css
-       js/
-           bootstrap.min.js
-       img/
-           glyphicons-halflings.png
-           glyphicons-halflings-white.png
-
- -

Utilize starter template

-

Copy the following base HTML to get started.

-
-<html>
-  <head>
-    <title>Bootstrap 101 Template</title>
-    <!-- Bootstrap -->
-    <link href="public/css/bootstrap.min.css" rel="stylesheet">
-  </head>
-  <body>
-    <h1>Hello, world!</h1>
-    <!-- Bootstrap -->
-    <script src="public/js/bootstrap.min.js"></script>
-  </body>
-</html>
-
- -

Layer on custom code

-

Work in your custom CSS, JS, and more as necessary to make Bootstrap your own with your own separate CSS and JS files.

-
-<html>
-  <head>
-    <title>Bootstrap 101 Template</title>
-    <!-- Bootstrap -->
-    <link href="public/css/bootstrap.min.css" rel="stylesheet">
-    <!-- Project -->
-    <link href="public/css/application.css" rel="stylesheet">
-  </head>
-  <body>
-    <h1>Hello, world!</h1>
-    <!-- Bootstrap -->
-    <script src="public/js/bootstrap.min.js"></script>
-    <!-- Project -->
-    <script src="public/js/application.js"></script>
-  </body>
-</html>
-
- -
- -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/getting-started.html b/docs/getting-started.html deleted file mode 100644 index c54da9a67f73..000000000000 --- a/docs/getting-started.html +++ /dev/null @@ -1,377 +0,0 @@ - - - - - Getting · Bootstrap - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

Getting started

-

Overview of the project, its contents, and how to get started with a simple template.

-
-
- - -
- - -
- -
- - - - -
- -

Before downloading, be sure to have a code editor (we recommend Sublime Text 2) and some working knowledge of HTML and CSS. We won't walk through the source files here, but they are available for download. We'll focus on getting started with the compiled Bootstrap files.

- -
-
-

Download compiled

-

Fastest way to get started: get the compiled and minified versions of our CSS, JS, and images. No docs or original source files.

-

Download Bootstrap

-
-
-

Download source

-

Get the original files for all CSS and JavaScript, along with a local copy of the docs by downloading the latest version directly from GitHub.

-

Download Bootstrap source

-
-
-
- - - - -
- -

Within the download you'll find the following file structure and contents, logically grouping common assets and providing both compiled and minified variations.

-

Once downloaded, unzip the compressed folder to see the structure of (the compiled) Bootstrap. You'll see something like this:

-
-  bootstrap/
-  ├── css/
-  │   ├── bootstrap.css
-  │   ├── bootstrap.min.css
-  ├── js/
-  │   ├── bootstrap.js
-  │   ├── bootstrap.min.js
-  └── img/
-      ├── glyphicons-halflings.png
-      └── glyphicons-halflings-white.png
-
-

This is the most basic form of Bootstrap: compiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (bootstrap.*), as well as compiled and minified CSS and JS (bootstrap.min.*). The image files are compressed using ImageOptim, a Mac app for compressing PNGs.

-

Please note that all JavaScript plugins require jQuery to be included.

-
- - - - -
- -

Bootstrap comes equipped with HTML, CSS, and JS for all sorts of things, but they can be summarized with a handful of categories visible at the top of the Bootstrap documentation.

- -

Docs sections

-

Scaffolding

-

Global styles for the body to reset type and background, link styles, grid system, and two simple layouts.

-

Base CSS

-

Styles for common HTML elements like typography, code, tables, forms, and buttons. Also includes Glyphicons, a great little icon set.

-

Components

-

Basic styles for common interface components like tabs and pills, navbar, alerts, page headers, and more.

-

JavaScript plugins

-

Similar to Components, these JavaScript plugins are interactive components for things like tooltips, popovers, modals, and more.

- -

List of components

-

Together, the Components and JavaScript plugins sections provide the following interface elements:

-
    -
  • Button groups
  • -
  • Button dropdowns
  • -
  • Navigational tabs, pills, and lists
  • -
  • Navbar
  • -
  • Labels
  • -
  • Badges
  • -
  • Page headers and hero unit
  • -
  • Thumbnails
  • -
  • Alerts
  • -
  • Progress bars
  • -
  • Modals
  • -
  • Dropdowns
  • -
  • Tooltips
  • -
  • Popovers
  • -
  • Accordion
  • -
  • Carousel
  • -
  • Typeahead
  • -
-

In future guides, we may walk through these components individually in more detail. Until then, look for each of these in the documentation for information on how to utilize and customize them.

-
- - - - -
- -

With a brief intro into the contents out of the way, we can focus on putting Bootstrap to use. To do that, we'll utilize a basic HTML template that includes everything we mentioned in the File structure.

-

Now, here's a look at a typical HTML file:

-
-<!DOCTYPE html>
-<html>
-  <head>
-    <title>Bootstrap 101 Template</title>
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  </head>
-  <body>
-    <h1>Hello, world!</h1>
-    <script src="http://code.jquery.com/jquery.js"></script>
-  </body>
-</html>
-
-

To make this a Bootstrapped template, just include the appropriate CSS and JS files:

-
-<!DOCTYPE html>
-<html>
-  <head>
-    <title>Bootstrap 101 Template</title>
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <!-- Bootstrap -->
-    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
-  </head>
-  <body>
-    <h1>Hello, world!</h1>
-    <script src="http://code.jquery.com/jquery.js"></script>
-    <script src="js/bootstrap.min.js"></script>
-  </body>
-</html>
-
-

And you're set! With those two files added, you can begin to develop any site or application with Bootstrap.

-
- - - - -
- -

Move beyond the base template with a few example layouts. We encourage folks to iterate on these examples and not simply use them as an end result.

-
    -
  • - - - -

    Starter template

    -

    A barebones HTML document with all the Bootstrap CSS and JavaScript included.

    -
  • -
  • - - - -

    Basic marketing site

    -

    Featuring a hero unit for a primary message and three supporting elements.

    -
  • -
  • - - - -

    Fluid layout

    -

    Uses our new responsive, fluid grid system to create a seamless liquid layout.

    -
  • - -
  • - - - -

    Narrow marketing

    -

    Slim, lightweight marketing template for small projects or teams.

    -
  • -
  • - - - -

    Justified nav

    -

    Marketing page with equal-width navigation links in a modified navbar.

    -
  • -
  • - - - -

    Sign in

    -

    Barebones sign in form with custom, larger form controls and a flexible layout.

    -
  • - -
  • - - - -

    Sticky footer

    -

    Pin a fixed-height footer to the bottom of the user's viewport.

    -
  • -
  • - - - -

    Carousel jumbotron

    -

    A more interactive riff on the basic marketing site featuring a prominent carousel.

    -
  • -
-
- - - - - -
- -

Head to the docs for information, examples, and code snippets, or take the next leap and customize Bootstrap for any upcoming project.

- Visit the Bootstrap docs - Customize Bootstrap -
- - - - -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 1040bcf6be31..000000000000 --- a/docs/index.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - Bootstrap - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

Bootstrap

-

Sleek, intuitive, and powerful front-end framework for faster and easier web development.

-

- Download Bootstrap -

- -
-
- -
-
- -
-
- -
- -
- -

Introducing Bootstrap.

- - -
-
- -

By nerds, for nerds.

-

Built at Twitter by @mdo and @fat, Bootstrap utilizes LESS CSS, is compiled via Node, and is managed through GitHub to help nerds do awesome stuff on the web.

-
-
- -

Made for everyone.

-

Bootstrap was made to not only look and behave great in the latest desktop browsers (as well as IE7!), but in tablet and smartphone browsers via responsive CSS as well.

-
-
- -

Packed with features.

-

A 12-column responsive grid, dozens of components, JavaScript plugins, typography, form controls, and even a web-based Customizer to make Bootstrap your own.

-
-
- -
- -

Built with Bootstrap.

- -
- -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/javascript.html b/docs/javascript.html deleted file mode 100644 index f4957d91cf9e..000000000000 --- a/docs/javascript.html +++ /dev/null @@ -1,1780 +0,0 @@ - - - - - Javascript · Bootstrap - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

JavaScript

-

Bring Bootstrap's components to life—now with 13 custom jQuery plugins. -

-
- -
- - -
- -
- - - -
- - -

Individual or compiled

-

Plugins can be included individually (though some have required dependencies), or all at once. Both bootstrap.js and bootstrap.min.js contain all plugins in a single file.

- -

Data attributes

-

You can use all Bootstrap plugins purely through the markup API without writing a single line of JavaScript. This is Bootstrap's first class API and should be your first consideration when using a plugin.

- -

That said, in some situations it may be desirable to turn this functionality off. Therefore, we also provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this: -

$('body').off('.data-api')
- -

Alternatively, to target a specific plugin, just include the plugin's name as a namespace along with the data-api namespace like this:

-
$('body').off('.alert.data-api')
- -

Programmatic API

-

We also believe you should be able to use all Bootstrap plugins purely through the JavaScript API. All public APIs are single, chainable methods, and return the collection acted upon.

-
$(".btn.danger").button("toggle").addClass("fat")
-

All methods should accept an optional options object, a string which targets a particular method, or nothing (which initiates a plugin with default behavior):

-
-$("#myModal").modal()                       // initialized with defaults
-$("#myModal").modal({ keyboard: false })   // initialized with no keyboard
-$("#myModal").modal('show')                // initializes and invokes show immediately

-
-

Each plugin also exposes its raw constructor on a `Constructor` property: $.fn.popover.Constructor. If you'd like to get a particular plugin instance, retrieve it directly from an element: $('[rel=popover]').data('popover').

- -

No Conflict

-

Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. If this happens, you may call .noConflict on the plugin you wish to revert the value of.

- -
-var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
-$.fn.bootstrapBtn = bootstrapButton            // give $().bootstrapBtn the bootstrap functionality
-
- -

Events

-

Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. show) is triggered at the start of an event, and its past participle form (ex. shown) is trigger on the completion of an action.

-

All infinitive events provide preventDefault functionality. This provides the ability to stop the execution of an action before it starts.

-
-$('#myModal').on('show', function (e) {
-    if (!data) return e.preventDefault() // stops modal from being shown
-})
-
-
- - - - -
- -

About transitions

-

For simple transition effects, include bootstrap-transition.js once alongside the other JS files. If you're using the compiled (or minified) bootstrap.js, there is no need to include this—it's already there.

-

Use cases

-

A few examples of the transition plugin:

-
    -
  • Sliding or fading in modals
  • -
  • Fading out tabs
  • -
  • Fading out alerts
  • -
  • Sliding carousel panes
  • -
- -
- - - - -
- - - -

Examples

-

Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.

- -

Static example

-

A rendered modal with header, body, and set of actions in the footer.

-
- -
-
-<div class="modal hide fade">
-  <div class="modal-header">
-    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
-    <h3>Modal header</h3>
-  </div>
-  <div class="modal-body">
-    <p>One fine body…</p>
-  </div>
-  <div class="modal-footer">
-    <a href="#" class="btn">Close</a>
-    <a href="#" class="btn btn-primary">Save changes</a>
-  </div>
-</div>
-
- -

Live demo

-

Toggle a modal via JavaScript by clicking the button below. It will slide down and fade in from the top of the page.

- - - -
-<!-- Button to trigger modal -->
-<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>
-
-<!-- Modal -->
-<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
-  <div class="modal-header">
-    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
-    <h3 id="myModalLabel">Modal header</h3>
-  </div>
-  <div class="modal-body">
-    <p>One fine body…</p>
-  </div>
-  <div class="modal-footer">
-    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
-    <button class="btn btn-primary">Save changes</button>
-  </div>
-</div>
-
- - -
- - -

Usage

- -

Via data attributes

-

Activate a modal without writing JavaScript. Set data-toggle="modal" on a controller element, like a button, along with a data-target="#foo" or href="#foo" to target a specific modal to toggle.

-
<button type="button" data-toggle="modal" data-target="#myModal">Launch modal</button>
- -

Via JavaScript

-

Call a modal with id myModal with a single line of JavaScript:

-
$('#myModal').modal(options)
- -

Options

-

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-backdrop="".

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nametypedefaultdescription
backdropbooleantrueIncludes a modal-backdrop element. Alternatively, specify static for a backdrop which doesn't close the modal on click.
keyboardbooleantrueCloses the modal when escape key is pressed
showbooleantrueShows the modal when initialized.
remotepathfalse

If a remote url is provided, content will be loaded via jQuery's load method and injected into the .modal-body. If you're using the data api, you may alternatively use the href tag to specify the remote source. An example of this is shown below:

-
<a data-toggle="modal" href="remote.html" data-target="#modal">click me</a>
- -

Methods

-

.modal(options)

-

Activates your content as a modal. Accepts an optional options object.

-
-$('#myModal').modal({
-  keyboard: false
-})
-
-

.modal('toggle')

-

Manually toggles a modal.

-
$('#myModal').modal('toggle')
-

.modal('show')

-

Manually opens a modal.

-
$('#myModal').modal('show')
-

.modal('hide')

-

Manually hides a modal.

-
$('#myModal').modal('hide')
-

Events

-

Bootstrap's modal class exposes a few events for hooking into modal functionality.

- - - - - - - - - - - - - - - - - - - - - - - - - -
EventDescription
showThis event fires immediately when the show instance method is called.
shownThis event is fired when the modal has been made visible to the user (will wait for css transitions to complete).
hideThis event is fired immediately when the hide instance method has been called.
hiddenThis event is fired when the modal has finished being hidden from the user (will wait for css transitions to complete).
-
-$('#myModal').on('hidden', function () {
-  // do something…
-})
-
-
- - - - - - - - - -
- - - -

Example in navbar

-

The ScrollSpy plugin is for automatically updating nav targets based on scroll position. Scroll the area below the navbar and watch the active class change. The dropdown sub items will be highlighted as well.

-
- -
-

@fat

-

Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.

-

@mdo

-

Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard. Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi, ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar deserunt.

-

one

-

Occaecat commodo aliqua delectus. Fap craft beer deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, sustainable delectus consectetur fanny pack iphone.

-

two

-

In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt.

-

three

-

Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.

-

Keytar twee blog, culpa messenger bag marfa whatever delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats you probably haven't heard of them consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat before they sold out, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats. -

-
-
- - -
- - -

Usage

- -

Via data attributes

-

To easily add scrollspy behavior to your topbar navigation, just add data-spy="scroll" to the element you want to spy on (most typically this would be the body) and data-target=".navbar" to select which nav to use. You'll want to use scrollspy with a .nav component.

-
<body data-spy="scroll" data-target=".navbar">...</body>
- -

Via JavaScript

-

Call the scrollspy via JavaScript:

-
$('#navbar').scrollspy()
- -
- Heads up! - Navbar links must have resolvable id targets. For example, a <a href="#home">home</a> must correspond to something in the dom like <div id="home"></div>. -
- -

Methods

-

.scrollspy('refresh')

-

When using scrollspy in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh method like so:

-
-$('[data-spy="scroll"]').each(function () {
-  var $spy = $(this).scrollspy('refresh')
-});
-
- -

Options

-

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-offset="".

- - - - - - - - - - - - - - - - - -
Nametypedefaultdescription
offsetnumber10Pixels to offset from top when calculating position of scroll.
- -

Events

- - - - - - - - - - - - - -
EventDescription
activateThis event fires whenever a new item becomes activated by the scrollspy.
-
- - - - -
- - - -

Example tabs

-

Add quick, dynamic tab functionality to transition through panes of local content, even via dropdown menus.

-
- -
-
-

Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

-
-
-

Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

-
- - -
-
- - -
- - -

Usage

-

Enable tabbable tabs via JavaScript (each tab needs to be activated individually):

-
-$('#myTab a').click(function (e) {
-  e.preventDefault();
-  $(this).tab('show');
-})
-

You can activate individual tabs in several ways:

-
-$('#myTab a[href="#profile"]').tab('show'); // Select tab by name
-$('#myTab a:first').tab('show'); // Select first tab
-$('#myTab a:last').tab('show'); // Select last tab
-$('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
-
- -

Markup

-

You can activate a tab or pill navigation without writing any JavaScript by simply specifying data-toggle="tab" or data-toggle="pill" on an element. Adding the nav and nav-tabs classes to the tab ul will apply the Bootstrap tab styling.

-
-<ul class="nav nav-tabs">
-  <li><a href="#home" data-toggle="tab">Home</a></li>
-  <li><a href="#profile" data-toggle="tab">Profile</a></li>
-  <li><a href="#messages" data-toggle="tab">Messages</a></li>
-  <li><a href="#settings" data-toggle="tab">Settings</a></li>
-</ul>
- -

Methods

-

$().tab

-

- Activates a tab element and content container. Tab should have either a data-target or an href targeting a container node in the DOM. -

-
-<ul class="nav nav-tabs" id="myTab">
-  <li class="active"><a href="#home">Home</a></li>
-  <li><a href="#profile">Profile</a></li>
-  <li><a href="#messages">Messages</a></li>
-  <li><a href="#settings">Settings</a></li>
-</ul>
-
-<div class="tab-content">
-  <div class="tab-pane active" id="home">...</div>
-  <div class="tab-pane" id="profile">...</div>
-  <div class="tab-pane" id="messages">...</div>
-  <div class="tab-pane" id="settings">...</div>
-</div>
-
-<script>
-  $(function () {
-    $('#myTab a:last').tab('show');
-  })
-</script>
-
- -

Events

- - - - - - - - - - - - - - - - - -
EventDescription
showThis event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
shownThis event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
-
-$('a[data-toggle="tab"]').on('shown', function (e) {
-  e.target // activated tab
-  e.relatedTarget // previous tab
-})
-
-
- - - -
- - - -

Examples

-

Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage.

-

For performance reasons, the tooltip and popover data-apis are opt in, meaning you must initialize them yourself.

-

Hover over the links below to see tooltips:

-
-

Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral. -

-
- -

Four directions

- - - -

Tooltips in input groups

-

When using tooltips and popovers with the Bootstrap input groups, you'll have to set the container (documented below) option to avoid unwanted side effects.

- -
- - -

Usage

-

Trigger the tooltip via JavaScript:

-
$('#example').tooltip(options)
- -

Options

-

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
htmlbooleanfalseInsert html into the tooltip. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
placementstring | function'top'how to position the tooltip - top | bottom | left | right
selectorstringfalseIf a selector is provided, tooltip objects will be delegated to the specified targets.
titlestring | function''default title value if `title` tag isn't present
triggerstring'hover focus'how tooltip is triggered - click | hover | focus | manual. Note you case pass trigger mutliple, space seperated, trigger types.
delaynumber | object0 -

delay showing and hiding the tooltip (ms) - does not apply to manual trigger type

-

If a number is supplied, delay is applied to both hide/show

-

Object structure is: delay: { show: 500, hide: 100 }

-
containerstring | falsefalse -

Appends the tooltip to a specific element container: 'body'

-
-
- Heads up! - Options for individual tooltips can alternatively be specified through the use of data attributes. -
- -

Markup

-
<a href="#" data-toggle="tooltip" title="first tooltip">hover over me</a>
- -

Methods

-

$().tooltip(options)

-

Attaches a tooltip handler to an element collection.

-

.tooltip('show')

-

Reveals an element's tooltip.

-
$('#element').tooltip('show')
-

.tooltip('hide')

-

Hides an element's tooltip.

-
$('#element').tooltip('hide')
-

.tooltip('toggle')

-

Toggles an element's tooltip.

-
$('#element').tooltip('toggle')
-

.tooltip('destroy')

-

Hides and destroys an element's tooltip.

-
$('#element').tooltip('destroy')
-
- - - - -
- - -

Examples

-

Add small overlays of content, like those on the iPad, to any element for housing secondary information. Hover over the button to trigger the popover. Requires Tooltip to be included.

- -

Static popover

-

Four options are available: top, right, bottom, and left aligned.

-
-
-
-

Popover top

-
-

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

-
-
- -
-
-

Popover right

-
-

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

-
-
- -
-
-

Popover bottom

-
-

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

-
-
- -
-
-

Popover left

-
-

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

-
-
- -
-
-

No markup shown as popovers are generated from JavaScript and content within a data attribute.

- -

Live demo

- - -

Four directions

- - - -
- - -

Usage

-

Enable popovers via JavaScript:

-
$('#example').popover(options)
- -

Options

-

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nametypedefaultdescription
animationbooleantrueapply a css fade transition to the tooltip
htmlbooleanfalseInsert html into the popover. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
placementstring | function'right'how to position the popover - top | bottom | left | right
selectorstringfalseif a selector is provided, tooltip objects will be delegated to the specified targets
triggerstring'click'how popover is triggered - click | hover | focus | manual
titlestring | function''default title value if `title` attribute isn't present
contentstring | function''default content value if `data-content` attribute isn't present
delaynumber | object0 -

delay showing and hiding the popover (ms) - does not apply to manual trigger type

-

If a number is supplied, delay is applied to both hide/show

-

Object structure is: delay: { show: 500, hide: 100 }

-
containerstring | falsefalse -

Appends the popover to a specific element container: 'body'

-
-
- Heads up! - Options for individual popovers can alternatively be specified through the use of data attributes. -
- -

Markup

-

For performance reasons, the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a selector option.

- -

Methods

-

$().popover(options)

-

Initializes popovers for an element collection.

-

.popover('show')

-

Reveals an elements popover.

-
$('#element').popover('show')
-

.popover('hide')

-

Hides an elements popover.

-
$('#element').popover('hide')
-

.popover('toggle')

-

Toggles an elements popover.

-
$('#element').popover('toggle')
-

.popover('destroy')

-

Hides and destroys an element's popover.

-
$('#element').popover('destroy')
-
- - - - -
- - - -

Example alerts

-

Add dismiss functionality to all alert messages with this plugin.

-
-
- - Holy guacamole! Best check yo self, you're not looking too good. -
-
- -
-
- -

Oh snap! You got an error!

-

Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

-

- Take this action Or do this -

-
-
- - -
- - -

Usage

-

Enable dismissal of an alert via JavaScript:

-
$(".alert").alert()
- -

Markup

-

Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

-
<a class="close" data-dismiss="alert" href="#">&times;</a>
- -

Methods

-

$().alert()

-

Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

-

.alert('close')

-

Closes an alert.

-
$(".alert").alert('close')
- - -

Events

-

Bootstrap's alert class exposes a few events for hooking into alert functionality.

- - - - - - - - - - - - - - - - - -
EventDescription
closeThis event fires immediately when the close instance method is called.
closedThis event is fired when the alert has been closed (will wait for css transitions to complete).
-
-$('#my-alert').bind('closed', function () {
-  // do something…
-})
-
-
- - - - -
- - -

Example uses

-

Do more with buttons. Control button states or create groups of buttons for more components like toolbars.

- -

Stateful

-

Add data-loading-text="Loading..." to use a loading state on a button.

-
- -
-
<button type="button" class="btn btn-primary" data-loading-text="Loading...">Loading state</button>
- -

Single toggle

-

Add data-toggle="button" to activate toggling on a single button.

-
- -
-
<button type="button" class="btn btn-primary" data-toggle="button">Single Toggle</button>
- -

Checkbox

-

Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.

-
-
- - - -
-
-
-<div class="btn-group" data-toggle="buttons-checkbox">
-  <button type="button" class="btn btn-primary">Left</button>
-  <button type="button" class="btn btn-primary">Middle</button>
-  <button type="button" class="btn btn-primary">Right</button>
-</div>
-
- -

Radio

-

Add data-toggle="buttons-radio" for radio style toggling on btn-group.

-
-
- - - -
-
-
-<div class="btn-group" data-toggle="buttons-radio">
-  <button type="button" class="btn btn-primary">Left</button>
-  <button type="button" class="btn btn-primary">Middle</button>
-  <button type="button" class="btn btn-primary">Right</button>
-</div>
-
- - -
- - -

Usage

-

Enable buttons via JavaScript:

-
$('.nav-tabs').button()
- -

Markup

-

Data attributes are integral to the button plugin. Check out the example code below for the various markup types.

- -

Options

-

None

- -

Methods

-

$().button('toggle')

-

Toggles push state. Gives the button the appearance that it has been activated.

-
- Heads up! - You can enable auto toggling of a button by using the data-toggle attribute. -
-
<button type="button" class="btn" data-toggle="button" >…</button>
-

$().button('loading')

-

Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text. -

-
<button type="button" class="btn" data-loading-text="loading stuff..." >...</button>
-
- Heads up! - Firefox persists the disabled state across page loads. A workaround for this is to use autocomplete="off". -
-

$().button('reset')

-

Resets button state - swaps text to original text.

-

$().button(string)

-

Resets button state - swaps text to any data defined text state.

-
<button type="button" class="btn" data-complete-text="finished!" >...</button>
-<script>
-  $('.btn').button('complete')
-</script>
-
-
- - - - -
- - -

About

-

Get base styles and flexible support for collapsible components like accordions and navigation.

-

* Requires the Transitions plugin to be included.

- -

Example accordion

-

Using the collapse plugin, we built a simple accordion style widget:

- -
-
-
- -
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. -
-
-
-
- -
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. -
-
-
-
- -
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. -
-
-
-
-
-
-<div class="accordion" id="accordion2">
-  <div class="accordion-group">
-    <div class="accordion-heading">
-      <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
-        Collapsible Group Item #1
-      </a>
-    </div>
-    <div id="collapseOne" class="accordion-body collapse in">
-      <div class="accordion-inner">
-        Anim pariatur cliche...
-      </div>
-    </div>
-  </div>
-  <div class="accordion-group">
-    <div class="accordion-heading">
-      <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
-        Collapsible Group Item #2
-      </a>
-    </div>
-    <div id="collapseTwo" class="accordion-body collapse">
-      <div class="accordion-inner">
-        Anim pariatur cliche...
-      </div>
-    </div>
-  </div>
-</div>
-...
-
-

You can also use the plugin without the accordion markup. Make a button toggle the expanding and collapsing of another element.

-
-<button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#demo">
-  simple collapsible
-</button>
-
-<div id="demo" class="collapse in"> … </div>
-
- - -
- - -

Usage

- -

Via data attributes

-

Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a css selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.

-

To add accordion-like group management to a collapsible control, add the data attribute data-parent="#selector". Refer to the demo to see this in action.

- -

Via JavaScript

-

Enable manually with:

-
$(".collapse").collapse()
- -

Options

-

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-parent="".

- - - - - - - - - - - - - - - - - - - - - - - -
Nametypedefaultdescription
parentselectorfalseIf selector then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior)
togglebooleantrueToggles the collapsible element on invocation
- - -

Methods

-

.collapse(options)

-

Activates your content as a collapsible element. Accepts an optional options object. -

-$('#myCollapsible').collapse({
-  toggle: false
-})
-
-

.collapse('toggle')

-

Toggles a collapsible element to shown or hidden.

-

.collapse('show')

-

Shows a collapsible element.

-

.collapse('hide')

-

Hides a collapsible element.

- -

Events

-

Bootstrap's collapse class exposes a few events for hooking into collapse functionality.

- - - - - - - - - - - - - - - - - - - - - - - - - -
EventDescription
showThis event fires immediately when the show instance method is called.
shownThis event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).
hide - This event is fired immediately when the hide method has been called. -
hiddenThis event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).
-
-$('#myCollapsible').on('hidden', function () {
-  // do something…
-})
-
- - - - - - - - - -
- - - -

Example

-

A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.

-
- -
-
<input type="text" data-provide="typeahead">
-

You'll want to set autocomplete="off" to prevent default browser menus from appearing over the Bootstrap typeahead dropdown.

- -
- - -

Usage

- -

Via data attributes

-

Add data attributes to register an element with typeahead functionality as shown in the example above.

- -

Via JavaScript

-

Call the typeahead manually with:

-
$('.typeahead').typeahead()
- -

Options

-

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-source="".

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nametypedefaultdescription
sourcearray, function[ ]The data source to query against. May be an array of strings or a function. The function is passed two arguments, the query value in the input field and the process callback. The function may be used synchronously by returning the data source directly or asynchronously via the process callback's single argument.
itemsnumber8The max number of items to display in the dropdown.
minLengthnumber1The minimum character length needed before triggering autocomplete suggestions
matcherfunctioncase insensitiveThe method used to determine if a query matches an item. Accepts a single argument, the item against which to test the query. Access the current query with this.query. Return a boolean true if query is a match.
sorterfunctionexact match,
case sensitive,
case insensitive
Method used to sort autocomplete results. Accepts a single argument items and has the scope of the typeahead instance. Reference the current query with this.query.
updaterfunctionreturns selected itemThe method used to return selected item. Accepts a single argument, the item and has the scope of the typeahead instance.
highlighterfunctionhighlights all default matchesMethod used to highlight autocomplete results. Accepts a single argument item and has the scope of the typeahead instance. Should return html.
- -

Methods

-

.typeahead(options)

-

Initializes an input with a typeahead.

-
- - - - -
- - -

Example

-

The subnavigation on the left is a live demo of the affix plugin.

- -
- -

Usage

- -

Via data attributes

-

To easily add affix behavior to any element, just add data-spy="affix" to the element you want to spy on. Then use offsets to define when to toggle the pinning of an element on and off.

- -
<div data-spy="affix" data-offset-top="200">...</div>
- -
- Heads up! - You must manage the position of a pinned element and the behavior of its immediate parent. Position is controlled by affix, affix-top, and affix-bottom. Remember to check for a potentially collapsed parent when the affix kicks in as it's removing content from the normal flow of the page. -
- -

Via JavaScript

-

Call the affix plugin via JavaScript:

-
$('#navbar').affix()
- -

Options

-

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-offset-top="200".

- - - - - - - - - - - - - - - - - -
Nametypedefaultdescription
offsetnumber | function | object10Pixels to offset from screen when calculating position of scroll. If a single number is provided, the offset will be applied in both top and left directions. To listen for a single direction, or multiple unique offsets, just provide an object offset: { x: 10 }. Use a function when you need to dynamically provide an offset (useful for some responsive designs).
-
- - - -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/scaffolding.html b/docs/scaffolding.html deleted file mode 100644 index 87a9bb003157..000000000000 --- a/docs/scaffolding.html +++ /dev/null @@ -1,602 +0,0 @@ - - - - - Scaffolding · Bootstrap - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

Scaffolding

-

Bootstrap is built on responsive 12-column grids, layouts, and components.

-
-
- -
- - -
- -
- - - - -
- - -

Requires HTML5 doctype

-

Bootstrap makes use of certain HTML elements and CSS properties that require the use of the HTML5 doctype. Include it at the beginning of all your projects.

-
-<!DOCTYPE html>
-<html lang="en">
-  ...
-</html>
-
- -

Typography and links

-

Bootstrap sets basic global display, typography, and link styles. Specifically, we:

-
    -
  • Remove margin on the body
  • -
  • Set background-color: white; on the body
  • -
  • Use the @baseFontFamily, @baseFontSize, and @baseLineHeight attributes as our typographic base
  • -
  • Set the global link color via @linkColor and apply link underlines only on :hover
  • -
-

These styles can be found within scaffolding.less.

- -

Reset via Normalize

-

With Bootstrap 2, the old reset block has been dropped in favor of Normalize.css, a project by Nicolas Gallagher and Jonathan Neal that also powers the HTML5 Boilerplate. While we use much of Normalize within our reset.less, we have removed some elements specifically for Bootstrap.

- -
- - - - - -
- - -

Live grid example

-

The default Bootstrap grid system utilizes 12 columns, making for a 940px wide container without responsive features enabled. With the responsive CSS file added, the grid adapts to be 724px and 1170px wide depending on your viewport. Below 767px viewports, the columns become fluid and stack vertically.

-
-
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
2
-
3
-
4
-
-
-
4
-
5
-
-
-
9
-
-
- -

Basic grid HTML

-

For a simple two column layout, create a .row and add the appropriate number of .span* columns. As this is a 12-column grid, each .span* spans a number of those 12 columns, and should always add up to 12 for each row (or the number of columns in the parent).

-
-<div class="row">
-  <div class="span4">...</div>
-  <div class="span8">...</div>
-</div>
-
-

Given this example, we have .span4 and .span8, making for 12 total columns and a complete row.

- -

Offsetting columns

-

Move columns to the right using .offset* classes. Each class increases the left margin of a column by a whole column. For example, .offset4 moves .span4 over four columns.

-
-
-
4
-
3 offset 2
-
-
-
3 offset 1
-
3 offset 2
-
-
-
6 offset 3
-
-
-
-<div class="row">
-  <div class="span4">...</div>
-  <div class="span3 offset2">...</div>
-</div>
-
- -

Nesting columns

-

To nest your content with the default grid, add a new .row and set of .span* columns within an existing .span* column. Nested rows should include a set of columns that add up to the number of columns of its parent.

-
-
- Level 1 column -
-
- Level 2 -
-
- Level 2 -
-
-
-
-
-<div class="row">
-  <div class="span9">
-    Level 1 column
-    <div class="row">
-      <div class="span6">Level 2</div>
-      <div class="span3">Level 2</div>
-    </div>
-  </div>
-</div>
-
-
- - - - -
- - -

Live fluid grid example

-

The fluid grid system uses percents instead of pixels for column widths. It has the same responsive capabilities as our fixed grid system, ensuring proper proportions for key screen resolutions and devices.

-
-
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
4
-
4
-
4
-
-
-
4
-
8
-
-
-
6
-
6
-
-
-
12
-
-
- -

Basic fluid grid HTML

-

Make any row "fluid" by changing .row to .row-fluid. The column classes stay the exact same, making it easy to flip between fixed and fluid grids.

-
-<div class="row-fluid">
-  <div class="span4">...</div>
-  <div class="span8">...</div>
-</div>
-
- -

Fluid offsetting

-

Operates the same way as the fixed grid system offsetting: add .offset* to any column to offset by that many columns.

-
-
-
4
-
4 offset 4
-
-
-
3 offset 3
-
3 offset 3
-
-
-
6 offset 6
-
-
-
-<div class="row-fluid">
-  <div class="span4">...</div>
-  <div class="span4 offset2">...</div>
-</div>
-
- -

Fluid nesting

-

Fluid grids utilize nesting differently: each nested level of columns should add up to 12 columns. This is because the fluid grid uses percentages, not pixels, for setting widths.

-
-
- Fluid 12 -
-
- Fluid 6 -
-
- Fluid 6 -
-
- Fluid 6 -
-
-
-
- Fluid 6 -
-
-
-
-
-<div class="row-fluid">
-  <div class="span12">
-    Fluid 12
-    <div class="row-fluid">
-      <div class="span6">
-        Fluid 6
-        <div class="row-fluid">
-          <div class="span6">Fluid 6</div>
-          <div class="span6">Fluid 6</div>
-        </div>
-      </div>
-      <div class="span6">Fluid 6</div>
-    </div>
-  </div>
-</div>
-
- -
- - - - - -
- - -

Fixed layout

-

Provides a common fixed-width (and optionally responsive) layout with only <div class="container"> required.

-
-
-
-
-<body>
-  <div class="container">
-    ...
-  </div>
-</body>
-
- -

Fluid layout

-

Create a fluid, two-column page with <div class="container-fluid">—great for applications and docs.

-
-
-
-
-
-<div class="container-fluid">
-  <div class="row-fluid">
-    <div class="span2">
-      <!--Sidebar content-->
-    </div>
-    <div class="span10">
-      <!--Body content-->
-    </div>
-  </div>
-</div>
-
-
- - - - - -
- - -

Enabling responsive features

-

Turn on responsive CSS in your project by including the proper meta tag and additional stylesheet within the <head> of your document. If you've compiled Bootstrap from the Customize page, you need only include the meta tag.

-
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
-
-

Heads up! Bootstrap doesn't include responsive features by default at this time as not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it as needed.

- -

About responsive Bootstrap

- Responsive devices -

Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width and max-width.

-
    -
  • Modify the width of column in our grid
  • -
  • Stack elements instead of float wherever necessary
  • -
  • Resize headings and text to be more appropriate for devices
  • -
-

Use media queries responsibly and only as a start to your mobile audiences. For larger projects, do consider dedicated code bases and not layers of media queries.

- -

Supported devices

-

Bootstrap supports a handful of media queries in a single file to help make your projects more appropriate on different devices and screen resolutions. Here's what's included:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LabelLayout widthColumn widthGutter width
Large display1200px and up70px30px
Default980px and up60px20px
Portrait tablets768px and above42px20px
Phones to tablets767px and belowFluid columns, no fixed widths
Phones480px and belowFluid columns, no fixed widths
-
-/* Large desktop */
-@media (min-width: 1200px) { ... }
-
-/* Portrait tablet to landscape and desktop */
-@media (min-width: 768px) and (max-width: 979px) { ... }
-
-/* Landscape phone to portrait tablet */
-@media (max-width: 767px) { ... }
-
-/* Landscape phones and down */
-@media (max-width: 480px) { ... }
-
- - -

Responsive utility classes

-

For faster mobile-friendly development, use these utility classes for showing and hiding content by device. Below is a table of the available classes and their effect on a given media query layout (labeled by device). They can be found in responsive.less.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ClassPhones 767px and belowTablets 979px to 768pxDesktops Default
.visible-phoneVisible
.visible-tabletVisible
.visible-desktopVisible
.hidden-phoneVisibleVisible
.hidden-tabletVisibleVisible
.hidden-desktopVisibleVisible
- -

When to use

-

Use on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation. Responsive utilities should not be used with tables, and as such are not supported.

- -

Responsive utilities test case

-

Resize your browser or load on different devices to test the above classes.

-

Visible on...

-

Green checkmarks indicate that class is visible in your current viewport.

-
    -
  • Phone✔ Phone
  • -
  • Tablet✔ Tablet
  • -
  • Desktop✔ Desktop
  • -
-

Hidden on...

-

Here, green checkmarks indicate that class is hidden in your current viewport.

-
    -
  • Phone✔ Phone
  • -
  • Tablet✔ Tablet
  • -
  • Desktop✔ Desktop
  • -
- -
- - - -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/templates/layout.mustache b/docs/templates/layout.mustache deleted file mode 100644 index 993b44620c2a..000000000000 --- a/docs/templates/layout.mustache +++ /dev/null @@ -1,151 +0,0 @@ - - - - - {{title}} - - - - - - - - - - - - - - - - - - - - - {{#production}} - - {{/production}} - - - - - - - -{{>body}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{#production}} - - - {{/production}} - - - diff --git a/docs/templates/pages/base-css.mustache b/docs/templates/pages/base-css.mustache deleted file mode 100644 index 1f40f371104e..000000000000 --- a/docs/templates/pages/base-css.mustache +++ /dev/null @@ -1,2102 +0,0 @@ - -
-
-

{{_i}}Base CSS{{/i}}

-

{{_i}}Fundamental HTML elements styled and enhanced with extensible classes.{{/i}}

-
-
- - -
- - -
- -
- - - - -
- - - {{! Headings }} -

{{_i}}Headings{{/i}}

-

{{_i}}All HTML headings, <h1> through <h6> are available.{{/i}}

-
-

h1. {{_i}}Heading 1{{/i}}

-

h2. {{_i}}Heading 2{{/i}}

-

h3. {{_i}}Heading 3{{/i}}

-

h4. {{_i}}Heading 4{{/i}}

-
h5. {{_i}}Heading 5{{/i}}
-
h6. {{_i}}Heading 6{{/i}}
-
- - {{! Body copy }} -

{{_i}}Body copy{{/i}}

-

{{_i}}Bootstrap's global default font-size is 14px, with a line-height of 20px. This is applied to the <body> and all paragraphs. In addition, <p> (paragraphs) receive a bottom margin of half their line-height (10px by default).{{/i}}

-
-

Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.

-

Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.

-

Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.

-
-
<p>...</p>
- - {{! Body copy .lead }} -

{{_i}}Lead body copy{{/i}}

-

{{_i}}Make a paragraph stand out by adding .lead.{{/i}}

-
-

Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.

-
-
<p class="lead">...</p>
- - {{! Using LESS }} -

{{_i}}Built with Less{{/i}}

-

{{_i}}The typographic scale is based on two LESS variables in variables.less: @baseFontSize and @baseLineHeight. The first is the base font-size used throughout and the second is the base line-height. We use those variables and some simple math to create the margins, paddings, and line-heights of all our type and more. Customize them and Bootstrap adapts.{{/i}}

- - -
- - - {{! Emphasis }} -

{{_i}}Emphasis{{/i}}

-

{{_i}}Make use of HTML's default emphasis tags with lightweight styles.{{/i}}

- -

<small>

-

{{_i}}For de-emphasizing inline or blocks of text, use the small tag.{{/i}}

-
-

This line of text is meant to be treated as fine print.

-
-
-<p>
-  <small>This line of text is meant to be treated as fine print.</small>
-</p>
-
- -

{{_i}}Bold{{/i}}

-

{{_i}}For emphasizing a snippet of text with a heavier font-weight.{{/i}}

-
-

The following snippet of text is rendered as bold text.

-
-
<strong>rendered as bold text</strong>
- -

{{_i}}Italics{{/i}}

-

{{_i}}For emphasizing a snippet of text with italics.{{/i}}

-
-

The following snippet of text is rendered as italicized text.

-
-
<em>rendered as italicized text</em>
- -

{{_i}}Heads up!{{/i}} {{_i}}Feel free to use <b> and <i> in HTML5. <b> is meant to highlight words or phrases without conveying additional importance while <i> is mostly for voice, technical terms, etc.{{/i}}

- -

{{_i}}Alignment classes{{/i}}

-

{{_i}}Easily realign text to components with text alignment classes.{{/i}}

-
-

Left aligned text.

-

Center aligned text.

-

Right aligned text.

-
-
-<p class="text-left">Left aligned text.</p>
-<p class="text-center">Center aligned text.</p>
-<p class="text-right">Right aligned text.</p>
-
- -

{{_i}}Emphasis classes{{/i}}

-

{{_i}}Convey meaning through color with a handful of emphasis utility classes.{{/i}}

-
-

Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.

-

Etiam porta sem malesuada magna mollis euismod.

-

Donec ullamcorper nulla non metus auctor fringilla.

-

Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.

-

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

-
-
-<p class="muted">Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.</p>
-<p class="text-warning">Etiam porta sem malesuada magna mollis euismod.</p>
-<p class="text-error">Donec ullamcorper nulla non metus auctor fringilla.</p>
-<p class="text-info">Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.</p>
-<p class="text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>
-
- - -
- - - {{! Abbreviations }} -

{{_i}}Abbreviations{{/i}}

-

{{_i}}Stylized implementation of HTML's <abbr> element for abbreviations and acronyms to show the expanded version on hover. Abbreviations with a title attribute have a light dotted bottom border and a help cursor on hover, providing additional context on hover.{{/i}}

- -

<abbr>

-

{{_i}}For expanded text on long hover of an abbreviation, include the title attribute.{{/i}}

-
-

{{_i}}An abbreviation of the word attribute is attr.{{/i}}

-
-
<abbr title="attribute">attr</abbr>
- -

<abbr class="initialism">

-

{{_i}}Add .initialism to an abbreviation for a slightly smaller font-size.{{/i}}

-
-

{{_i}}HTML is the best thing since sliced bread.{{/i}}

-
-
<abbr title="HyperText Markup Language" class="initialism">HTML</abbr>
- - -
- - - {{! Addresses }} -

{{_i}}Addresses{{/i}}

-

{{_i}}Present contact information for the nearest ancestor or the entire body of work.{{/i}}

- -

<address>

-

{{_i}}Preserve formatting by ending all lines with <br>.{{/i}}

-
-
- Twitter, Inc.
- 795 Folsom Ave, Suite 600
- San Francisco, CA 94107
- P: (123) 456-7890 -
-
- {{_i}}Full Name{{/i}}
- {{_i}}first.last@example.com{{/i}} -
-
-
-<address>
-  <strong>Twitter, Inc.</strong><br>
-  795 Folsom Ave, Suite 600<br>
-  San Francisco, CA 94107<br>
-  <abbr title="Phone">P:</abbr> (123) 456-7890
-</address>
-
-<address>
-  <strong>{{_i}}Full Name{{/i}}</strong><br>
-  <a href="mailto:#">{{_i}}first.last@example.com{{/i}}</a>
-</address>
-
- - -
- - - {{! Blockquotes }} -

{{_i}}Blockquotes{{/i}}

-

{{_i}}For quoting blocks of content from another source within your document.{{/i}}

- -

{{_i}}Default blockquote{{/i}}

-

{{_i}}Wrap <blockquote> around any HTML as the quote. For straight quotes we recommend a <p>.{{/i}}

-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

-
-
-
-<blockquote>
-  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
-</blockquote>
-
- -

{{_i}}Blockquote options{{/i}}

-

{{_i}}Style and content changes for simple variations on a standard blockquote.{{/i}}

- -

{{_i}}Naming a source{{/i}}

-

{{_i}}Add <small> tag for identifying the source. Wrap the name of the source work in <cite>.{{/i}}

-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

- {{_i}}Someone famous in Source Title{{/i}} -
-
-
-<blockquote>
-  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
-  <small>{{_i}}Someone famous <cite title="Source Title">Source Title</cite>{{/i}}</small>
-</blockquote>
-
- -

{{_i}}Alternate displays{{/i}}

-

{{_i}}Use .pull-right for a floated, right-aligned blockquote.{{/i}}

-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

- {{_i}}Someone famous in Source Title{{/i}} -
-
-
-<blockquote class="pull-right">
-  ...
-</blockquote>
-
- - -
- - - -

{{_i}}Lists{{/i}}

- -

{{_i}}Unordered{{/i}}

-

{{_i}}A list of items in which the order does not explicitly matter.{{/i}}

-
-
    -
  • Lorem ipsum dolor sit amet
  • -
  • Consectetur adipiscing elit
  • -
  • Integer molestie lorem at massa
  • -
  • Facilisis in pretium nisl aliquet
  • -
  • Nulla volutpat aliquam velit -
      -
    • Phasellus iaculis neque
    • -
    • Purus sodales ultricies
    • -
    • Vestibulum laoreet porttitor sem
    • -
    • Ac tristique libero volutpat at
    • -
    -
  • -
  • Faucibus porta lacus fringilla vel
  • -
  • Aenean sit amet erat nunc
  • -
  • Eget porttitor lorem
  • -
-
-
-<ul>
-  <li>...</li>
-</ul>
-
- -

{{_i}}Ordered{{/i}}

-

{{_i}}A list of items in which the order does explicitly matter.{{/i}}

-
-
    -
  1. Lorem ipsum dolor sit amet
  2. -
  3. Consectetur adipiscing elit
  4. -
  5. Integer molestie lorem at massa
  6. -
  7. Facilisis in pretium nisl aliquet
  8. -
  9. Nulla volutpat aliquam velit
  10. -
  11. Faucibus porta lacus fringilla vel
  12. -
  13. Aenean sit amet erat nunc
  14. -
  15. Eget porttitor lorem
  16. -
-
-
-<ol>
-  <li>...</li>
-</ol>
-
- -

{{_i}}Unstyled{{/i}}

-

{{_i}}Remove the default list-style and left padding on list items (immediate children only).{{/i}}

-
-
    -
  • Lorem ipsum dolor sit amet
  • -
  • Consectetur adipiscing elit
  • -
  • Integer molestie lorem at massa
  • -
  • Facilisis in pretium nisl aliquet
  • -
  • Nulla volutpat aliquam velit -
      -
    • Phasellus iaculis neque
    • -
    • Purus sodales ultricies
    • -
    • Vestibulum laoreet porttitor sem
    • -
    • Ac tristique libero volutpat at
    • -
    -
  • -
  • Faucibus porta lacus fringilla vel
  • -
  • Aenean sit amet erat nunc
  • -
  • Eget porttitor lorem
  • -
-
-
-<ul class="unstyled">
-  <li>...</li>
-</ul>
-
- -

{{_i}}Inline{{/i}}

-

{{_i}}Place all list items on a single line with inline-block and some light padding.{{/i}}

-
-
    -
  • Lorem ipsum
  • -
  • Phasellus iaculis
  • -
  • Nulla volutpat
  • -
-
-
-<ul class="inline">
-  <li>...</li>
-</ul>
-
- -

{{_i}}Description{{/i}}

-

{{_i}}A list of terms with their associated descriptions.{{/i}}

-
-
-
{{_i}}Description lists{{/i}}
-
{{_i}}A description list is perfect for defining terms.{{/i}}
-
Euismod
-
Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
-
Donec id elit non mi porta gravida at eget metus.
-
Malesuada porta
-
Etiam porta sem malesuada magna mollis euismod.
-
-
-
-<dl>
-  <dt>...</dt>
-  <dd>...</dd>
-</dl>
-
- -

{{_i}}Horizontal description{{/i}}

-

{{_i}}Make terms and descriptions in <dl> line up side-by-side.{{/i}}

-
-
-
{{_i}}Description lists{{/i}}
-
{{_i}}A description list is perfect for defining terms.{{/i}}
-
Euismod
-
Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
-
Donec id elit non mi porta gravida at eget metus.
-
Malesuada porta
-
Etiam porta sem malesuada magna mollis euismod.
-
Felis euismod semper eget lacinia
-
Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
-
-
-
-<dl class="dl-horizontal">
-  <dt>...</dt>
-  <dd>...</dd>
-</dl>
-
-

- {{_i}}Heads up!{{/i}} - {{_i}}Horizontal description lists will truncate terms that are too long to fit in the left column fix text-overflow. In narrower viewports, they will change to the default stacked layout.{{/i}} -

-
- - - - -
- - -

Inline

-

Wrap inline snippets of code with <code>.

-
- For example, <section> should be wrapped as inline. -
-
-{{_i}}For example, <code>&lt;section&gt;</code> should be wrapped as inline.{{/i}}
-
- -

Basic block

-

{{_i}}Use <pre> for multiple lines of code. Be sure to escape any angle brackets in the code for proper rendering.{{/i}}

-
-
<p>{{_i}}Sample text here...{{/i}}</p>
-
-
-<pre>
-  &lt;p&gt;{{_i}}Sample text here...{{/i}}&lt;/p&gt;
-</pre>
-
-

{{_i}}Heads up!{{/i}} {{_i}}Be sure to keep code within <pre> tags as close to the left as possible; it will render all tabs.{{/i}}

-

{{_i}}You may optionally add the .pre-scrollable class which will set a max-height of 350px and provide a y-axis scrollbar.{{/i}}

-
- - - - -
- - -

{{_i}}Default styles{{/i}}

-

{{_i}}For basic styling—light padding and only horizontal dividers—add the base class .table to any <table>.{{/i}}

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#{{_i}}First Name{{/i}}{{_i}}Last Name{{/i}}{{_i}}Username{{/i}}
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
-
{{! /example }} -
-<table class="table">
-  …
-</table>
-
- - -
- - -

{{_i}}Optional classes{{/i}}

-

{{_i}}Add any of the following classes to the .table base class.{{/i}}

- -

{{_i}}.table-striped{{/i}}

-

{{_i}}Adds zebra-striping to any table row within the <tbody> via the :nth-child CSS selector (not available in IE7-8).{{/i}}

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#{{_i}}First Name{{/i}}{{_i}}Last Name{{/i}}{{_i}}Username{{/i}}
1MarkOtto@mdo
2JacobThornton@fat
3Larrythe Bird@twitter
-
{{! /example }} -
-<table class="table table-striped">
-  …
-</table>
-
- -

{{_i}}.table-bordered{{/i}}

-

{{_i}}Add borders and rounded corners to the table.{{/i}}

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#{{_i}}First Name{{/i}}{{_i}}Last Name{{/i}}{{_i}}Username{{/i}}
1MarkOtto@mdo
MarkOtto@TwBootstrap
2JacobThornton@fat
3Larry the Bird@twitter
-
{{! /example }} -
-<table class="table table-bordered">
-  …
-</table>
-
- -

{{_i}}.table-hover{{/i}}

-

{{_i}}Enable a hover state on table rows within a <tbody>.{{/i}}

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#{{_i}}First Name{{/i}}{{_i}}Last Name{{/i}}{{_i}}Username{{/i}}
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
-
{{! /example }} -
-<table class="table table-hover">
-  …
-</table>
-
- -

{{_i}}.table-condensed{{/i}}

-

{{_i}}Makes tables more compact by cutting cell padding in half.{{/i}}

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#{{_i}}First Name{{/i}}{{_i}}Last Name{{/i}}{{_i}}Username{{/i}}
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
-
{{! /example }} -
-<table class="table table-condensed">
-  …
-</table>
-
- - -
- - -

{{_i}}Optional row classes{{/i}}

-

{{_i}}Use contextual classes to color table rows.{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Class{{/i}}{{_i}}Description{{/i}}
- .success - {{_i}}Indicates a successful or positive action.{{/i}}
- .error - {{_i}}Indicates a dangerous or potentially negative action.{{/i}}
- .warning - {{_i}}Indicates a warning that might need attention.{{/i}}
- .info - {{_i}}Used as an alternative to the default styles.{{/i}}
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#{{_i}}Product{{/i}}{{_i}}Payment Taken{{/i}}{{_i}}Status{{/i}}
1TB - Monthly01/04/2012Approved
2TB - Monthly02/04/2012Declined
3TB - Monthly03/04/2012Pending
4TB - Monthly04/04/2012Call in to confirm
-
{{! /example }} -
-...
-  <tr class="success">
-    <td>1</td>
-    <td>TB - Monthly</td>
-    <td>01/04/2012</td>
-    <td>Approved</td>
-  </tr>
-...
-
- - -
- - -

{{_i}}Supported table markup{{/i}}

-

{{_i}}List of supported table HTML elements and how they should be used.{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Tag{{/i}}{{_i}}Description{{/i}}
- <table> - - {{_i}}Wrapping element for displaying data in a tabular format{{/i}} -
- <thead> - - {{_i}}Container element for table header rows (<tr>) to label table columns{{/i}} -
- <tbody> - - {{_i}}Container element for table rows (<tr>) in the body of the table{{/i}} -
- <tr> - - {{_i}}Container element for a set of table cells (<td> or <th>) that appears on a single row{{/i}} -
- <td> - - {{_i}}Default table cell{{/i}} -
- <th> - - {{_i}}Special table cell for column (or row, depending on scope and placement) labels{{/i}} -
- <caption> - - {{_i}}Description or summary of what the table holds, especially useful for screen readers{{/i}} -
-
-<table>
-  <caption>...</caption>
-  <thead>
-    <tr>
-      <th>...</th>
-      <th>...</th>
-    </tr>
-  </thead>
-  <tbody>
-    <tr>
-      <td>...</td>
-      <td>...</td>
-    </tr>
-  </tbody>
-</table>
-
- -
- - - - -
- - -

{{_i}}Default styles{{/i}}

-

{{_i}}Individual form controls receive styling, but without any required base class on the <form> or large changes in markup. Results in stacked, left-aligned labels on top of form controls.{{/i}}

-
-
- Legend - - - {{_i}}Example block-level help text here.{{/i}} - - -
-
{{! /example }} -
-<form>
-  <fieldset>
-    <legend>{{_i}}Legend{{/i}}</legend>
-    <label>{{_i}}Label name{{/i}}</label>
-    <input type="text" placeholder="{{_i}}Type something…{{/i}}">
-    <span class="help-block">Example block-level help text here.</span>
-    <label class="checkbox">
-      <input type="checkbox"> {{_i}}Check me out{{/i}}
-    </label>
-    <button type="submit" class="btn">{{_i}}Submit{{/i}}</button>
-  </fieldset>
-</form>
-
- - -
- - -

{{_i}}Optional layouts{{/i}}

-

{{_i}}Included with Bootstrap are three optional form layouts for common use cases.{{/i}}

- -

{{_i}}Search form{{/i}}

-

{{_i}}Add .form-search to the form and .search-query to the <input> for an extra-rounded text input.{{/i}}

- {{! /example }} -
-<form class="form-search">
-  <input type="text" class="input-medium search-query">
-  <button type="submit" class="btn">{{_i}}Search{{/i}}</button>
-</form>
-
- -

{{_i}}Inline form{{/i}}

-

{{_i}}Add .form-inline for left-aligned labels and inline-block controls for a compact layout.{{/i}}

-
- - - - -
{{! /example }} -
-<form class="form-inline">
-  <input type="text" class="input-small" placeholder="{{_i}}Email{{/i}}">
-  <input type="password" class="input-small" placeholder="{{_i}}Password{{/i}}">
-  <label class="checkbox">
-    <input type="checkbox"> {{_i}}Remember me{{/i}}
-  </label>
-  <button type="submit" class="btn">{{_i}}Sign in{{/i}}</button>
-</form>
-
- -

{{_i}}Horizontal form{{/i}}

-

{{_i}}Right align labels and float them to the left to make them appear on the same line as controls. Requires the most markup changes from a default form:{{/i}}

-
    -
  • {{_i}}Add .form-horizontal to the form{{/i}}
  • -
  • {{_i}}Wrap labels and controls in .control-group{{/i}}
  • -
  • {{_i}}Add .control-label to the label{{/i}}
  • -
  • {{_i}}Wrap any associated controls in .controls for proper alignment{{/i}}
  • -
-
-
- -
- -
-
-
- -
- -
-
-
-
- - -
-
-
-
-<form class="form-horizontal">
-  <div class="control-group">
-    <label class="control-label" for="inputEmail">{{_i}}Email{{/i}}</label>
-    <div class="controls">
-      <input type="text" id="inputEmail" placeholder="{{_i}}Email{{/i}}">
-    </div>
-  </div>
-  <div class="control-group">
-    <label class="control-label" for="inputPassword">{{_i}}Password{{/i}}</label>
-    <div class="controls">
-      <input type="password" id="inputPassword" placeholder="{{_i}}Password{{/i}}">
-    </div>
-  </div>
-  <div class="control-group">
-    <div class="controls">
-      <label class="checkbox">
-        <input type="checkbox"> {{_i}}Remember me{{/i}}
-      </label>
-      <button type="submit" class="btn">{{_i}}Sign in{{/i}}</button>
-    </div>
-  </div>
-</form>
-
- - -
- - -

{{_i}}Supported form controls{{/i}}

-

{{_i}}Examples of standard form controls supported in an example form layout.{{/i}}

- -

{{_i}}Inputs{{/i}}

-

{{_i}}Most common form control, text-based input fields. Includes support for all HTML5 types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color.{{/i}}

-

{{_i}}Requires the use of a specified type at all times.{{/i}}

-
- -
-
-<input type="text" placeholder="Text input">
-
- -

{{_i}}Textarea{{/i}}

-

{{_i}}Form control which supports multiple lines of text. Change rows attribute as necessary.{{/i}}

-
- -
-
-<textarea rows="3"></textarea>
-
- -

{{_i}}Checkboxes and radios{{/i}}

-

{{_i}}Checkboxes are for selecting one or several options in a list while radios are for selecting one option from many.{{/i}}

-

{{_i}}Default (stacked){{/i}}

-
- -
- - -
-
-<label class="checkbox">
-  <input type="checkbox" value="">
-  {{_i}}Option one is this and that—be sure to include why it's great{{/i}}
-</label>
-
-<label class="radio">
-  <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>
-  {{_i}}Option one is this and that—be sure to include why it's great{{/i}}
-</label>
-<label class="radio">
-  <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">
-  {{_i}}Option two can be something else and selecting it will deselect option one{{/i}}
-</label>
-
- -

{{_i}}Inline checkboxes{{/i}}

-

{{_i}}Add the .inline class to a series of checkboxes or radios for controls appear on the same line.{{/i}}

-
- - - -
-
-<label class="checkbox inline">
-  <input type="checkbox" id="inlineCheckbox1" value="option1"> 1
-</label>
-<label class="checkbox inline">
-  <input type="checkbox" id="inlineCheckbox2" value="option2"> 2
-</label>
-<label class="checkbox inline">
-  <input type="checkbox" id="inlineCheckbox3" value="option3"> 3
-</label>
-
- -

{{_i}}Selects{{/i}}

-

{{_i}}Use the default option or specify a multiple="multiple" to show multiple options at once.{{/i}}

-
- -
- -
-
-<select>
-  <option>1</option>
-  <option>2</option>
-  <option>3</option>
-  <option>4</option>
-  <option>5</option>
-</select>
-
-<select multiple="multiple">
-  <option>1</option>
-  <option>2</option>
-  <option>3</option>
-  <option>4</option>
-  <option>5</option>
-</select>
-
- - -
- - -

{{_i}}Extending form controls{{/i}}

-

{{_i}}Adding on top of existing browser controls, Bootstrap includes other useful form components.{{/i}}

- -

{{_i}}Prepended and appended inputs{{/i}}

-

{{_i}}Add text or buttons before or after any text-based input. Do note that select elements are not supported here.{{/i}}

- -

{{_i}}Default options{{/i}}

-

{{_i}}Wrap an .add-on and an input with one of two classes to prepend or append text to an input.{{/i}}

-
-
- @ - -
-
-
- - .00 -
-
-
-<div class="input-prepend">
-  <span class="add-on">@</span>
-  <input class="span2" id="prependedInput" type="text" placeholder="{{_i}}Username{{/i}}">
-</div>
-<div class="input-append">
-  <input class="span2" id="appendedInput" type="text">
-  <span class="add-on">.00</span>
-</div>
-
- -

{{_i}}Combined{{/i}}

-

{{_i}}Use both classes and two instances of .add-on to prepend and append an input.{{/i}}

-
-
- $ - - .00 -
-
-
-<div class="input-prepend input-append">
-  <span class="add-on">$</span>
-  <input class="span2" id="appendedPrependedInput" type="text">
-  <span class="add-on">.00</span>
-</div>
-
- -

{{_i}}Buttons instead of text{{/i}}

-

{{_i}}Instead of a <span> with text, use a .btn to attach a button (or two) to an input.{{/i}}

-
-
- - -
-
-
-<div class="input-append">
-  <input class="span2" id="appendedInputButton" type="text">
-  <button class="btn" type="button">Go!</button>
-</div>
-
-
-
- - - -
-
-
-<div class="input-append">
-  <input class="span2" id="appendedInputButtons" type="text">
-  <button class="btn" type="button">Search</button>
-  <button class="btn" type="button">Options</button>
-</div>
-
- -

{{_i}}Button dropdowns{{/i}}

-

{{_i}}{{/i}}

-
- -
-
-<div class="input-append">
-  <input class="span2" id="appendedDropdownButton" type="text">
-  <div class="btn-group">
-    <button class="btn dropdown-toggle" data-toggle="dropdown">
-      {{_i}}Action{{/i}}
-      <span class="caret"></span>
-    </button>
-    <ul class="dropdown-menu">
-      ...
-    </ul>
-  </div>
-</div>
-
- -
- -
-
-<div class="input-prepend">
-  <div class="btn-group">
-    <button class="btn dropdown-toggle" data-toggle="dropdown">
-      {{_i}}Action{{/i}}
-      <span class="caret"></span>
-    </button>
-    <ul class="dropdown-menu">
-      ...
-    </ul>
-  </div>
-  <input class="span2" id="prependedDropdownButton" type="text">
-</div>
-
- -
- -
-
-<div class="input-prepend input-append">
-  <div class="btn-group">
-    <button class="btn dropdown-toggle" data-toggle="dropdown">
-      {{_i}}Action{{/i}}
-      <span class="caret"></span>
-    </button>
-    <ul class="dropdown-menu">
-      ...
-    </ul>
-  </div>
-  <input class="span2" id="appendedPrependedDropdownButton" type="text">
-  <div class="btn-group">
-    <button class="btn dropdown-toggle" data-toggle="dropdown">
-      {{_i}}Action{{/i}}
-      <span class="caret"></span>
-    </button>
-    <ul class="dropdown-menu">
-      ...
-    </ul>
-  </div>
-</div>
-
- -

{{_i}}Segmented dropdown groups{{/i}}

-
- - -
-
-<form>
-  <div class="input-prepend">
-    <div class="btn-group">...</div>
-    <input type="text">
-  </div>
-  <div class="input-append">
-    <input type="text">
-    <div class="btn-group">...</div>
-  </div>
-</form>
-
- -

{{_i}}Search form{{/i}}

- {{! /example }} -
-<form class="form-search">
-  <div class="input-append">
-    <input type="text" class="span2 search-query">
-    <button type="submit" class="btn">{{_i}}Search{{/i}}</button>
-  </div>
-  <div class="input-prepend">
-    <button type="submit" class="btn">{{_i}}Search{{/i}}</button>
-    <input type="text" class="span2 search-query">
-  </div>
-</form>
-
- -

{{_i}}Control sizing{{/i}}

-

{{_i}}Use relative sizing classes like .input-large or match your inputs to the grid column sizes using .span* classes.{{/i}}

- -

{{_i}}Block level inputs{{/i}}

-

{{_i}}Make any <input> or <textarea> element behave like a block level element.{{/i}}

-
-
- -
-
-
-<input class="input-block-level" type="text" placeholder=".input-block-level">
-
- -

{{_i}}Relative sizing{{/i}}

-
-
- - - - - - -
-
-
-<input class="input-mini" type="text" placeholder=".input-mini">
-<input class="input-small" type="text" placeholder=".input-small">
-<input class="input-medium" type="text" placeholder=".input-medium">
-<input class="input-large" type="text" placeholder=".input-large">
-<input class="input-xlarge" type="text" placeholder=".input-xlarge">
-<input class="input-xxlarge" type="text" placeholder=".input-xxlarge">
-
-

- {{_i}}Heads up!{{/i}} In future versions, we'll be altering the use of these relative input classes to match our button sizes. For example, .input-large will increase the padding and font-size of an input. -

- -

{{_i}}Grid sizing{{/i}}

-

{{_i}}Use .span1 to .span12 for inputs that match the same sizes of the grid columns.{{/i}}

-
-
- - - - - - -
-
-
-<input class="span1" type="text" placeholder=".span1">
-<input class="span2" type="text" placeholder=".span2">
-<input class="span3" type="text" placeholder=".span3">
-<select class="span1">
-  ...
-</select>
-<select class="span2">
-  ...
-</select>
-<select class="span3">
-  ...
-</select>
-
- -

{{_i}}For multiple grid inputs per line, use the .controls-row modifier class for proper spacing. It floats the inputs to collapse white-space, sets the proper margins, and clears the float.{{/i}}

-
-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-<div class="controls">
-  <input class="span5" type="text" placeholder=".span5">
-</div>
-<div class="controls controls-row">
-  <input class="span4" type="text" placeholder=".span4">
-  <input class="span1" type="text" placeholder=".span1">
-</div>
-...
-
- -

{{_i}}Uneditable inputs{{/i}}

-

{{_i}}Present data in a form that's not editable without using actual form markup.{{/i}}

-
- Some value here -
-
-<span class="input-xlarge uneditable-input">Some value here</span>
-
- -

{{_i}}Form actions{{/i}}

-

{{_i}}End a form with a group of actions (buttons). When placed within a .form-actions, the buttons will automatically indent to line up with the form controls.{{/i}}

-
-
- - -
-
-
-<div class="form-actions">
-  <button type="submit" class="btn btn-primary">{{_i}}Save changes{{/i}}</button>
-  <button type="button" class="btn">{{_i}}Cancel{{/i}}</button>
-</div>
-
- -

{{_i}}Help text{{/i}}

-

{{_i}}Inline and block level support for help text that appears around form controls.{{/i}}

-

{{_i}}Inline help{{/i}}

-
- Inline help text -
-
-<input type="text"><span class="help-inline">Inline help text</span>
-
- -

{{_i}}Block help{{/i}}

-
- - A longer block of help text that breaks onto a new line and may extend beyond one line. -
-
-<input type="text"><span class="help-block">A longer block of help text that breaks onto a new line and may extend beyond one line.</span>
-
- - -
- - -

{{_i}}Form control states{{/i}}

-

{{_i}}Provide feedback to users or visitors with basic feedback states on form controls and labels.{{/i}}

- -

{{_i}}Input focus{{/i}}

-

{{_i}}We remove the default outline styles on some form controls and apply a box-shadow in its place for :focus.{{/i}}

-
- -
-
-<input class="input-xlarge" id="focusedInput" type="text" value="{{_i}}This is focused...{{/i}}">
-
- -

{{_i}}Invalid inputs{{/i}}

-

{{_i}}Style inputs via default browser functionality with :invalid. Specify a type, add the required attribute if the field is not optional, and (if applicable) specify a pattern.{{/i}}

-

{{_i}}This is not available in versions of Internet Explorer 7-9 due to lack of support for CSS pseudo selectors.{{/i}}

-
- -
-
-<input class="span3" type="email" required>
-
- -

{{_i}}Disabled inputs{{/i}}

-

{{_i}}Add the disabled attribute on an input to prevent user input and trigger a slightly different look.{{/i}}

-
- -
-
-<input class="input-xlarge" id="disabledInput" type="text" placeholder="{{_i}}Disabled input here...{{/i}}" disabled>
-
- -

{{_i}}Validation states{{/i}}

-

{{_i}}Bootstrap includes validation styles for error, warning, info, and success messages. To use, add the appropriate class to the surrounding .control-group.{{/i}}

- -
-
- -
- - {{_i}}Something may have gone wrong{{/i}} -
-
-
- -
- - {{_i}}Please correct the error{{/i}} -
-
-
- -
- - {{_i}}Username is taken{{/i}} -
-
-
- -
- - {{_i}}Woohoo!{{/i}} -
-
-
-
-<div class="control-group warning">
-  <label class="control-label" for="inputWarning">{{_i}}Input with warning{{/i}}</label>
-  <div class="controls">
-    <input type="text" id="inputWarning">
-    <span class="help-inline">{{_i}}Something may have gone wrong{{/i}}</span>
-  </div>
-</div>
-
-<div class="control-group error">
-  <label class="control-label" for="inputError">{{_i}}Input with error{{/i}}</label>
-  <div class="controls">
-    <input type="text" id="inputError">
-    <span class="help-inline">{{_i}}Please correct the error{{/i}}</span>
-  </div>
-</div>
-
-<div class="control-group info">
-  <label class="control-label" for="inputInfo">{{_i}}Input with info{{/i}}</label>
-  <div class="controls">
-    <input type="text" id="inputInfo">
-    <span class="help-inline">{{_i}}Username is already taken{{/i}}</span>
-  </div>
-</div>
-
-<div class="control-group success">
-  <label class="control-label" for="inputSuccess">{{_i}}Input with success{{/i}}</label>
-  <div class="controls">
-    <input type="text" id="inputSuccess">
-    <span class="help-inline">{{_i}}Woohoo!{{/i}}</span>
-  </div>
-</div>
-
- -
- - - - -
- - -

Default buttons

-

{{_i}}Button styles can be applied to anything with the .btn class applied. However, typically you'll want to apply these to only <a> and <button> elements for the best rendering.{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Button{{/i}}{{_i}}class=""{{/i}}{{_i}}Description{{/i}}
btn{{_i}}Standard gray button with gradient{{/i}}
btn btn-primary{{_i}}Provides extra visual weight and identifies the primary action in a set of buttons{{/i}}
btn btn-info{{_i}}Used as an alternative to the default styles{{/i}}
btn btn-success{{_i}}Indicates a successful or positive action{{/i}}
btn btn-warning{{_i}}Indicates caution should be taken with this action{{/i}}
btn btn-danger{{_i}}Indicates a dangerous or potentially negative action{{/i}}
btn btn-inverse{{_i}}Alternate dark gray button, not tied to a semantic action or use{{/i}}
btn btn-link{{_i}}Deemphasize a button by making it look like a link while maintaining button behavior{{/i}}
- -

{{_i}}Cross browser compatibility{{/i}}

-

{{_i}}IE9 doesn't crop background gradients on rounded corners, so we remove it. Related, IE9 jankifies disabled button elements, rendering text gray with a nasty text-shadow that we cannot fix.{{/i}}

- - -

{{_i}}Button sizes{{/i}}

-

{{_i}}Fancy larger or smaller buttons? Add .btn-large, .btn-small, or .btn-mini for additional sizes.{{/i}}

-
-

- - -

-

- - -

-

- - -

-

- - -

-
-
-<p>
-  <button class="btn btn-large btn-primary" type="button">{{_i}}Large button{{/i}}</button>
-  <button class="btn btn-large" type="button">{{_i}}Large button{{/i}}</button>
-</p>
-<p>
-  <button class="btn btn-primary" type="button">{{_i}}Default button{{/i}}</button>
-  <button class="btn" type="button">{{_i}}Default button{{/i}}</button>
-</p>
-<p>
-  <button class="btn btn-small btn-primary" type="button">{{_i}}Small button{{/i}}</button>
-  <button class="btn btn-small" type="button">{{_i}}Small button{{/i}}</button>
-</p>
-<p>
-  <button class="btn btn-mini btn-primary" type="button">{{_i}}Mini button{{/i}}</button>
-  <button class="btn btn-mini" type="button">{{_i}}Mini button{{/i}}</button>
-</p>
-
-

{{_i}}Create block level buttons—those that span the full width of a parent— by adding .btn-block.{{/i}}

-
-
- - -
-
-
-<button class="btn btn-large btn-block btn-primary" type="button">{{_i}}Block level button{{/i}}</button>
-<button class="btn btn-large btn-block" type="button">{{_i}}Block level button{{/i}}</button>
-
- - -

{{_i}}Disabled state{{/i}}

-

{{_i}}Make buttons look unclickable by fading them back 50%.{{/i}}

- -

Anchor element

-

{{_i}}Add the .disabled class to <a> buttons.{{/i}}

-

- {{_i}}Primary link{{/i}} - {{_i}}Link{{/i}} -

-
-<a href="#" class="btn btn-large btn-primary disabled">{{_i}}Primary link{{/i}}</a>
-<a href="#" class="btn btn-large disabled">{{_i}}Link{{/i}}</a>
-
-

- {{_i}}Heads up!{{/i}} - {{_i}}We use .disabled as a utility class here, similar to the common .active class, so no prefix is required. Also, this class is only for aesthetic; you must use custom JavaScript to disable links here.{{/i}} -

- -

Button element

-

{{_i}}Add the disabled attribute to <button> buttons.{{/i}}

-

- - -

-
-<button type="button" class="btn btn-large btn-primary disabled" disabled="disabled">{{_i}}Primary button{{/i}}</button>
-<button type="button" class="btn btn-large" disabled>{{_i}}Button{{/i}}</button>
-
- - -

{{_i}}One class, multiple tags{{/i}}

-

{{_i}}Use the .btn class on an <a>, <button>, or <input> element.{{/i}}

-
- {{_i}}Link{{/i}} - - - -
-
-<a class="btn" href="">{{_i}}Link{{/i}}</a>
-<button class="btn" type="submit">{{_i}}Button{{/i}}</button>
-<input class="btn" type="button" value="{{_i}}Input{{/i}}">
-<input class="btn" type="submit" value="{{_i}}Submit{{/i}}">
-
-

{{_i}}As a best practice, try to match the element for your context to ensure matching cross-browser rendering. If you have an input, use an <input type="submit"> for your button.{{/i}}

- -
- - - - -
- - -

{{_i}}Add classes to an <img> element to easily style images in any project.{{/i}}

-
- - - -
-
-<img src="..." class="img-rounded">
-<img src="..." class="img-circle">
-<img src="..." class="img-polaroid">
-
-

{{_i}}Heads up!{{/i}} {{_i}}.img-rounded and .img-circle do not work in IE7-8 due to lack of border-radius support.{{/i}}

- - -
- - - - -
- - -

{{_i}}Icon glyphs{{/i}}

-

{{_i}}140 icons in sprite form, available in dark gray (default) and white, provided by Glyphicons.{{/i}}

-
    -
  • icon-glass
  • -
  • icon-music
  • -
  • icon-search
  • -
  • icon-envelope
  • -
  • icon-heart
  • -
  • icon-star
  • -
  • icon-star-empty
  • -
  • icon-user
  • -
  • icon-film
  • -
  • icon-th-large
  • -
  • icon-th
  • -
  • icon-th-list
  • -
  • icon-ok
  • -
  • icon-remove
  • -
  • icon-zoom-in
  • -
  • icon-zoom-out
  • -
  • icon-off
  • -
  • icon-signal
  • -
  • icon-cog
  • -
  • icon-trash
  • -
  • icon-home
  • -
  • icon-file
  • -
  • icon-time
  • -
  • icon-road
  • -
  • icon-download-alt
  • -
  • icon-download
  • -
  • icon-upload
  • -
  • icon-inbox
  • - -
  • icon-play-circle
  • -
  • icon-repeat
  • -
  • icon-refresh
  • -
  • icon-list-alt
  • -
  • icon-lock
  • -
  • icon-flag
  • -
  • icon-headphones
  • -
  • icon-volume-off
  • -
  • icon-volume-down
  • -
  • icon-volume-up
  • -
  • icon-qrcode
  • -
  • icon-barcode
  • -
  • icon-tag
  • -
  • icon-tags
  • -
  • icon-book
  • -
  • icon-bookmark
  • -
  • icon-print
  • -
  • icon-camera
  • -
  • icon-font
  • -
  • icon-bold
  • -
  • icon-italic
  • -
  • icon-text-height
  • -
  • icon-text-width
  • -
  • icon-align-left
  • -
  • icon-align-center
  • -
  • icon-align-right
  • -
  • icon-align-justify
  • -
  • icon-list
  • - -
  • icon-indent-left
  • -
  • icon-indent-right
  • -
  • icon-facetime-video
  • -
  • icon-picture
  • -
  • icon-pencil
  • -
  • icon-map-marker
  • -
  • icon-adjust
  • -
  • icon-tint
  • -
  • icon-edit
  • -
  • icon-share
  • -
  • icon-check
  • -
  • icon-move
  • -
  • icon-step-backward
  • -
  • icon-fast-backward
  • -
  • icon-backward
  • -
  • icon-play
  • -
  • icon-pause
  • -
  • icon-stop
  • -
  • icon-forward
  • -
  • icon-fast-forward
  • -
  • icon-step-forward
  • -
  • icon-eject
  • -
  • icon-chevron-left
  • -
  • icon-chevron-right
  • -
  • icon-plus-sign
  • -
  • icon-minus-sign
  • -
  • icon-remove-sign
  • -
  • icon-ok-sign
  • - -
  • icon-question-sign
  • -
  • icon-info-sign
  • -
  • icon-screenshot
  • -
  • icon-remove-circle
  • -
  • icon-ok-circle
  • -
  • icon-ban-circle
  • -
  • icon-arrow-left
  • -
  • icon-arrow-right
  • -
  • icon-arrow-up
  • -
  • icon-arrow-down
  • -
  • icon-share-alt
  • -
  • icon-resize-full
  • -
  • icon-resize-small
  • -
  • icon-plus
  • -
  • icon-minus
  • -
  • icon-asterisk
  • -
  • icon-exclamation-sign
  • -
  • icon-gift
  • -
  • icon-leaf
  • -
  • icon-fire
  • -
  • icon-eye-open
  • -
  • icon-eye-close
  • -
  • icon-warning-sign
  • -
  • icon-plane
  • -
  • icon-calendar
  • -
  • icon-random
  • -
  • icon-comment
  • -
  • icon-magnet
  • - -
  • icon-chevron-up
  • -
  • icon-chevron-down
  • -
  • icon-retweet
  • -
  • icon-shopping-cart
  • -
  • icon-folder-close
  • -
  • icon-folder-open
  • -
  • icon-resize-vertical
  • -
  • icon-resize-horizontal
  • -
  • icon-hdd
  • -
  • icon-bullhorn
  • -
  • icon-bell
  • -
  • icon-certificate
  • -
  • icon-thumbs-up
  • -
  • icon-thumbs-down
  • -
  • icon-hand-right
  • -
  • icon-hand-left
  • -
  • icon-hand-up
  • -
  • icon-hand-down
  • -
  • icon-circle-arrow-right
  • -
  • icon-circle-arrow-left
  • -
  • icon-circle-arrow-up
  • -
  • icon-circle-arrow-down
  • -
  • icon-globe
  • -
  • icon-wrench
  • -
  • icon-tasks
  • -
  • icon-filter
  • -
  • icon-briefcase
  • -
  • icon-fullscreen
  • -
- -

Glyphicons attribution

-

{{_i}}Glyphicons Halflings are normally not available for free, but an arrangement between Bootstrap and the Glyphicons creators have made this possible at no cost to you as developers. As a thank you, we ask you to include an optional link back to Glyphicons whenever practical.{{/i}}

- - -
- - -

{{_i}}How to use{{/i}}

-

{{_i}}All icons require an <i> tag with a unique class, prefixed with icon-. To use, place the following code just about anywhere:{{/i}}

-
-<i class="icon-search"></i>
-
-

{{_i}}There are also styles available for inverted (white) icons, made ready with one extra class. We will specifically enforce this class on hover and active states for nav and dropdown links.{{/i}}

-
-<i class="icon-search icon-white"></i>
-
-

- {{_i}}Heads up!{{/i}} - {{_i}}When using beside strings of text, as in buttons or nav links, be sure to leave a space after the <i> tag for proper spacing.{{/i}} -

- - -
- - -

{{_i}}Icon examples{{/i}}

-

{{_i}}Use them in buttons, button groups for a toolbar, navigation, or prepended form inputs.{{/i}}

- -

{{_i}}Buttons{{/i}}

- -
{{_i}}Button group in a button toolbar{{/i}}
-
-
-
- - - - -
-
-
{{! /bs-docs-example }} -
-<div class="btn-toolbar">
-  <div class="btn-group">
-    <a class="btn" href="#"><i class="icon-align-left"></i></a>
-    <a class="btn" href="#"><i class="icon-align-center"></i></a>
-    <a class="btn" href="#"><i class="icon-align-right"></i></a>
-    <a class="btn" href="#"><i class="icon-align-justify"></i></a>
-  </div>
-</div>
-
- -
{{_i}}Dropdown in a button group{{/i}}
- {{! /bs-docs-example }} -
-<div class="btn-group">
-  <a class="btn btn-primary" href="#"><i class="icon-user icon-white"></i> {{_i}}User{{/i}}</a>
-  <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
-  <ul class="dropdown-menu">
-    <li><a href="#"><i class="icon-pencil"></i> {{_i}}Edit{{/i}}</a></li>
-    <li><a href="#"><i class="icon-trash"></i> {{_i}}Delete{{/i}}</a></li>
-    <li><a href="#"><i class="icon-ban-circle"></i> {{_i}}Ban{{/i}}</a></li>
-    <li class="divider"></li>
-    <li><a href="#"><i class="i"></i> {{_i}}Make admin{{/i}}</a></li>
-  </ul>
-</div>
-
- -
{{_i}}Button sizes{{/i}}
- {{! /bs-docs-example }} -
-<a class="btn btn-large" href="#"><i class="icon-star"></i> Star</a>
-<a class="btn btn-small" href="#"><i class="icon-star"></i> Star</a>
-<a class="btn btn-mini" href="#"><i class="icon-star"></i> Star</a>
-
- -

{{_i}}Navigation{{/i}}

- {{! /bs-docs-example }} -
-<ul class="nav nav-list">
-  <li class="active"><a href="#"><i class="icon-home icon-white"></i> {{_i}}Home{{/i}}</a></li>
-  <li><a href="#"><i class="icon-book"></i> {{_i}}Library{{/i}}</a></li>
-  <li><a href="#"><i class="icon-pencil"></i> {{_i}}Applications{{/i}}</a></li>
-  <li><a href="#"><i class="i"></i> {{_i}}Misc{{/i}}</a></li>
-</ul>
-
- -

{{_i}}Form fields{{/i}}

-
-
- -
-
- -
-
-
-
-
-<div class="control-group">
-  <label class="control-label" for="inputIcon">{{_i}}Email address{{/i}}</label>
-  <div class="controls">
-    <div class="input-prepend">
-      <span class="add-on"><i class="icon-envelope"></i></span>
-      <input class="span2" id="inputIcon" type="text">
-    </div>
-  </div>
-</div>
-
- -
- - - -
{{! /span9 }} -
{{! row}} - -
{{! /.container }} diff --git a/docs/templates/pages/components.mustache b/docs/templates/pages/components.mustache deleted file mode 100644 index 6d3ff9beee65..000000000000 --- a/docs/templates/pages/components.mustache +++ /dev/null @@ -1,2505 +0,0 @@ - -
-
-

{{_i}}Components{{/i}}

-

{{_i}}Dozens of reusable components built to provide navigation, alerts, popovers, and more.{{/i}}

-
-
- - -
- - -
- -
- - - - - - - - - - -
- - -

{{_i}}Examples{{/i}}

-

{{_i}}Two basic options, along with two more specific variations.{{/i}}

- -

{{_i}}Single button group{{/i}}

-

{{_i}}Wrap a series of buttons with .btn in .btn-group.{{/i}}

-
-
- - - -
-
-
-<div class="btn-group">
-  <button class="btn">Left</button>
-  <button class="btn">Middle</button>
-  <button class="btn">Right</button>
-</div>
-
- -

{{_i}}Multiple button groups{{/i}}

-

{{_i}}Combine sets of <div class="btn-group"> into a <div class="btn-toolbar"> for more complex components.{{/i}}

-
-
-
- - - - -
-
- - - -
-
- -
-
-
-
-<div class="btn-toolbar">
-  <div class="btn-group">
-    ...
-  </div>
-</div>
-
- -

{{_i}}Vertical button groups{{/i}}

-

{{_i}}Make a set of buttons appear vertically stacked rather than horizontally.{{/i}}

-
-
- - - - -
-
-
-<div class="btn-group btn-group-vertical">
-  ...
-</div>
-
- - -
- - -

{{_i}}Checkbox and radio flavors{{/i}}

-

{{_i}}Button groups can also function as radios, where only one button may be active, or checkboxes, where any number of buttons may be active. View the JavaScript docs for that.{{/i}}

- -

{{_i}}Dropdowns in button groups{{/i}}

-

{{_i}}Heads up!{{/i}} {{_i}}Buttons with dropdowns must be individually wrapped in their own .btn-group within a .btn-toolbar for proper rendering.{{/i}}

-
- - - - -
- - - -

{{_i}}Overview and examples{{/i}}

-

{{_i}}Use any button to trigger a dropdown menu by placing it within a .btn-group and providing the proper menu markup.{{/i}}

- {{! /example }} -
-<div class="btn-group">
-  <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
-    {{_i}}Action{{/i}}
-    <span class="caret"></span>
-  </a>
-  <ul class="dropdown-menu">
-    <!-- {{_i}}dropdown menu links{{/i}} -->
-  </ul>
-</div>
-
- -

{{_i}}Works with all button sizes{{/i}}

-

{{_i}}Button dropdowns work at any size: .btn-large, .btn-small, or .btn-mini.{{/i}}

- {{! /example }} - -

{{_i}}Requires JavaScript{{/i}}

-

{{_i}}Button dropdowns require the Bootstrap dropdown plugin to function.{{/i}}

-

{{_i}}In some cases—like mobile—dropdown menus will extend outside the viewport. You need to resolve the alignment manually or with custom JavaScript.{{/i}}

- - -
- - -

{{_i}}Split button dropdowns{{/i}}

-

{{_i}}Building on the button group styles and markup, we can easily create a split button. Split buttons feature a standard action on the left and a dropdown toggle on the right with contextual links.{{/i}}

- {{! /example }} -
-<div class="btn-group">
-  <button class="btn">{{_i}}Action{{/i}}</button>
-  <button class="btn dropdown-toggle" data-toggle="dropdown">
-    <span class="caret"></span>
-  </button>
-  <ul class="dropdown-menu">
-    <!-- {{_i}}dropdown menu links{{/i}} -->
-  </ul>
-</div>
-
- -

{{_i}}Sizes{{/i}}

-

{{_i}}Utilize the extra button classes .btn-mini, .btn-small, or .btn-large for sizing.{{/i}}

- {{! /example }} -
-<div class="btn-group">
-  <button class="btn btn-mini">{{_i}}Action{{/i}}</button>
-  <button class="btn btn-mini dropdown-toggle" data-toggle="dropdown">
-    <span class="caret"></span>
-  </button>
-  <ul class="dropdown-menu">
-    <!-- {{_i}}dropdown menu links{{/i}} -->
-  </ul>
-</div>
-
- -

{{_i}}Dropup menus{{/i}}

-

{{_i}}Dropdown menus can also be toggled from the bottom up by adding a single class to the immediate parent of .dropdown-menu. It will flip the direction of the .caret and reposition the menu itself to move from the bottom up instead of top down.{{/i}}

- {{! /example }} -
-<div class="btn-group dropup">
-  <button class="btn">{{_i}}Dropup{{/i}}</button>
-  <button class="btn dropdown-toggle" data-toggle="dropdown">
-    <span class="caret"></span>
-  </button>
-  <ul class="dropdown-menu">
-    <!-- {{_i}}dropdown menu links{{/i}} -->
-  </ul>
-</div>
-
- -
- - - - - - - - - - - - - - - - - - - -
- - -

{{_i}}Standard pagination{{/i}}

-

{{_i}}Simple pagination inspired by Rdio, great for apps and search results. The large block is hard to miss, easily scalable, and provides large click areas.{{/i}}

-
- -
-
-<div class="pagination">
-  <ul>
-    <li><a href="#">Prev</a></li>
-    <li><a href="#">1</a></li>
-    <li><a href="#">2</a></li>
-    <li><a href="#">3</a></li>
-    <li><a href="#">4</a></li>
-    <li><a href="#">5</a></li>
-    <li><a href="#">Next</a></li>
-  </ul>
-</div>
-
- - -
- - -

{{_i}}Options{{/i}}

- -

{{_i}}Disabled and active states{{/i}}

-

{{_i}}Links are customizable for different circumstances. Use .disabled for unclickable links and .active to indicate the current page.{{/i}}

-
- -
-
-<div class="pagination">
-  <ul>
-    <li class="disabled"><a href="#">&laquo;</a></li>
-    <li class="active"><a href="#">1</a></li>
-    ...
-  </ul>
-</div>
-
-

{{_i}}You can optionally swap out active or disabled anchors for spans to remove click functionality while retaining intended styles.{{/i}}

-
-<div class="pagination">
-  <ul>
-    <li class="disabled"><span>&laquo;</span></li>
-    <li class="active"><span>1</span></li>
-    ...
-  </ul>
-</div>
-
- -

{{_i}}Sizes{{/i}}

-

{{_i}}Fancy larger or smaller pagination? Add .pagination-large, .pagination-small, or .pagination-mini for additional sizes.{{/i}}

-
- - - - -
-
-<div class="pagination pagination-large">
-  <ul>
-    ...
-  </ul>
-</div>
-<div class="pagination">
-  <ul>
-    ...
-  </ul>
-</div>
-<div class="pagination pagination-small">
-  <ul>
-    ...
-  </ul>
-</div>
-<div class="pagination pagination-mini">
-  <ul>
-    ...
-  </ul>
-</div>
-
- -

{{_i}}Alignment{{/i}}

-

{{_i}}Add one of two optional classes to change the alignment of pagination links: .pagination-centered and .pagination-right.{{/i}}

-
- -
-
-<div class="pagination pagination-centered">
-  ...
-</div>
-
-
- -
-
-<div class="pagination pagination-right">
-  ...
-</div>
-
- - -
- - -

{{_i}}Pager{{/i}}

-

{{_i}}Quick previous and next links for simple pagination implementations with light markup and styles. It's great for simple sites like blogs or magazines.{{/i}}

- -

{{_i}}Default example{{/i}}

-

{{_i}}By default, the pager centers links.{{/i}}

- -
-<ul class="pager">
-  <li><a href="#">{{_i}}Previous{{/i}}</a></li>
-  <li><a href="#">{{_i}}Next{{/i}}</a></li>
-</ul>
-
- -

{{_i}}Aligned links{{/i}}

-

{{_i}}Alternatively, you can align each link to the sides:{{/i}}

- -
-<ul class="pager">
-  <li class="previous">
-    <a href="#">{{_i}}&larr; Older{{/i}}</a>
-  </li>
-  <li class="next">
-    <a href="#">{{_i}}Newer &rarr;{{/i}}</a>
-  </li>
-</ul>
-
- -

{{_i}}Optional disabled state{{/i}}

-

{{_i}}Pager links also use the general .disabled utility class from the pagination.{{/i}}

- -
-<ul class="pager">
-  <li class="previous disabled">
-    <a href="#">{{_i}}&larr; Older{{/i}}</a>
-  </li>
-  ...
-</ul>
-
- -
- - - - -
- -

{{_i}}Labels{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Labels{{/i}}{{_i}}Markup{{/i}}
- {{_i}}Default{{/i}} - - <span class="label">{{_i}}Default{{/i}}</span> -
- {{_i}}Success{{/i}} - - <span class="label label-success">{{_i}}Success{{/i}}</span> -
- {{_i}}Warning{{/i}} - - <span class="label label-warning">{{_i}}Warning{{/i}}</span> -
- {{_i}}Important{{/i}} - - <span class="label label-important">{{_i}}Important{{/i}}</span> -
- {{_i}}Info{{/i}} - - <span class="label label-info">{{_i}}Info{{/i}}</span> -
- {{_i}}Inverse{{/i}} - - <span class="label label-inverse">{{_i}}Inverse{{/i}}</span> -
- -

{{_i}}Badges{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Name{{/i}}{{_i}}Example{{/i}}{{_i}}Markup{{/i}}
- {{_i}}Default{{/i}} - - 1 - - <span class="badge">1</span> -
- {{_i}}Success{{/i}} - - 2 - - <span class="badge badge-success">2</span> -
- {{_i}}Warning{{/i}} - - 4 - - <span class="badge badge-warning">4</span> -
- {{_i}}Important{{/i}} - - 6 - - <span class="badge badge-important">6</span> -
- {{_i}}Info{{/i}} - - 8 - - <span class="badge badge-info">8</span> -
- {{_i}}Inverse{{/i}} - - 10 - - <span class="badge badge-inverse">10</span> -
- -

{{_i}}Easily collapsible{{/i}}

-

{{_i}}For easy implementation, labels and badges will simply collapse (via CSS's :empty selector) when no content exists within.{{/i}}

- -
- - - - -
- - -

{{_i}}Hero unit{{/i}}

-

{{_i}}A lightweight, flexible component to showcase key content on your site. It works well on marketing and content-heavy sites.{{/i}}

-
-
-

{{_i}}Hello, world!{{/i}}

-

{{_i}}This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.{{/i}}

-

{{_i}}Learn more{{/i}}

-
-
-
-<div class="hero-unit">
-  <h1>{{_i}}Heading{{/i}}</h1>
-  <p>{{_i}}Tagline{{/i}}</p>
-  <p>
-    <a class="btn btn-primary btn-large">
-      {{_i}}Learn more{{/i}}
-    </a>
-  </p>
-</div>
-
- -

{{_i}}Page header{{/i}}

-

{{_i}}A simple shell for an h1 to appropriately space out and segment sections of content on a page. It can utilize the h1's default small, element as well most other components (with additional styles).{{/i}}

-
- -
-
-<div class="page-header">
-  <h1>{{_i}}Example page header{{/i}} <small>{{_i}}Subtext for header{{/i}}</small></h1>
-</div>
-
- -
- - - - -
- - -

{{_i}}Default thumbnails{{/i}}

-

{{_i}}By default, Bootstrap's thumbnails are designed to showcase linked images with minimal required markup.{{/i}}

-
- -
- -

{{_i}}Highly customizable{{/i}}

-

{{_i}}With a bit of extra markup, it's possible to add any kind of HTML content like headings, paragraphs, or buttons into thumbnails.{{/i}}

-
-
    -
  • -
    - -
    -

    {{_i}}Thumbnail label{{/i}}

    -

    Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    -

    {{_i}}Action{{/i}} {{_i}}Action{{/i}}

    -
    -
    -
  • -
  • -
    - -
    -

    {{_i}}Thumbnail label{{/i}}

    -

    Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    -

    {{_i}}Action{{/i}} {{_i}}Action{{/i}}

    -
    -
    -
  • -
  • -
    - -
    -

    {{_i}}Thumbnail label{{/i}}

    -

    Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    -

    {{_i}}Action{{/i}} {{_i}}Action{{/i}}

    -
    -
    -
  • -
-
- -

{{_i}}Why use thumbnails{{/i}}

-

{{_i}}Thumbnails (previously .media-grid up until v1.4) are great for grids of photos or videos, image search results, retail products, portfolios, and much more. They can be links or static content.{{/i}}

- -

{{_i}}Simple, flexible markup{{/i}}

-

{{_i}}Thumbnail markup is simple—a ul with any number of li elements is all that is required. It's also super flexible, allowing for any type of content with just a bit more markup to wrap your contents.{{/i}}

- -

{{_i}}Uses grid column sizes{{/i}}

-

{{_i}}Lastly, the thumbnails component uses existing grid system classes—like .span2 or .span3—for control of thumbnail dimensions.{{/i}}

- -

{{_i}}Markup{{/i}}

-

{{_i}}As mentioned previously, the required markup for thumbnails is light and straightforward. Here's a look at the default setup for linked images:{{/i}}

-
-<ul class="thumbnails">
-  <li class="span4">
-    <a href="#" class="thumbnail">
-      <img data-src="holder.js/300x200" alt="">
-    </a>
-  </li>
-  ...
-</ul>
-
-

{{_i}}For custom HTML content in thumbnails, the markup changes slightly. To allow block level content anywhere, we swap the <a> for a <div> like so:{{/i}}

-
-<ul class="thumbnails">
-  <li class="span4">
-    <div class="thumbnail">
-      <img data-src="holder.js/300x200" alt="">
-      <h3>{{_i}}Thumbnail label{{/i}}</h3>
-      <p>{{_i}}Thumbnail caption...{{/i}}</p>
-    </div>
-  </li>
-  ...
-</ul>
-
- -

{{_i}}More examples{{/i}}

-

{{_i}}Explore all your options with the various grid classes available to you. You can also mix and match different sizes.{{/i}}

- - -
- - - - - -
- - -

{{_i}}Default alert{{/i}}

-

{{_i}}Wrap any text and an optional dismiss button in .alert for a basic warning alert message.{{/i}}

-
-
- - {{_i}}Warning!{{/i}} {{_i}}Best check yo self, you're not looking too good.{{/i}} -
-
-
-<div class="alert">
-  <button type="button" class="close" data-dismiss="alert">&times;</button>
-  <strong>{{_i}}Warning!{{/i}}</strong> {{_i}}Best check yo self, you're not looking too good.{{/i}}
-</div>
-
- -

{{_i}}Dismiss buttons{{/i}}

-

{{_i}}Mobile Safari and Mobile Opera browsers, in addition to the data-dismiss="alert" attribute, require an href="#" for the dismissal of alerts when using an <a> tag.{{/i}}

-
<a href="#" class="close" data-dismiss="alert">&times;</a>
-

{{_i}}Alternatively, you may use a <button> element with the data attribute, which we have opted to do for our docs. When using <button>, you must include type="button" or your forms may not submit.{{/i}}

-
<button type="button" class="close" data-dismiss="alert">&times;</button>
- -

{{_i}}Dismiss alerts via JavaScript{{/i}}

-

{{_i}}Use the alerts jQuery plugin for quick and easy dismissal of alerts.{{/i}}

- - -
- - -

{{_i}}Options{{/i}}

-

{{_i}}For longer messages, increase the padding on the top and bottom of the alert wrapper by adding .alert-block.{{/i}}

-
-
- -

{{_i}}Warning!{{/i}}

-

{{_i}}Best check yo self, you're not looking too good.{{/i}} Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

-
-
-
-<div class="alert alert-block">
-  <button type="button" class="close" data-dismiss="alert">&times;</button>
-  <h4>{{_i}}Warning!{{/i}}</h4>
-  {{_i}}Best check yo self, you're not...{{/i}}
-</div>
-
- - -
- - -

{{_i}}Contextual alternatives{{/i}}

-

{{_i}}Add optional classes to change an alert's connotation.{{/i}}

- -

{{_i}}Error or danger{{/i}}

-
-
- - {{_i}}Oh snap!{{/i}} {{_i}}Change a few things up and try submitting again.{{/i}} -
-
-
-<div class="alert alert-error">
-  ...
-</div>
-
- -

{{_i}}Success{{/i}}

-
-
- - {{_i}}Well done!{{/i}} {{_i}}You successfully read this important alert message.{{/i}} -
-
-
-<div class="alert alert-success">
-  ...
-</div>
-
- -

{{_i}}Information{{/i}}

-
-
- - {{_i}}Heads up!{{/i}} {{_i}}This alert needs your attention, but it's not super important.{{/i}} -
-
-
-<div class="alert alert-info">
-  ...
-</div>
-
- -
- - - - - -
- - -

{{_i}}Examples and markup{{/i}}

- -

{{_i}}Basic{{/i}}

-

{{_i}}Default progress bar with a vertical gradient.{{/i}}

-
-
-
-
-
-
-<div class="progress">
-  <div class="bar" style="width: 60%;"></div>
-</div>
-
- -

{{_i}}Striped{{/i}}

-

{{_i}}Uses a gradient to create a striped effect. Not available in IE7-8.{{/i}}

-
-
-
-
-
-
-<div class="progress progress-striped">
-  <div class="bar" style="width: 20%;"></div>
-</div>
-
- -

{{_i}}Animated{{/i}}

-

{{_i}}Add .active to .progress-striped to animate the stripes right to left. Not available in all versions of IE.{{/i}}

-
-
-
-
-
-
-<div class="progress progress-striped active">
-  <div class="bar" style="width: 40%;"></div>
-</div>
-
- -

Stacked

-

Place multiple bars into the same .progress to stack them.

-
-
-
-
-
-
-
-
-<div class="progress">
-  <div class="bar bar-success" style="width: 35%;"></div>
-  <div class="bar bar-warning" style="width: 20%;"></div>
-  <div class="bar bar-danger" style="width: 10%;"></div>
-</div>
-
- - -
- - -

{{_i}}Options{{/i}}

- -

{{_i}}Additional colors{{/i}}

-

{{_i}}Progress bars use some of the same button and alert classes for consistent styles.{{/i}}

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<div class="progress progress-info">
-  <div class="bar" style="width: 20%"></div>
-</div>
-<div class="progress progress-success">
-  <div class="bar" style="width: 40%"></div>
-</div>
-<div class="progress progress-warning">
-  <div class="bar" style="width: 60%"></div>
-</div>
-<div class="progress progress-danger">
-  <div class="bar" style="width: 80%"></div>
-</div>
-
- -

{{_i}}Striped bars{{/i}}

-

{{_i}}Similar to the solid colors, we have varied striped progress bars.{{/i}}

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<div class="progress progress-info progress-striped">
-  <div class="bar" style="width: 20%"></div>
-</div>
-<div class="progress progress-success progress-striped">
-  <div class="bar" style="width: 40%"></div>
-</div>
-<div class="progress progress-warning progress-striped">
-  <div class="bar" style="width: 60%"></div>
-</div>
-<div class="progress progress-danger progress-striped">
-  <div class="bar" style="width: 80%"></div>
-</div>
-
- - -
- - -

{{_i}}Browser support{{/i}}

-

{{_i}}Progress bars use CSS3 gradients, transitions, and animations to achieve all their effects. These features are not supported in IE7-9 or older versions of Firefox.{{/i}}

-

{{_i}}Versions earlier than Internet Explorer 10 and Opera 12 do not support animations.{{/i}}

- -
- - - - - -
- -

{{_i}}Abstract object styles for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content.{{/i}}

- -

{{_i}}Default example{{/i}}

-

{{_i}}The default media allow to float a media object (images, video, audio) to the left or right of a content block.{{/i}}

-
-
- - - -
-

{{_i}}Media heading{{/i}}

- Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. -
-
-
- - - -
-

{{_i}}Media heading{{/i}}

- Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. -
- - - -
-

{{_i}}Media heading{{/i}}

- Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. -
-
-
-
-
{{! /.bs-docs-example }} -
-<div class="media">
-  <a class="pull-left" href="#">
-    <img class="media-object" data-src="holder.js/64x64">
-  </a>
-  <div class="media-body">
-    <h4 class="media-heading">{{_i}}Media heading{{/i}}</h4>
-    ...
-
-    <!-- Nested media object -->
-    <div class="media">
-      ...
-    </div>
-  </div>
-</div>
-
- - -
- - -

{{_i}}Media list{{/i}}

-

{{_i}}With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).{{/i}}

-
-
    -
  • - - - -
    -

    {{_i}}Media heading{{/i}}

    -

    Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.

    - -
    - - - -
    -

    {{_i}}Nested media heading{{/i}}

    - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. - -
    - - - -
    -

    {{_i}}Nested media heading{{/i}}

    - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. -
    -
    -
    -
    - -
    - - - -
    -

    {{_i}}Nested media heading{{/i}}

    - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. -
    -
    -
    -
  • -
  • - - - -
    -

    {{_i}}Media heading{{/i}}

    - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. -
    -
  • -
-
-
-<ul class="media-list">
-  <li class="media">
-    <a class="pull-left" href="#">
-      <img class="media-object" data-src="holder.js/64x64">
-    </a>
-    <div class="media-body">
-      <h4 class="media-heading">{{_i}}Media heading{{/i}}</h4>
-      ...
-
-      <!-- Nested media object -->
-      <div class="media">
-        ...
-     </div>
-    </div>
-  </li>
-</ul>
-
- -
- - - - - - -
- - -

{{_i}}Wells{{/i}}

-

{{_i}}Use the well as a simple effect on an element to give it an inset effect.{{/i}}

-
-
- {{_i}}Look, I'm in a well!{{/i}} -
-
-
-<div class="well">
-  ...
-</div>
-
-

{{_i}}Optional classes{{/i}}

-

{{_i}}Control padding and rounded corners with two optional modifier classes.{{/i}}

-
-
- {{_i}}Look, I'm in a well!{{/i}} -
-
-
-<div class="well well-large">
-  ...
-</div>
-
-
-
- {{_i}}Look, I'm in a well!{{/i}} -
-
-
-<div class="well well-small">
-  ...
-</div>
-
- -

{{_i}}Close icon{{/i}}

-

{{_i}}Use the generic close icon for dismissing content like modals and alerts.{{/i}}

-
-

-
-
<button class="close">&times;</button>
-

{{_i}}iOS devices require an href="#" for click events if you would rather use an anchor.{{/i}}

-
<a class="close" href="#">&times;</a>
- -

{{_i}}Helper classes{{/i}}

-

{{_i}}Simple, focused classes for small display or behavior tweaks.{{/i}}

- -

{{_i}}.pull-left{{/i}}

-

{{_i}}Float an element left{{/i}}

-
-class="pull-left"
-
-
-.pull-left {
-  float: left;
-}
-
- -

{{_i}}.pull-right{{/i}}

-

{{_i}}Float an element right{{/i}}

-
-class="pull-right"
-
-
-.pull-right {
-  float: right;
-}
-
- -

{{_i}}.muted{{/i}}

-

{{_i}}Change an element's color to #999{{/i}}

-
-class="muted"
-
-
-.muted {
-  color: #999;
-}
-
- -

{{_i}}.clearfix{{/i}}

-

{{_i}}Clear the float on any element{{/i}}

-
-class="clearfix"
-
-
-.clearfix {
-  *zoom: 1;
-  &:before,
-  &:after {
-    display: table;
-    content: "";
-  }
-  &:after {
-    clear: both;
-  }
-}
-
- -
- - - -
{{! /span9 }} -
{{! row}} - -
{{! /.container }} diff --git a/docs/templates/pages/customize.mustache b/docs/templates/pages/customize.mustache deleted file mode 100644 index 8d8a2f92a7ac..000000000000 --- a/docs/templates/pages/customize.mustache +++ /dev/null @@ -1,393 +0,0 @@ - -
-
-

{{_i}}Customize and download{{/i}}

-

{{_i}}Download Bootstrap or customize variables, components, JavaScript plugins, and more.{{/i}}

-
-
- - -
- - -
- -
- - - -
-
- -
-
-

{{_i}}Scaffolding{{/i}}

- - - - -

{{_i}}Base CSS{{/i}}

- - - - - - - -
-
-

{{_i}}Components{{/i}}

- - - - - - - - - - - -

{{_i}}JS Components{{/i}}

- - - - - - -
-
-

{{_i}}Miscellaneous{{/i}}

- - - - -

{{_i}}Responsive{{/i}}

- - - - - -
-
-
- -
- -
-
- - - - - - - -
-
- - - - - - -
-
-

{{_i}}Heads up!{{/i}}

-

{{_i}}All checked plugins will be compiled into a single file, bootstrap.js. All plugins require the latest version of jQuery to be included.{{/i}}

-
-
-
- - -
- -
-
-

{{_i}}Scaffolding{{/i}}

- - - - - -

{{_i}}Links{{/i}}

- - - - -

{{_i}}Colors{{/i}}

- - - - - - - - - - - - - - - -

{{_i}}Sprites{{/i}}

- - - - - -

{{_i}}Grid system{{/i}}

- - - - - - - - - - - - - - - -
-
- -

{{_i}}Typography{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

{{_i}}Tables{{/i}}

- - - - - - - - - -

{{_i}}Forms{{/i}}

- - - - - - - - - - - - - - - - - -
-
- -

{{_i}}Form states & alerts{{/i}}

- - - - - - - - - - - - - - - - - -

{{_i}}Navbar{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

{{_i}}Dropdowns{{/i}}

- - - - - - - - - - -
-
-
- -
- -
- {{_i}}Customize and Download{{/i}} -

{{_i}}What's included?{{/i}}

-

{{_i}}Downloads include compiled CSS, compiled and minified CSS, and compiled jQuery plugins, all nicely packed up into a zipball for your convenience.{{/i}}

-
-
-
- - - -
{{! /span9 }} -
{{! row}} - -
{{! /.container }} diff --git a/docs/templates/pages/extend.mustache b/docs/templates/pages/extend.mustache deleted file mode 100644 index b5c8d5747402..000000000000 --- a/docs/templates/pages/extend.mustache +++ /dev/null @@ -1,161 +0,0 @@ - -
-
-

{{_i}}Extending Bootstrap{{/i}}

-

{{_i}}Extend Bootstrap to take advantage of included styles and components, as well as LESS variables and mixins.{{/i}}

-
-
- -
- - -
- -
- - - - -
- - - LESS CSS -

{{_i}}Bootstrap is made with LESS at its core, a dynamic stylesheet language created by our good friend, Alexis Sellier. It makes developing systems-based CSS faster, easier, and more fun.{{/i}}

- -

{{_i}}Why LESS?{{/i}}

-

{{_i}}One of Bootstrap's creators wrote a quick blog post about this, summarized here:{{/i}}

-
    -
  • {{_i}}Bootstrap compiles faster ~6x faster with Less compared to Sass{{/i}}
  • -
  • {{_i}}Less is written in JavaScript, making it easier to us to dive in and patch compared to Ruby with Sass.{{/i}}
  • -
  • {{_i}}Less is more; we want to feel like we're writing CSS and making Bootstrap approachable to all.{{/i}}
  • -
- -

{{_i}}What's included?{{/i}}

-

{{_i}}As an extension of CSS, LESS includes variables, mixins for reusable snippets of code, operations for simple math, nesting, and even color functions.{{/i}}

- -

{{_i}}Learn more{{/i}}

-

{{_i}}Visit the official website at http://lesscss.org to learn more.{{/i}}

-
- - - - -
- - -

{{_i}}Since our CSS is written with Less and utilizes variables and mixins, it needs to be compiled for final production implementation. Here's how.{{/i}}

- -
- {{_i}}Note: If you're submitting a pull request to GitHub with modified CSS, you must recompile the CSS via any of these methods.{{/i}} -
- -

{{_i}}Tools for compiling{{/i}}

- -

{{_i}}Command line{{/i}}

-

{{_i}}Follow the instructions in the project readme on GitHub for compiling via command line.{{/i}}

- -

{{_i}}JavaScript{{/i}}

-

{{_i}}Download the latest Less.js and include the path to it (and Bootstrap) in the <head>.{{/i}}

-
-<link rel="stylesheet/less" href="/path/to/bootstrap.less">
-<script src="/path/to/less.js"></script>
-
-

{{_i}}To recompile the .less files, just save them and reload your page. Less.js compiles them and stores them in local storage.{{/i}}

- -

{{_i}}Unofficial Mac app{{/i}}

-

{{_i}}The unofficial Mac app watches directories of .less files and compiles the code to local files after every save of a watched .less file. If you like, you can toggle preferences in the app for automatic minifying and which directory the compiled files end up in.{{/i}}

- -

{{_i}}More apps{{/i}}

-

Crunch

-

{{_i}}Crunch is a great looking LESS editor and compiler built on Adobe Air.{{/i}}

-

CodeKit

-

{{_i}}Created by the same guy as the unofficial Mac app, CodeKit is a Mac app that compiles LESS, SASS, Stylus, and CoffeeScript.{{/i}}

-

Simpless

-

{{_i}}Mac, Linux, and Windows app for drag and drop compiling of LESS files. Plus, the source code is on GitHub.{{/i}}

- -
- - - - -
- -

{{_i}}Quickly start any web project by dropping in the compiled or minified CSS and JS. Layer on custom styles separately for easy upgrades and maintenance moving forward.{{/i}}

- -

{{_i}}Setup file structure{{/i}}

-

{{_i}}Download the latest compiled Bootstrap and place into your project. For example, you might have something like this:{{/i}}

-
-   app/
-       layouts/
-       templates/
-   public/
-       css/
-           bootstrap.min.css
-       js/
-           bootstrap.min.js
-       img/
-           glyphicons-halflings.png
-           glyphicons-halflings-white.png
-
- -

{{_i}}Utilize starter template{{/i}}

-

{{_i}}Copy the following base HTML to get started.{{/i}}

-
-<html>
-  <head>
-    <title>Bootstrap 101 Template</title>
-    <!-- Bootstrap -->
-    <link href="public/css/bootstrap.min.css" rel="stylesheet">
-  </head>
-  <body>
-    <h1>Hello, world!</h1>
-    <!-- Bootstrap -->
-    <script src="public/js/bootstrap.min.js"></script>
-  </body>
-</html>
-
- -

{{_i}}Layer on custom code{{/i}}

-

{{_i}}Work in your custom CSS, JS, and more as necessary to make Bootstrap your own with your own separate CSS and JS files.{{/i}}

-
-<html>
-  <head>
-    <title>Bootstrap 101 Template</title>
-    <!-- Bootstrap -->
-    <link href="public/css/bootstrap.min.css" rel="stylesheet">
-    <!-- Project -->
-    <link href="public/css/application.css" rel="stylesheet">
-  </head>
-  <body>
-    <h1>Hello, world!</h1>
-    <!-- Bootstrap -->
-    <script src="public/js/bootstrap.min.js"></script>
-    <!-- Project -->
-    <script src="public/js/application.js"></script>
-  </body>
-</html>
-
- -
- -
{{! /span9 }} -
{{! row}} - -
{{! /.container }} diff --git a/docs/templates/pages/getting-started.mustache b/docs/templates/pages/getting-started.mustache deleted file mode 100644 index ae1534ce36bf..000000000000 --- a/docs/templates/pages/getting-started.mustache +++ /dev/null @@ -1,256 +0,0 @@ - -
-
-

{{_i}}Getting started{{/i}}

-

{{_i}}Overview of the project, its contents, and how to get started with a simple template.{{/i}}

-
-
- - -
- - -
- -
- - - - -
- -

{{_i}}Before downloading, be sure to have a code editor (we recommend Sublime Text 2) and some working knowledge of HTML and CSS. We won't walk through the source files here, but they are available for download. We'll focus on getting started with the compiled Bootstrap files.{{/i}}

- -
-
-

{{_i}}Download compiled{{/i}}

-

{{_i}}Fastest way to get started: get the compiled and minified versions of our CSS, JS, and images. No docs or original source files.{{/i}}

-

{{_i}}Download Bootstrap{{/i}}

-
-
-

Download source

-

Get the original files for all CSS and JavaScript, along with a local copy of the docs by downloading the latest version directly from GitHub.

-

{{_i}}Download Bootstrap source{{/i}}

-
-
-
- - - - -
- -

{{_i}}Within the download you'll find the following file structure and contents, logically grouping common assets and providing both compiled and minified variations.{{/i}}

-

{{_i}}Once downloaded, unzip the compressed folder to see the structure of (the compiled) Bootstrap. You'll see something like this:{{/i}}

-
-  bootstrap/
-  ├── css/
-  │   ├── bootstrap.css
-  │   ├── bootstrap.min.css
-  ├── js/
-  │   ├── bootstrap.js
-  │   ├── bootstrap.min.js
-  └── img/
-      ├── glyphicons-halflings.png
-      └── glyphicons-halflings-white.png
-
-

{{_i}}This is the most basic form of Bootstrap: compiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (bootstrap.*), as well as compiled and minified CSS and JS (bootstrap.min.*). The image files are compressed using ImageOptim, a Mac app for compressing PNGs.{{/i}}

-

{{_i}}Please note that all JavaScript plugins require jQuery to be included.{{/i}}

-
- - - - -
- -

{{_i}}Bootstrap comes equipped with HTML, CSS, and JS for all sorts of things, but they can be summarized with a handful of categories visible at the top of the Bootstrap documentation.{{/i}}

- -

{{_i}}Docs sections{{/i}}

-

{{_i}}Scaffolding{{/i}}

-

{{_i}}Global styles for the body to reset type and background, link styles, grid system, and two simple layouts.{{/i}}

-

{{_i}}Base CSS{{/i}}

-

{{_i}}Styles for common HTML elements like typography, code, tables, forms, and buttons. Also includes Glyphicons, a great little icon set.{{/i}}

-

{{_i}}Components{{/i}}

-

{{_i}}Basic styles for common interface components like tabs and pills, navbar, alerts, page headers, and more.{{/i}}

-

{{_i}}JavaScript plugins{{/i}}

-

{{_i}}Similar to Components, these JavaScript plugins are interactive components for things like tooltips, popovers, modals, and more.{{/i}}

- -

{{_i}}List of components{{/i}}

-

{{_i}}Together, the Components and JavaScript plugins sections provide the following interface elements:{{/i}}

-
    -
  • {{_i}}Button groups{{/i}}
  • -
  • {{_i}}Button dropdowns{{/i}}
  • -
  • {{_i}}Navigational tabs, pills, and lists{{/i}}
  • -
  • {{_i}}Navbar{{/i}}
  • -
  • {{_i}}Labels{{/i}}
  • -
  • {{_i}}Badges{{/i}}
  • -
  • {{_i}}Page headers and hero unit{{/i}}
  • -
  • {{_i}}Thumbnails{{/i}}
  • -
  • {{_i}}Alerts{{/i}}
  • -
  • {{_i}}Progress bars{{/i}}
  • -
  • {{_i}}Modals{{/i}}
  • -
  • {{_i}}Dropdowns{{/i}}
  • -
  • {{_i}}Tooltips{{/i}}
  • -
  • {{_i}}Popovers{{/i}}
  • -
  • {{_i}}Accordion{{/i}}
  • -
  • {{_i}}Carousel{{/i}}
  • -
  • {{_i}}Typeahead{{/i}}
  • -
-

{{_i}}In future guides, we may walk through these components individually in more detail. Until then, look for each of these in the documentation for information on how to utilize and customize them.{{/i}}

-
- - - - -
- -

{{_i}}With a brief intro into the contents out of the way, we can focus on putting Bootstrap to use. To do that, we'll utilize a basic HTML template that includes everything we mentioned in the File structure.{{/i}}

-

{{_i}}Now, here's a look at a typical HTML file:{{/i}}

-
-<!DOCTYPE html>
-<html>
-  <head>
-    <title>Bootstrap 101 Template</title>
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  </head>
-  <body>
-    <h1>Hello, world!</h1>
-    <script src="http://code.jquery.com/jquery.js"></script>
-  </body>
-</html>
-
-

{{_i}}To make this a Bootstrapped template, just include the appropriate CSS and JS files:{{/i}}

-
-<!DOCTYPE html>
-<html>
-  <head>
-    <title>Bootstrap 101 Template</title>
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <!-- Bootstrap -->
-    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
-  </head>
-  <body>
-    <h1>Hello, world!</h1>
-    <script src="http://code.jquery.com/jquery.js"></script>
-    <script src="js/bootstrap.min.js"></script>
-  </body>
-</html>
-
-

{{_i}}And you're set! With those two files added, you can begin to develop any site or application with Bootstrap.{{/i}}

-
- - - - -
- -

{{_i}}Move beyond the base template with a few example layouts. We encourage folks to iterate on these examples and not simply use them as an end result.{{/i}}

-
    -
  • - - - -

    {{_i}}Starter template{{/i}}

    -

    {{_i}}A barebones HTML document with all the Bootstrap CSS and JavaScript included.{{/i}}

    -
  • -
  • - - - -

    {{_i}}Basic marketing site{{/i}}

    -

    {{_i}}Featuring a hero unit for a primary message and three supporting elements.{{/i}}

    -
  • -
  • - - - -

    {{_i}}Fluid layout{{/i}}

    -

    {{_i}}Uses our new responsive, fluid grid system to create a seamless liquid layout.{{/i}}

    -
  • - -
  • - - - -

    {{_i}}Narrow marketing{{/i}}

    -

    {{_i}}Slim, lightweight marketing template for small projects or teams.{{/i}}

    -
  • -
  • - - - -

    {{_i}}Justified nav{{/i}}

    -

    {{_i}}Marketing page with equal-width navigation links in a modified navbar.{{/i}}

    -
  • -
  • - - - -

    {{_i}}Sign in{{/i}}

    -

    {{_i}}Barebones sign in form with custom, larger form controls and a flexible layout.{{/i}}

    -
  • - -
  • - - - -

    {{_i}}Sticky footer{{/i}}

    -

    {{_i}}Pin a fixed-height footer to the bottom of the user's viewport.{{/i}}

    -
  • -
  • - - - -

    {{_i}}Carousel jumbotron{{/i}}

    -

    {{_i}}A more interactive riff on the basic marketing site featuring a prominent carousel.{{/i}}

    -
  • -
-
- - - - - -
- -

{{_i}}Head to the docs for information, examples, and code snippets, or take the next leap and customize Bootstrap for any upcoming project.{{/i}}

- {{_i}}Visit the Bootstrap docs{{/i}} - {{_i}}Customize Bootstrap{{/i}} -
- - - - -
{{! /span9 }} -
{{! row}} - -
{{! /.container }} diff --git a/docs/templates/pages/index.mustache b/docs/templates/pages/index.mustache deleted file mode 100644 index b38ddec2549a..000000000000 --- a/docs/templates/pages/index.mustache +++ /dev/null @@ -1,100 +0,0 @@ -
-
-

{{_i}}Bootstrap{{/i}}

-

{{_i}}Sleek, intuitive, and powerful front-end framework for faster and easier web development.{{/i}}

-

- {{_i}}Download Bootstrap{{/i}} -

- -
-
- -
-
- -
-
- -
- -
- -

{{_i}}Introducing Bootstrap.{{/i}}

- - -
-
- -

{{_i}}By nerds, for nerds.{{/i}}

-

{{_i}}Built at Twitter by @mdo and @fat, Bootstrap utilizes LESS CSS, is compiled via Node, and is managed through GitHub to help nerds do awesome stuff on the web.{{/i}}

-
-
- -

{{_i}}Made for everyone.{{/i}}

-

{{_i}}Bootstrap was made to not only look and behave great in the latest desktop browsers (as well as IE7!), but in tablet and smartphone browsers via responsive CSS as well.{{/i}}

-
-
- -

{{_i}}Packed with features.{{/i}}

-

{{_i}}A 12-column responsive grid, dozens of components, JavaScript plugins, typography, form controls, and even a web-based Customizer to make Bootstrap your own.{{/i}}

-
-
- -
- -

{{_i}}Built with Bootstrap.{{/i}}

- -
- -
- -
{{! /.marketing }} - -
{{! /.container }} diff --git a/docs/templates/pages/javascript.mustache b/docs/templates/pages/javascript.mustache deleted file mode 100644 index 744988f4b457..000000000000 --- a/docs/templates/pages/javascript.mustache +++ /dev/null @@ -1,1660 +0,0 @@ - -
-
-

{{_i}}JavaScript{{/i}}

-

{{_i}}Bring Bootstrap's components to life—now with 13 custom jQuery plugins.{{/i}} -

-
- -
- - -
- -
- - - -
- - -

{{_i}}Individual or compiled{{/i}}

-

{{_i}}Plugins can be included individually (though some have required dependencies), or all at once. Both bootstrap.js and bootstrap.min.js contain all plugins in a single file.{{/i}}

- -

{{_i}}Data attributes{{/i}}

-

{{_i}}You can use all Bootstrap plugins purely through the markup API without writing a single line of JavaScript. This is Bootstrap's first class API and should be your first consideration when using a plugin.{{/i}}

- -

{{_i}}That said, in some situations it may be desirable to turn this functionality off. Therefore, we also provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this:{{/i}} -

$('body').off('.data-api')
- -

{{_i}}Alternatively, to target a specific plugin, just include the plugin's name as a namespace along with the data-api namespace like this:{{/i}}

-
$('body').off('.alert.data-api')
- -

{{_i}}Programmatic API{{/i}}

-

{{_i}}We also believe you should be able to use all Bootstrap plugins purely through the JavaScript API. All public APIs are single, chainable methods, and return the collection acted upon.{{/i}}

-
$(".btn.danger").button("toggle").addClass("fat")
-

{{_i}}All methods should accept an optional options object, a string which targets a particular method, or nothing (which initiates a plugin with default behavior):{{/i}}

-
-$("#myModal").modal()                       // initialized with defaults
-$("#myModal").modal({ keyboard: false })   // initialized with no keyboard
-$("#myModal").modal('show')                // initializes and invokes show immediately

-
-

{{_i}}Each plugin also exposes its raw constructor on a `Constructor` property: $.fn.popover.Constructor. If you'd like to get a particular plugin instance, retrieve it directly from an element: $('[rel=popover]').data('popover').{{/i}}

- -

{{_i}}No Conflict{{/i}}

-

{{_i}}Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. If this happens, you may call .noConflict on the plugin you wish to revert the value of.{{/i}}

- -
-var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
-$.fn.bootstrapBtn = bootstrapButton            // give $().bootstrapBtn the bootstrap functionality
-
- -

{{_i}}Events{{/i}}

-

{{_i}}Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. show) is triggered at the start of an event, and its past participle form (ex. shown) is trigger on the completion of an action.{{/i}}

-

{{_i}}All infinitive events provide preventDefault functionality. This provides the ability to stop the execution of an action before it starts.{{/i}}

-
-$('#myModal').on('show', function (e) {
-    if (!data) return e.preventDefault() // stops modal from being shown
-})
-
-
- - - - -
- -

{{_i}}About transitions{{/i}}

-

{{_i}}For simple transition effects, include bootstrap-transition.js once alongside the other JS files. If you're using the compiled (or minified) bootstrap.js, there is no need to include this—it's already there.{{/i}}

-

{{_i}}Use cases{{/i}}

-

{{_i}}A few examples of the transition plugin:{{/i}}

-
    -
  • {{_i}}Sliding or fading in modals{{/i}}
  • -
  • {{_i}}Fading out tabs{{/i}}
  • -
  • {{_i}}Fading out alerts{{/i}}
  • -
  • {{_i}}Sliding carousel panes{{/i}}
  • -
- - {{! Ideas: include docs for .fade.in, .slide.in, etc }} -
- - - - -
- - - -

{{_i}}Examples{{/i}}

-

{{_i}}Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.{{/i}}

- -

{{_i}}Static example{{/i}}

-

{{_i}}A rendered modal with header, body, and set of actions in the footer.{{/i}}

-
- -
{{! /example }} -
-<div class="modal hide fade">
-  <div class="modal-header">
-    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
-    <h3>{{_i}}Modal header{{/i}}</h3>
-  </div>
-  <div class="modal-body">
-    <p>{{_i}}One fine body…{{/i}}</p>
-  </div>
-  <div class="modal-footer">
-    <a href="#" class="btn">{{_i}}Close{{/i}}</a>
-    <a href="#" class="btn btn-primary">{{_i}}Save changes{{/i}}</a>
-  </div>
-</div>
-
- -

{{_i}}Live demo{{/i}}

-

{{_i}}Toggle a modal via JavaScript by clicking the button below. It will slide down and fade in from the top of the page.{{/i}}

- - - {{! /example }} -
-<!-- Button to trigger modal -->
-<a href="#myModal" role="button" class="btn" data-toggle="modal">{{_i}}Launch demo modal{{/i}}</a>
-
-<!-- Modal -->
-<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
-  <div class="modal-header">
-    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
-    <h3 id="myModalLabel">Modal header</h3>
-  </div>
-  <div class="modal-body">
-    <p>{{_i}}One fine body…{{/i}}</p>
-  </div>
-  <div class="modal-footer">
-    <button class="btn" data-dismiss="modal" aria-hidden="true">{{_i}}Close{{/i}}</button>
-    <button class="btn btn-primary">{{_i}}Save changes{{/i}}</button>
-  </div>
-</div>
-
- - -
- - -

{{_i}}Usage{{/i}}

- -

{{_i}}Via data attributes{{/i}}

-

{{_i}}Activate a modal without writing JavaScript. Set data-toggle="modal" on a controller element, like a button, along with a data-target="#foo" or href="#foo" to target a specific modal to toggle.{{/i}}

-
<button type="button" data-toggle="modal" data-target="#myModal">Launch modal</button>
- -

{{_i}}Via JavaScript{{/i}}

-

{{_i}}Call a modal with id myModal with a single line of JavaScript:{{/i}}

-
$('#myModal').modal(options)
- -

{{_i}}Options{{/i}}

-

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-backdrop="".{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Name{{/i}}{{_i}}type{{/i}}{{_i}}default{{/i}}{{_i}}description{{/i}}
{{_i}}backdrop{{/i}}{{_i}}boolean{{/i}}{{_i}}true{{/i}}{{_i}}Includes a modal-backdrop element. Alternatively, specify static for a backdrop which doesn't close the modal on click.{{/i}}
{{_i}}keyboard{{/i}}{{_i}}boolean{{/i}}{{_i}}true{{/i}}{{_i}}Closes the modal when escape key is pressed{{/i}}
{{_i}}show{{/i}}{{_i}}boolean{{/i}}{{_i}}true{{/i}}{{_i}}Shows the modal when initialized.{{/i}}
{{_i}}remote{{/i}}{{_i}}path{{/i}}{{_i}}false{{/i}}

{{_i}}If a remote url is provided, content will be loaded via jQuery's load method and injected into the .modal-body. If you're using the data api, you may alternatively use the href tag to specify the remote source. An example of this is shown below:{{/i}}

-
<a data-toggle="modal" href="remote.html" data-target="#modal">click me</a>
- - Methods{{/i}} -

.modal({{_i}}options{{/i}})

-

{{_i}}Activates your content as a modal. Accepts an optional options object.{{/i}}

-
-$('#myModal').modal({
-  keyboard: false
-})
-
-

.modal('toggle')

-

{{_i}}Manually toggles a modal.{{/i}}

-
$('#myModal').modal('toggle')
-

.modal('show')

-

{{_i}}Manually opens a modal.{{/i}}

-
$('#myModal').modal('show')
-

.modal('hide')

-

{{_i}}Manually hides a modal.{{/i}}

-
$('#myModal').modal('hide')
-

{{_i}}Events{{/i}}

-

{{_i}}Bootstrap's modal class exposes a few events for hooking into modal functionality.{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Event{{/i}}{{_i}}Description{{/i}}
{{_i}}show{{/i}}{{_i}}This event fires immediately when the show instance method is called.{{/i}}
{{_i}}shown{{/i}}{{_i}}This event is fired when the modal has been made visible to the user (will wait for css transitions to complete).{{/i}}
{{_i}}hide{{/i}}{{_i}}This event is fired immediately when the hide instance method has been called.{{/i}}
{{_i}}hidden{{/i}}{{_i}}This event is fired when the modal has finished being hidden from the user (will wait for css transitions to complete).{{/i}}
-
-$('#myModal').on('hidden', function () {
-  // {{_i}}do something…{{/i}}
-})
-
-
- - - - - - - - - -
- - - -

{{_i}}Example in navbar{{/i}}

-

{{_i}}The ScrollSpy plugin is for automatically updating nav targets based on scroll position. Scroll the area below the navbar and watch the active class change. The dropdown sub items will be highlighted as well.{{/i}}

-
- -
-

@fat

-

Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.

-

@mdo

-

Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard. Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi, ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar deserunt.

-

one

-

Occaecat commodo aliqua delectus. Fap craft beer deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, sustainable delectus consectetur fanny pack iphone.

-

two

-

In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt.

-

three

-

Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.

-

Keytar twee blog, culpa messenger bag marfa whatever delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats you probably haven't heard of them consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat before they sold out, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats. -

-
-
{{! /example }} - - -
- - -

{{_i}}Usage{{/i}}

- -

{{_i}}Via data attributes{{/i}}

-

{{_i}}To easily add scrollspy behavior to your topbar navigation, just add data-spy="scroll" to the element you want to spy on (most typically this would be the body) and data-target=".navbar" to select which nav to use. You'll want to use scrollspy with a .nav component.{{/i}}

-
<body data-spy="scroll" data-target=".navbar">...</body>
- -

{{_i}}Via JavaScript{{/i}}

-

{{_i}}Call the scrollspy via JavaScript:{{/i}}

-
$('#navbar').scrollspy()
- -
- {{_i}}Heads up!{{/i}} - {{_i}}Navbar links must have resolvable id targets. For example, a <a href="#home">home</a> must correspond to something in the dom like <div id="home"></div>.{{/i}} -
- -

{{_i}}Methods{{/i}}

-

.scrollspy('refresh')

-

{{_i}}When using scrollspy in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh method like so:{{/i}}

-
-$('[data-spy="scroll"]').each(function () {
-  var $spy = $(this).scrollspy('refresh')
-});
-
- -

{{_i}}Options{{/i}}

-

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-offset="".{{/i}}

- - - - - - - - - - - - - - - - - -
{{_i}}Name{{/i}}{{_i}}type{{/i}}{{_i}}default{{/i}}{{_i}}description{{/i}}
{{_i}}offset{{/i}}{{_i}}number{{/i}}{{_i}}10{{/i}}{{_i}}Pixels to offset from top when calculating position of scroll.{{/i}}
- -

{{_i}}Events{{/i}}

- - - - - - - - - - - - - -
{{_i}}Event{{/i}}{{_i}}Description{{/i}}
{{_i}}activate{{/i}}{{_i}}This event fires whenever a new item becomes activated by the scrollspy.{{/i}}
-
- - - - -
- - - -

{{_i}}Example tabs{{/i}}

-

{{_i}}Add quick, dynamic tab functionality to transition through panes of local content, even via dropdown menus.{{/i}}

-
- -
-
-

Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

-
-
-

Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

-
- - -
-
{{! /example }} - - -
- - -

{{_i}}Usage{{/i}}

-

{{_i}}Enable tabbable tabs via JavaScript (each tab needs to be activated individually):{{/i}}

-
-$('#myTab a').click(function (e) {
-  e.preventDefault();
-  $(this).tab('show');
-})
-

{{_i}}You can activate individual tabs in several ways:{{/i}}

-
-$('#myTab a[href="#profile"]').tab('show'); // Select tab by name
-$('#myTab a:first').tab('show'); // Select first tab
-$('#myTab a:last').tab('show'); // Select last tab
-$('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
-
- -

{{_i}}Markup{{/i}}

-

{{_i}}You can activate a tab or pill navigation without writing any JavaScript by simply specifying data-toggle="tab" or data-toggle="pill" on an element. Adding the nav and nav-tabs classes to the tab ul will apply the Bootstrap tab styling.{{/i}}

-
-<ul class="nav nav-tabs">
-  <li><a href="#home" data-toggle="tab">{{_i}}Home{{/i}}</a></li>
-  <li><a href="#profile" data-toggle="tab">{{_i}}Profile{{/i}}</a></li>
-  <li><a href="#messages" data-toggle="tab">{{_i}}Messages{{/i}}</a></li>
-  <li><a href="#settings" data-toggle="tab">{{_i}}Settings{{/i}}</a></li>
-</ul>
- -

{{_i}}Methods{{/i}}

-

$().tab

-

- {{_i}}Activates a tab element and content container. Tab should have either a data-target or an href targeting a container node in the DOM.{{/i}} -

-
-<ul class="nav nav-tabs" id="myTab">
-  <li class="active"><a href="#home">{{_i}}Home{{/i}}</a></li>
-  <li><a href="#profile">{{_i}}Profile{{/i}}</a></li>
-  <li><a href="#messages">{{_i}}Messages{{/i}}</a></li>
-  <li><a href="#settings">{{_i}}Settings{{/i}}</a></li>
-</ul>
-
-<div class="tab-content">
-  <div class="tab-pane active" id="home">...</div>
-  <div class="tab-pane" id="profile">...</div>
-  <div class="tab-pane" id="messages">...</div>
-  <div class="tab-pane" id="settings">...</div>
-</div>
-
-<script>
-  $(function () {
-    $('#myTab a:last').tab('show');
-  })
-</script>
-
- -

{{_i}}Events{{/i}}

- - - - - - - - - - - - - - - - - -
{{_i}}Event{{/i}}{{_i}}Description{{/i}}
{{_i}}show{{/i}}{{_i}}This event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.{{/i}}
{{_i}}shown{{/i}}{{_i}}This event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.{{/i}}
-
-$('a[data-toggle="tab"]').on('shown', function (e) {
-  e.target // activated tab
-  e.relatedTarget // previous tab
-})
-
-
- - - -
- - - -

{{_i}}Examples{{/i}}

-

{{_i}}Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage.{{/i}}

-

{{_i}}For performance reasons, the tooltip and popover data-apis are opt in, meaning you must initialize them yourself.{{/i}}

-

{{_i}}Hover over the links below to see tooltips:{{/i}}

-
-

{{_i}}Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.{{/i}} -

-
{{! /example }} - -

{{_i}}Four directions{{/i}}

- {{! /example }} - - -

{{_i}}Tooltips in input groups{{/i}}

-

{{_i}}When using tooltips and popovers with the Bootstrap input groups, you'll have to set the container (documented below) option to avoid unwanted side effects.{{/i}}

- -
- - -

{{_i}}Usage{{/i}}

-

{{_i}}Trigger the tooltip via JavaScript:{{/i}}

-
$('#example').tooltip({{_i}}options{{/i}})
- -

{{_i}}Options{{/i}}

-

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Name{{/i}}{{_i}}type{{/i}}{{_i}}default{{/i}}{{_i}}description{{/i}}
{{_i}}animation{{/i}}{{_i}}boolean{{/i}}true{{_i}}apply a css fade transition to the tooltip{{/i}}
{{_i}}html{{/i}}{{_i}}boolean{{/i}}false{{_i}}Insert html into the tooltip. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.{{/i}}
{{_i}}placement{{/i}}{{_i}}string | function{{/i}}'top'{{_i}}how to position the tooltip{{/i}} - top | bottom | left | right
{{_i}}selector{{/i}}{{_i}}string{{/i}}false{{_i}}If a selector is provided, tooltip objects will be delegated to the specified targets.{{/i}}
{{_i}}title{{/i}}{{_i}}string | function{{/i}}''{{_i}}default title value if `title` tag isn't present{{/i}}
{{_i}}trigger{{/i}}{{_i}}string{{/i}}'hover focus'{{_i}}how tooltip is triggered{{/i}} - click | hover | focus | manual. {{_i}}Note you case pass trigger mutliple, space seperated, trigger types.{{/i}}
{{_i}}delay{{/i}}{{_i}}number | object{{/i}}0 -

{{_i}}delay showing and hiding the tooltip (ms) - does not apply to manual trigger type{{/i}}

-

{{_i}}If a number is supplied, delay is applied to both hide/show{{/i}}

-

{{_i}}Object structure is: delay: { show: 500, hide: 100 }{{/i}}

-
{{_i}}container{{/i}}{{_i}}string | false{{/i}}{{_i}}false{{/i}} -

{{_i}}Appends the tooltip to a specific element container: 'body'{{/i}}

-
-
- {{_i}}Heads up!{{/i}} - {{_i}}Options for individual tooltips can alternatively be specified through the use of data attributes.{{/i}} -
- -

{{_i}}Markup{{/i}}

-
<a href="#" data-toggle="tooltip" title="{{_i}}first tooltip{{/i}}">{{_i}}hover over me{{/i}}</a>
- -

{{_i}}Methods{{/i}}

-

$().tooltip({{_i}}options{{/i}})

-

{{_i}}Attaches a tooltip handler to an element collection.{{/i}}

-

.tooltip('show')

-

{{_i}}Reveals an element's tooltip.{{/i}}

-
$('#element').tooltip('show')
-

.tooltip('hide')

-

{{_i}}Hides an element's tooltip.{{/i}}

-
$('#element').tooltip('hide')
-

.tooltip('toggle')

-

{{_i}}Toggles an element's tooltip.{{/i}}

-
$('#element').tooltip('toggle')
-

.tooltip('destroy')

-

{{_i}}Hides and destroys an element's tooltip.{{/i}}

-
$('#element').tooltip('destroy')
-
- - - - -
- - -

{{_i}}Examples{{/i}}

-

{{_i}}Add small overlays of content, like those on the iPad, to any element for housing secondary information. Hover over the button to trigger the popover. Requires Tooltip to be included.{{/i}}

- -

{{_i}}Static popover{{/i}}

-

{{_i}}Four options are available: top, right, bottom, and left aligned.{{/i}}

-
-
-
-

Popover top

-
-

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

-
-
- -
-
-

Popover right

-
-

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

-
-
- -
-
-

Popover bottom

-
-

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

-
-
- -
-
-

Popover left

-
-

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

-
-
- -
-
-

{{_i}}No markup shown as popovers are generated from JavaScript and content within a data attribute.{{/i}}

- -

Live demo

- - -

{{_i}}Four directions{{/i}}

- {{! /example }} - - -
- - -

{{_i}}Usage{{/i}}

-

{{_i}}Enable popovers via JavaScript:{{/i}}

-
$('#example').popover({{_i}}options{{/i}})
- -

{{_i}}Options{{/i}}

-

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Name{{/i}}{{_i}}type{{/i}}{{_i}}default{{/i}}{{_i}}description{{/i}}
{{_i}}animation{{/i}}{{_i}}boolean{{/i}}true{{_i}}apply a css fade transition to the tooltip{{/i}}
{{_i}}html{{/i}}{{_i}}boolean{{/i}}false{{_i}}Insert html into the popover. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.{{/i}}
{{_i}}placement{{/i}}{{_i}}string | function{{/i}}'right'{{_i}}how to position the popover{{/i}} - top | bottom | left | right
{{_i}}selector{{/i}}{{_i}}string{{/i}}false{{_i}}if a selector is provided, tooltip objects will be delegated to the specified targets{{/i}}
{{_i}}trigger{{/i}}{{_i}}string{{/i}}'click'{{_i}}how popover is triggered{{/i}} - click | hover | focus | manual
{{_i}}title{{/i}}{{_i}}string | function{{/i}}''{{_i}}default title value if `title` attribute isn't present{{/i}}
{{_i}}content{{/i}}{{_i}}string | function{{/i}}''{{_i}}default content value if `data-content` attribute isn't present{{/i}}
{{_i}}delay{{/i}}{{_i}}number | object{{/i}}0 -

{{_i}}delay showing and hiding the popover (ms) - does not apply to manual trigger type{{/i}}

-

{{_i}}If a number is supplied, delay is applied to both hide/show{{/i}}

-

{{_i}}Object structure is: delay: { show: 500, hide: 100 }{{/i}}

-
{{_i}}container{{/i}}{{_i}}string | false{{/i}}{{_i}}false{{/i}} -

{{_i}}Appends the popover to a specific element container: 'body'{{/i}}

-
-
- {{_i}}Heads up!{{/i}} - {{_i}}Options for individual popovers can alternatively be specified through the use of data attributes.{{/i}} -
- -

{{_i}}Markup{{/i}}

-

{{_i}}For performance reasons, the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a selector option.{{/i}}

- -

{{_i}}Methods{{/i}}

-

$().popover({{_i}}options{{/i}})

-

{{_i}}Initializes popovers for an element collection.{{/i}}

-

.popover('show')

-

{{_i}}Reveals an elements popover.{{/i}}

-
$('#element').popover('show')
-

.popover('hide')

-

{{_i}}Hides an elements popover.{{/i}}

-
$('#element').popover('hide')
-

.popover('toggle')

-

{{_i}}Toggles an elements popover.{{/i}}

-
$('#element').popover('toggle')
-

.popover('destroy')

-

{{_i}}Hides and destroys an element's popover.{{/i}}

-
$('#element').popover('destroy')
-
- - - - -
- - - -

{{_i}}Example alerts{{/i}}

-

{{_i}}Add dismiss functionality to all alert messages with this plugin.{{/i}}

-
-
- - {{_i}}Holy guacamole!{{/i}} {{_i}}Best check yo self, you're not looking too good.{{/i}} -
-
{{! /example }} - -
-
- -

{{_i}}Oh snap! You got an error!{{/i}}

-

{{_i}}Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.{{/i}}

-

- {{_i}}Take this action{{/i}} {{_i}}Or do this{{/i}} -

-
-
{{! /example }} - - -
- - -

{{_i}}Usage{{/i}}

-

{{_i}}Enable dismissal of an alert via JavaScript:{{/i}}

-
$(".alert").alert()
- -

{{_i}}Markup{{/i}}

-

{{_i}}Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.{{/i}}

-
<a class="close" data-dismiss="alert" href="#">&times;</a>
- -

{{_i}}Methods{{/i}}

-

$().alert()

-

{{_i}}Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.{{/i}}

-

.alert('close')

-

{{_i}}Closes an alert.{{/i}}

-
$(".alert").alert('close')
- - -

{{_i}}Events{{/i}}

-

{{_i}}Bootstrap's alert class exposes a few events for hooking into alert functionality.{{/i}}

- - - - - - - - - - - - - - - - - -
{{_i}}Event{{/i}}{{_i}}Description{{/i}}
{{_i}}close{{/i}}{{_i}}This event fires immediately when the close instance method is called.{{/i}}
{{_i}}closed{{/i}}{{_i}}This event is fired when the alert has been closed (will wait for css transitions to complete).{{/i}}
-
-$('#my-alert').bind('closed', function () {
-  // {{_i}}do something…{{/i}}
-})
-
-
- - - - -
- - -

{{_i}}Example uses{{/i}}

-

{{_i}}Do more with buttons. Control button states or create groups of buttons for more components like toolbars.{{/i}}

- -

{{_i}}Stateful{{/i}}

-

{{_i}}Add data-loading-text="Loading..." to use a loading state on a button.{{/i}}

-
- -
{{! /example }} -
<button type="button" class="btn btn-primary" data-loading-text="Loading...">Loading state</button>
- -

{{_i}}Single toggle{{/i}}

-

{{_i}}Add data-toggle="button" to activate toggling on a single button.{{/i}}

-
- -
{{! /example }} -
<button type="button" class="btn btn-primary" data-toggle="button">Single Toggle</button>
- -

{{_i}}Checkbox{{/i}}

-

{{_i}}Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.{{/i}}

-
-
- - - -
-
{{! /example }} -
-<div class="btn-group" data-toggle="buttons-checkbox">
-  <button type="button" class="btn btn-primary">Left</button>
-  <button type="button" class="btn btn-primary">Middle</button>
-  <button type="button" class="btn btn-primary">Right</button>
-</div>
-
- -

{{_i}}Radio{{/i}}

-

{{_i}}Add data-toggle="buttons-radio" for radio style toggling on btn-group.{{/i}}

-
-
- - - -
-
{{! /example }} -
-<div class="btn-group" data-toggle="buttons-radio">
-  <button type="button" class="btn btn-primary">Left</button>
-  <button type="button" class="btn btn-primary">Middle</button>
-  <button type="button" class="btn btn-primary">Right</button>
-</div>
-
- - -
- - -

{{_i}}Usage{{/i}}

-

{{_i}}Enable buttons via JavaScript:{{/i}}

-
$('.nav-tabs').button()
- -

{{_i}}Markup{{/i}}

-

{{_i}}Data attributes are integral to the button plugin. Check out the example code below for the various markup types.{{/i}}

- -

{{_i}}Options{{/i}}

-

{{_i}}None{{/i}}

- -

{{_i}}Methods{{/i}}

-

$().button('toggle')

-

{{_i}}Toggles push state. Gives the button the appearance that it has been activated.{{/i}}

-
- {{_i}}Heads up!{{/i}} - {{_i}}You can enable auto toggling of a button by using the data-toggle attribute.{{/i}} -
-
<button type="button" class="btn" data-toggle="button" >…</button>
-

$().button('loading')

-

{{_i}}Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text.{{/i}} -

-
<button type="button" class="btn" data-loading-text="loading stuff..." >...</button>
-
- {{_i}}Heads up!{{/i}} - {{_i}}Firefox persists the disabled state across page loads. A workaround for this is to use autocomplete="off".{{/i}} -
-

$().button('reset')

-

{{_i}}Resets button state - swaps text to original text.{{/i}}

-

$().button(string)

-

{{_i}}Resets button state - swaps text to any data defined text state.{{/i}}

-
<button type="button" class="btn" data-complete-text="finished!" >...</button>
-<script>
-  $('.btn').button('complete')
-</script>
-
-
- - - - -
- - -

{{_i}}About{{/i}}

-

{{_i}}Get base styles and flexible support for collapsible components like accordions and navigation.{{/i}}

-

* {{_i}}Requires the Transitions plugin to be included.{{/i}}

- -

{{_i}}Example accordion{{/i}}

-

{{_i}}Using the collapse plugin, we built a simple accordion style widget:{{/i}}

- -
-
-
- -
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. -
-
-
-
- -
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. -
-
-
-
- -
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. -
-
-
-
-
{{! /example }} -
-<div class="accordion" id="accordion2">
-  <div class="accordion-group">
-    <div class="accordion-heading">
-      <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
-        {{_i}}Collapsible Group Item #1{{/i}}
-      </a>
-    </div>
-    <div id="collapseOne" class="accordion-body collapse in">
-      <div class="accordion-inner">
-        Anim pariatur cliche...
-      </div>
-    </div>
-  </div>
-  <div class="accordion-group">
-    <div class="accordion-heading">
-      <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
-        {{_i}}Collapsible Group Item #2{{/i}}
-      </a>
-    </div>
-    <div id="collapseTwo" class="accordion-body collapse">
-      <div class="accordion-inner">
-        Anim pariatur cliche...
-      </div>
-    </div>
-  </div>
-</div>
-...
-
-

{{_i}}You can also use the plugin without the accordion markup. Make a button toggle the expanding and collapsing of another element.{{/i}}

-
-<button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#demo">
-  {{_i}}simple collapsible{{/i}}
-</button>
-
-<div id="demo" class="collapse in"> … </div>
-
- - -
- - -

{{_i}}Usage{{/i}}

- -

{{_i}}Via data attributes{{/i}}

-

{{_i}}Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a css selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.{{/i}}

-

{{_i}}To add accordion-like group management to a collapsible control, add the data attribute data-parent="#selector". Refer to the demo to see this in action.{{/i}}

- -

{{_i}}Via JavaScript{{/i}}

-

{{_i}}Enable manually with:{{/i}}

-
$(".collapse").collapse()
- -

{{_i}}Options{{/i}}

-

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-parent="".{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Name{{/i}}{{_i}}type{{/i}}{{_i}}default{{/i}}{{_i}}description{{/i}}
{{_i}}parent{{/i}}{{_i}}selector{{/i}}false{{_i}}If selector then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior){{/i}}
{{_i}}toggle{{/i}}{{_i}}boolean{{/i}}true{{_i}}Toggles the collapsible element on invocation{{/i}}
- - -

{{_i}}Methods{{/i}}

-

.collapse({{_i}}options{{/i}})

-

{{_i}}Activates your content as a collapsible element. Accepts an optional options object.{{/i}} -

-$('#myCollapsible').collapse({
-  toggle: false
-})
-
-

.collapse('toggle')

-

{{_i}}Toggles a collapsible element to shown or hidden.{{/i}}

-

.collapse('show')

-

{{_i}}Shows a collapsible element.{{/i}}

-

.collapse('hide')

-

{{_i}}Hides a collapsible element.{{/i}}

- -

{{_i}}Events{{/i}}

-

{{_i}}Bootstrap's collapse class exposes a few events for hooking into collapse functionality.{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Event{{/i}}{{_i}}Description{{/i}}
{{_i}}show{{/i}}{{_i}}This event fires immediately when the show instance method is called.{{/i}}
{{_i}}shown{{/i}}{{_i}}This event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).{{/i}}
{{_i}}hide{{/i}} - {{_i}}This event is fired immediately when the hide method has been called.{{/i}} -
{{_i}}hidden{{/i}}{{_i}}This event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).{{/i}}
-
-$('#myCollapsible').on('hidden', function () {
-  // {{_i}}do something…{{/i}}
-})
-
- - - - - - - - - -
- - - -

{{_i}}Example{{/i}}

-

{{_i}}A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.{{/i}}

-
- -
{{! /example }} -
<input type="text" data-provide="typeahead">
-

You'll want to set autocomplete="off" to prevent default browser menus from appearing over the Bootstrap typeahead dropdown.

- -
- - -

{{_i}}Usage{{/i}}

- -

{{_i}}Via data attributes{{/i}}

-

{{_i}}Add data attributes to register an element with typeahead functionality as shown in the example above.{{/i}}

- -

{{_i}}Via JavaScript{{/i}}

-

{{_i}}Call the typeahead manually with:{{/i}}

-
$('.typeahead').typeahead()
- -

{{_i}}Options{{/i}}

-

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-source="".{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Name{{/i}}{{_i}}type{{/i}}{{_i}}default{{/i}}{{_i}}description{{/i}}
{{_i}}source{{/i}}{{_i}}array, function{{/i}}[ ]{{_i}}The data source to query against. May be an array of strings or a function. The function is passed two arguments, the query value in the input field and the process callback. The function may be used synchronously by returning the data source directly or asynchronously via the process callback's single argument.{{/i}}
{{_i}}items{{/i}}{{_i}}number{{/i}}8{{_i}}The max number of items to display in the dropdown.{{/i}}
{{_i}}minLength{{/i}}{{_i}}number{{/i}}{{_i}}1{{/i}}{{_i}}The minimum character length needed before triggering autocomplete suggestions{{/i}}
{{_i}}matcher{{/i}}{{_i}}function{{/i}}{{_i}}case insensitive{{/i}}{{_i}}The method used to determine if a query matches an item. Accepts a single argument, the item against which to test the query. Access the current query with this.query. Return a boolean true if query is a match.{{/i}}
{{_i}}sorter{{/i}}{{_i}}function{{/i}}{{_i}}exact match,
case sensitive,
case insensitive{{/i}}
{{_i}}Method used to sort autocomplete results. Accepts a single argument items and has the scope of the typeahead instance. Reference the current query with this.query.{{/i}}
{{_i}}updater{{/i}}{{_i}}function{{/i}}{{_i}}returns selected item{{/i}}{{_i}}The method used to return selected item. Accepts a single argument, the item and has the scope of the typeahead instance.{{/i}}
{{_i}}highlighter{{/i}}{{_i}}function{{/i}}{{_i}}highlights all default matches{{/i}}{{_i}}Method used to highlight autocomplete results. Accepts a single argument item and has the scope of the typeahead instance. Should return html.{{/i}}
- -

{{_i}}Methods{{/i}}

-

.typeahead({{_i}}options{{/i}})

-

{{_i}}Initializes an input with a typeahead.{{/i}}

-
- - - - -
- - -

{{_i}}Example{{/i}}

-

{{_i}}The subnavigation on the left is a live demo of the affix plugin.{{/i}}

- -
- -

{{_i}}Usage{{/i}}

- -

{{_i}}Via data attributes{{/i}}

-

{{_i}}To easily add affix behavior to any element, just add data-spy="affix" to the element you want to spy on. Then use offsets to define when to toggle the pinning of an element on and off.{{/i}}

- -
<div data-spy="affix" data-offset-top="200">...</div>
- -
- {{_i}}Heads up!{{/i}} - {{_i}}You must manage the position of a pinned element and the behavior of its immediate parent. Position is controlled by affix, affix-top, and affix-bottom. Remember to check for a potentially collapsed parent when the affix kicks in as it's removing content from the normal flow of the page.{{/i}} -
- -

{{_i}}Via JavaScript{{/i}}

-

{{_i}}Call the affix plugin via JavaScript:{{/i}}

-
$('#navbar').affix()
- -

{{_i}}Options{{/i}}

-

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-offset-top="200".{{/i}}

- - - - - - - - - - - - - - - - - -
{{_i}}Name{{/i}}{{_i}}type{{/i}}{{_i}}default{{/i}}{{_i}}description{{/i}}
{{_i}}offset{{/i}}{{_i}}number | function | object{{/i}}{{_i}}10{{/i}}{{_i}}Pixels to offset from screen when calculating position of scroll. If a single number is provided, the offset will be applied in both top and left directions. To listen for a single direction, or multiple unique offsets, just provide an object offset: { x: 10 }. Use a function when you need to dynamically provide an offset (useful for some responsive designs).{{/i}}
-
- - - -
{{! /span9 }} -
{{! row}} - -
{{! /.container }} diff --git a/docs/templates/pages/scaffolding.mustache b/docs/templates/pages/scaffolding.mustache deleted file mode 100644 index a6f2f9dac101..000000000000 --- a/docs/templates/pages/scaffolding.mustache +++ /dev/null @@ -1,485 +0,0 @@ - -
-
-

{{_i}}Scaffolding{{/i}}

-

{{_i}}Bootstrap is built on responsive 12-column grids, layouts, and components.{{/i}}

-
-
- -
- - -
- -
- - - - -
- - -

{{_i}}Requires HTML5 doctype{{/i}}

-

{{_i}}Bootstrap makes use of certain HTML elements and CSS properties that require the use of the HTML5 doctype. Include it at the beginning of all your projects.{{/i}}

-
-<!DOCTYPE html>
-<html lang="en">
-  ...
-</html>
-
- -

{{_i}}Typography and links{{/i}}

-

{{_i}}Bootstrap sets basic global display, typography, and link styles. Specifically, we:{{/i}}

-
    -
  • {{_i}}Remove margin on the body{{/i}}
  • -
  • {{_i}}Set background-color: white; on the body{{/i}}
  • -
  • {{_i}}Use the @baseFontFamily, @baseFontSize, and @baseLineHeight attributes as our typographic base{{/i}}
  • -
  • {{_i}}Set the global link color via @linkColor and apply link underlines only on :hover{{/i}}
  • -
-

{{_i}}These styles can be found within scaffolding.less.{{/i}}

- -

{{_i}}Reset via Normalize{{/i}}

-

{{_i}}With Bootstrap 2, the old reset block has been dropped in favor of Normalize.css, a project by Nicolas Gallagher and Jonathan Neal that also powers the HTML5 Boilerplate. While we use much of Normalize within our reset.less, we have removed some elements specifically for Bootstrap.{{/i}}

- -
- - - - - -
- - -

{{_i}}Live grid example{{/i}}

-

{{_i}}The default Bootstrap grid system utilizes 12 columns, making for a 940px wide container without responsive features enabled. With the responsive CSS file added, the grid adapts to be 724px and 1170px wide depending on your viewport. Below 767px viewports, the columns become fluid and stack vertically.{{/i}}

-
-
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
2
-
3
-
4
-
-
-
4
-
5
-
-
-
9
-
-
- -

{{_i}}Basic grid HTML{{/i}}

-

{{_i}}For a simple two column layout, create a .row and add the appropriate number of .span* columns. As this is a 12-column grid, each .span* spans a number of those 12 columns, and should always add up to 12 for each row (or the number of columns in the parent).{{/i}}

-
-<div class="row">
-  <div class="span4">...</div>
-  <div class="span8">...</div>
-</div>
-
-

{{_i}}Given this example, we have .span4 and .span8, making for 12 total columns and a complete row.{{/i}}

- -

{{_i}}Offsetting columns{{/i}}

-

{{_i}}Move columns to the right using .offset* classes. Each class increases the left margin of a column by a whole column. For example, .offset4 moves .span4 over four columns.{{/i}}

-
-
-
4
-
3 offset 2
-
-
-
3 offset 1
-
3 offset 2
-
-
-
6 offset 3
-
-
-
-<div class="row">
-  <div class="span4">...</div>
-  <div class="span3 offset2">...</div>
-</div>
-
- -

{{_i}}Nesting columns{{/i}}

-

{{_i}}To nest your content with the default grid, add a new .row and set of .span* columns within an existing .span* column. Nested rows should include a set of columns that add up to the number of columns of its parent.{{/i}}

-
-
- {{_i}}Level 1 column{{/i}} -
-
- {{_i}}Level 2{{/i}} -
-
- {{_i}}Level 2{{/i}} -
-
-
-
-
-<div class="row">
-  <div class="span9">
-    {{_i}}Level 1 column{{/i}}
-    <div class="row">
-      <div class="span6">{{_i}}Level 2{{/i}}</div>
-      <div class="span3">{{_i}}Level 2{{/i}}</div>
-    </div>
-  </div>
-</div>
-
-
- - - - -
- - -

{{_i}}Live fluid grid example{{/i}}

-

{{_i}}The fluid grid system uses percents instead of pixels for column widths. It has the same responsive capabilities as our fixed grid system, ensuring proper proportions for key screen resolutions and devices.{{/i}}

-
-
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
4
-
4
-
4
-
-
-
4
-
8
-
-
-
6
-
6
-
-
-
12
-
-
- -

{{_i}}Basic fluid grid HTML{{/i}}

-

{{_i}}Make any row "fluid" by changing .row to .row-fluid. The column classes stay the exact same, making it easy to flip between fixed and fluid grids.{{/i}}

-
-<div class="row-fluid">
-  <div class="span4">...</div>
-  <div class="span8">...</div>
-</div>
-
- -

{{_i}}Fluid offsetting{{/i}}

-

{{_i}}Operates the same way as the fixed grid system offsetting: add .offset* to any column to offset by that many columns.{{/i}}

-
-
-
4
-
4 offset 4
-
-
-
3 offset 3
-
3 offset 3
-
-
-
6 offset 6
-
-
-
-<div class="row-fluid">
-  <div class="span4">...</div>
-  <div class="span4 offset2">...</div>
-</div>
-
- -

{{_i}}Fluid nesting{{/i}}

-

{{_i}}Fluid grids utilize nesting differently: each nested level of columns should add up to 12 columns. This is because the fluid grid uses percentages, not pixels, for setting widths.{{/i}}

-
-
- {{_i}}Fluid 12{{/i}} -
-
- {{_i}}Fluid 6{{/i}} -
-
- {{_i}}Fluid 6{{/i}} -
-
- {{_i}}Fluid 6{{/i}} -
-
-
-
- {{_i}}Fluid 6{{/i}} -
-
-
-
-
-<div class="row-fluid">
-  <div class="span12">
-    {{_i}}Fluid 12{{/i}}
-    <div class="row-fluid">
-      <div class="span6">
-        {{_i}}Fluid 6{{/i}}
-        <div class="row-fluid">
-          <div class="span6">{{_i}}Fluid 6{{/i}}</div>
-          <div class="span6">{{_i}}Fluid 6{{/i}}</div>
-        </div>
-      </div>
-      <div class="span6">{{_i}}Fluid 6{{/i}}</div>
-    </div>
-  </div>
-</div>
-
- -
- - - - - -
- - -

{{_i}}Fixed layout{{/i}}

-

{{_i}}Provides a common fixed-width (and optionally responsive) layout with only <div class="container"> required.{{/i}}

-
-
-
-
-<body>
-  <div class="container">
-    ...
-  </div>
-</body>
-
- -

{{_i}}Fluid layout{{/i}}

-

{{_i}}Create a fluid, two-column page with <div class="container-fluid">—great for applications and docs.{{/i}}

-
-
-
-
-
-<div class="container-fluid">
-  <div class="row-fluid">
-    <div class="span2">
-      <!--{{_i}}Sidebar content{{/i}}-->
-    </div>
-    <div class="span10">
-      <!--{{_i}}Body content{{/i}}-->
-    </div>
-  </div>
-</div>
-
-
- - - - - -
- - - {{! Enabling }} -

{{_i}}Enabling responsive features{{/i}}

-

{{_i}}Turn on responsive CSS in your project by including the proper meta tag and additional stylesheet within the <head> of your document. If you've compiled Bootstrap from the Customize page, you need only include the meta tag.{{/i}}

-
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
-
-

{{_i}}Heads up!{{/i}} {{_i}} Bootstrap doesn't include responsive features by default at this time as not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it as needed.{{/i}}

- - {{! About }} -

{{_i}}About responsive Bootstrap{{/i}}

- Responsive devices -

{{_i}}Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width and max-width.{{/i}}

-
    -
  • {{_i}}Modify the width of column in our grid{{/i}}
  • -
  • {{_i}}Stack elements instead of float wherever necessary{{/i}}
  • -
  • {{_i}}Resize headings and text to be more appropriate for devices{{/i}}
  • -
-

{{_i}}Use media queries responsibly and only as a start to your mobile audiences. For larger projects, do consider dedicated code bases and not layers of media queries.{{/i}}

- - {{! Supported }} -

{{_i}}Supported devices{{/i}}

-

{{_i}}Bootstrap supports a handful of media queries in a single file to help make your projects more appropriate on different devices and screen resolutions. Here's what's included:{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Label{{/i}}{{_i}}Layout width{{/i}}{{_i}}Column width{{/i}}{{_i}}Gutter width{{/i}}
{{_i}}Large display{{/i}}1200px and up70px30px
{{_i}}Default{{/i}}980px and up60px20px
{{_i}}Portrait tablets{{/i}}768px and above42px20px
{{_i}}Phones to tablets{{/i}}767px and below{{_i}}Fluid columns, no fixed widths{{/i}}
{{_i}}Phones{{/i}}480px and below{{_i}}Fluid columns, no fixed widths{{/i}}
-
-/* {{_i}}Large desktop{{/i}} */
-@media (min-width: 1200px) { ... }
-
-/* {{_i}}Portrait tablet to landscape and desktop{{/i}} */
-@media (min-width: 768px) and (max-width: 979px) { ... }
-
-/* {{_i}}Landscape phone to portrait tablet{{/i}} */
-@media (max-width: 767px) { ... }
-
-/* {{_i}}Landscape phones and down{{/i}} */
-@media (max-width: 480px) { ... }
-
- - - {{! Responsive utility classes }} -

{{_i}}Responsive utility classes{{/i}}

-

{{_i}}For faster mobile-friendly development, use these utility classes for showing and hiding content by device. Below is a table of the available classes and their effect on a given media query layout (labeled by device). They can be found in responsive.less.{{/i}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{_i}}Class{{/i}}{{_i}}Phones 767px and below{{/i}}{{_i}}Tablets 979px to 768px{{/i}}{{_i}}Desktops Default{{/i}}
.visible-phone{{_i}}Visible{{/i}}
.visible-tablet{{_i}}Visible{{/i}}
.visible-desktop{{_i}}Visible{{/i}}
.hidden-phone{{_i}}Visible{{/i}}{{_i}}Visible{{/i}}
.hidden-tablet{{_i}}Visible{{/i}}{{_i}}Visible{{/i}}
.hidden-desktop{{_i}}Visible{{/i}}{{_i}}Visible{{/i}}
- -

{{_i}}When to use{{/i}}

-

{{_i}}Use on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation. Responsive utilities should not be used with tables, and as such are not supported.{{/i}}

- -

{{_i}}Responsive utilities test case{{/i}}

-

{{_i}}Resize your browser or load on different devices to test the above classes.{{/i}}

-

{{_i}}Visible on...{{/i}}

-

{{_i}}Green checkmarks indicate that class is visible in your current viewport.{{/i}}

-
    -
  • {{_i}}Phone{{/i}}✔ {{_i}}Phone{{/i}}
  • -
  • {{_i}}Tablet{{/i}}✔ {{_i}}Tablet{{/i}}
  • -
  • {{_i}}Desktop{{/i}}✔ {{_i}}Desktop{{/i}}
  • -
-

{{_i}}Hidden on...{{/i}}

-

{{_i}}Here, green checkmarks indicate that class is hidden in your current viewport.{{/i}}

-
    -
  • {{_i}}Phone{{/i}}✔ {{_i}}Phone{{/i}}
  • -
  • {{_i}}Tablet{{/i}}✔ {{_i}}Tablet{{/i}}
  • -
  • {{_i}}Desktop{{/i}}✔ {{_i}}Desktop{{/i}}
  • -
- -
- - - -
{{! /span9 }} -
{{! row}} - -
{{! /.container }} diff --git a/img/glyphicons-halflings-white.png b/img/glyphicons-halflings-white.png deleted file mode 100644 index 3bf6484a29d8..000000000000 Binary files a/img/glyphicons-halflings-white.png and /dev/null differ diff --git a/img/glyphicons-halflings.png b/img/glyphicons-halflings.png deleted file mode 100644 index a9969993201f..000000000000 Binary files a/img/glyphicons-halflings.png and /dev/null differ diff --git a/js/.jshintrc b/js/.jshintrc deleted file mode 100644 index e0722690bd73..000000000000 --- a/js/.jshintrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "validthis": true, - "laxcomma" : true, - "laxbreak" : true, - "browser" : true, - "eqnull" : true, - "debug" : true, - "devel" : true, - "boss" : true, - "expr" : true, - "asi" : true -} \ No newline at end of file diff --git a/js/bootstrap-affix.js b/js/bootstrap-affix.js deleted file mode 100644 index 7595fdb06771..000000000000 --- a/js/bootstrap-affix.js +++ /dev/null @@ -1,117 +0,0 @@ -/* ========================================================== - * bootstrap-affix.js v2.3.0 - * http://twitter.github.com/bootstrap/javascript.html#affix - * ========================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* AFFIX CLASS DEFINITION - * ====================== */ - - var Affix = function (element, options) { - this.options = $.extend({}, $.fn.affix.defaults, options) - this.$window = $(window) - .on('scroll.affix.data-api', $.proxy(this.checkPosition, this)) - .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this)) - this.$element = $(element) - this.checkPosition() - } - - Affix.prototype.checkPosition = function () { - if (!this.$element.is(':visible')) return - - var scrollHeight = $(document).height() - , scrollTop = this.$window.scrollTop() - , position = this.$element.offset() - , offset = this.options.offset - , offsetBottom = offset.bottom - , offsetTop = offset.top - , reset = 'affix affix-top affix-bottom' - , affix - - if (typeof offset != 'object') offsetBottom = offsetTop = offset - if (typeof offsetTop == 'function') offsetTop = offset.top() - if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() - - affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? - false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? - 'bottom' : offsetTop != null && scrollTop <= offsetTop ? - 'top' : false - - if (this.affixed === affix) return - - this.affixed = affix - this.unpin = affix == 'bottom' ? position.top - scrollTop : null - - this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : '')) - } - - - /* AFFIX PLUGIN DEFINITION - * ======================= */ - - var old = $.fn.affix - - $.fn.affix = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('affix') - , options = typeof option == 'object' && option - if (!data) $this.data('affix', (data = new Affix(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.affix.Constructor = Affix - - $.fn.affix.defaults = { - offset: 0 - } - - - /* AFFIX NO CONFLICT - * ================= */ - - $.fn.affix.noConflict = function () { - $.fn.affix = old - return this - } - - - /* AFFIX DATA-API - * ============== */ - - $(window).on('load', function () { - $('[data-spy="affix"]').each(function () { - var $spy = $(this) - , data = $spy.data() - - data.offset = data.offset || {} - - data.offsetBottom && (data.offset.bottom = data.offsetBottom) - data.offsetTop && (data.offset.top = data.offsetTop) - - $spy.affix(data) - }) - }) - - -}(window.jQuery); \ No newline at end of file diff --git a/js/bootstrap-alert.js b/js/bootstrap-alert.js deleted file mode 100644 index b5627984e4ca..000000000000 --- a/js/bootstrap-alert.js +++ /dev/null @@ -1,99 +0,0 @@ -/* ========================================================== - * bootstrap-alert.js v2.3.0 - * http://twitter.github.com/bootstrap/javascript.html#alerts - * ========================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* ALERT CLASS DEFINITION - * ====================== */ - - var dismiss = '[data-dismiss="alert"]' - , Alert = function (el) { - $(el).on('click', dismiss, this.close) - } - - Alert.prototype.close = function (e) { - var $this = $(this) - , selector = $this.attr('data-target') - , $parent - - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } - - $parent = $(selector) - - e && e.preventDefault() - - $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) - - $parent.trigger(e = $.Event('close')) - - if (e.isDefaultPrevented()) return - - $parent.removeClass('in') - - function removeElement() { - $parent - .trigger('closed') - .remove() - } - - $.support.transition && $parent.hasClass('fade') ? - $parent.on($.support.transition.end, removeElement) : - removeElement() - } - - - /* ALERT PLUGIN DEFINITION - * ======================= */ - - var old = $.fn.alert - - $.fn.alert = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('alert') - if (!data) $this.data('alert', (data = new Alert(this))) - if (typeof option == 'string') data[option].call($this) - }) - } - - $.fn.alert.Constructor = Alert - - - /* ALERT NO CONFLICT - * ================= */ - - $.fn.alert.noConflict = function () { - $.fn.alert = old - return this - } - - - /* ALERT DATA-API - * ============== */ - - $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) - -}(window.jQuery); \ No newline at end of file diff --git a/js/bootstrap-button.js b/js/bootstrap-button.js deleted file mode 100644 index 045927b6ba73..000000000000 --- a/js/bootstrap-button.js +++ /dev/null @@ -1,105 +0,0 @@ -/* ============================================================ - * bootstrap-button.js v2.3.0 - * http://twitter.github.com/bootstrap/javascript.html#buttons - * ============================================================ - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* BUTTON PUBLIC CLASS DEFINITION - * ============================== */ - - var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, $.fn.button.defaults, options) - } - - Button.prototype.setState = function (state) { - var d = 'disabled' - , $el = this.$element - , data = $el.data() - , val = $el.is('input') ? 'val' : 'html' - - state = state + 'Text' - data.resetText || $el.data('resetText', $el[val]()) - - $el[val](data[state] || this.options[state]) - - // push to event loop to allow forms to submit - setTimeout(function () { - state == 'loadingText' ? - $el.addClass(d).attr(d, d) : - $el.removeClass(d).removeAttr(d) - }, 0) - } - - Button.prototype.toggle = function () { - var $parent = this.$element.closest('[data-toggle="buttons-radio"]') - - $parent && $parent - .find('.active') - .removeClass('active') - - this.$element.toggleClass('active') - } - - - /* BUTTON PLUGIN DEFINITION - * ======================== */ - - var old = $.fn.button - - $.fn.button = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('button') - , options = typeof option == 'object' && option - if (!data) $this.data('button', (data = new Button(this, options))) - if (option == 'toggle') data.toggle() - else if (option) data.setState(option) - }) - } - - $.fn.button.defaults = { - loadingText: 'loading...' - } - - $.fn.button.Constructor = Button - - - /* BUTTON NO CONFLICT - * ================== */ - - $.fn.button.noConflict = function () { - $.fn.button = old - return this - } - - - /* BUTTON DATA-API - * =============== */ - - $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - $btn.button('toggle') - }) - -}(window.jQuery); \ No newline at end of file diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js deleted file mode 100644 index 604552012b17..000000000000 --- a/js/bootstrap-carousel.js +++ /dev/null @@ -1,207 +0,0 @@ -/* ========================================================== - * bootstrap-carousel.js v2.3.0 - * http://twitter.github.com/bootstrap/javascript.html#carousel - * ========================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* CAROUSEL CLASS DEFINITION - * ========================= */ - - var Carousel = function (element, options) { - this.$element = $(element) - this.$indicators = this.$element.find('.carousel-indicators') - this.options = options - this.options.pause == 'hover' && this.$element - .on('mouseenter', $.proxy(this.pause, this)) - .on('mouseleave', $.proxy(this.cycle, this)) - } - - Carousel.prototype = { - - cycle: function (e) { - if (!e) this.paused = false - if (this.interval) clearInterval(this.interval); - this.options.interval - && !this.paused - && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) - return this - } - - , getActiveIndex: function () { - this.$active = this.$element.find('.item.active') - this.$items = this.$active.parent().children() - return this.$items.index(this.$active) - } - - , to: function (pos) { - var activeIndex = this.getActiveIndex() - , that = this - - if (pos > (this.$items.length - 1) || pos < 0) return - - if (this.sliding) { - return this.$element.one('slid', function () { - that.to(pos) - }) - } - - if (activeIndex == pos) { - return this.pause().cycle() - } - - return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) - } - - , pause: function (e) { - if (!e) this.paused = true - if (this.$element.find('.next, .prev').length && $.support.transition.end) { - this.$element.trigger($.support.transition.end) - this.cycle() - } - clearInterval(this.interval) - this.interval = null - return this - } - - , next: function () { - if (this.sliding) return - return this.slide('next') - } - - , prev: function () { - if (this.sliding) return - return this.slide('prev') - } - - , slide: function (type, next) { - var $active = this.$element.find('.item.active') - , $next = next || $active[type]() - , isCycling = this.interval - , direction = type == 'next' ? 'left' : 'right' - , fallback = type == 'next' ? 'first' : 'last' - , that = this - , e - - this.sliding = true - - isCycling && this.pause() - - $next = $next.length ? $next : this.$element.find('.item')[fallback]() - - e = $.Event('slide', { - relatedTarget: $next[0] - , direction: direction - }) - - if ($next.hasClass('active')) return - - if (this.$indicators.length) { - this.$indicators.find('.active').removeClass('active') - this.$element.one('slid', function () { - var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) - $nextIndicator && $nextIndicator.addClass('active') - }) - } - - if ($.support.transition && this.$element.hasClass('slide')) { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $next.addClass(type) - $next[0].offsetWidth // force reflow - $active.addClass(direction) - $next.addClass(direction) - this.$element.one($.support.transition.end, function () { - $next.removeClass([type, direction].join(' ')).addClass('active') - $active.removeClass(['active', direction].join(' ')) - that.sliding = false - setTimeout(function () { that.$element.trigger('slid') }, 0) - }) - } else { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $active.removeClass('active') - $next.addClass('active') - this.sliding = false - this.$element.trigger('slid') - } - - isCycling && this.cycle() - - return this - } - - } - - - /* CAROUSEL PLUGIN DEFINITION - * ========================== */ - - var old = $.fn.carousel - - $.fn.carousel = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('carousel') - , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) - , action = typeof option == 'string' ? option : options.slide - if (!data) $this.data('carousel', (data = new Carousel(this, options))) - if (typeof option == 'number') data.to(option) - else if (action) data[action]() - else if (options.interval) data.pause().cycle() - }) - } - - $.fn.carousel.defaults = { - interval: 5000 - , pause: 'hover' - } - - $.fn.carousel.Constructor = Carousel - - - /* CAROUSEL NO CONFLICT - * ==================== */ - - $.fn.carousel.noConflict = function () { - $.fn.carousel = old - return this - } - - /* CAROUSEL DATA-API - * ================= */ - - $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { - var $this = $(this), href - , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 - , options = $.extend({}, $target.data(), $this.data()) - , slideIndex - - $target.carousel(options) - - if (slideIndex = $this.attr('data-slide-to')) { - $target.data('carousel').pause().to(slideIndex).cycle() - } - - e.preventDefault() - }) - -}(window.jQuery); \ No newline at end of file diff --git a/js/bootstrap-collapse.js b/js/bootstrap-collapse.js deleted file mode 100644 index 7bbad8e43aba..000000000000 --- a/js/bootstrap-collapse.js +++ /dev/null @@ -1,167 +0,0 @@ -/* ============================================================= - * bootstrap-collapse.js v2.3.0 - * http://twitter.github.com/bootstrap/javascript.html#collapse - * ============================================================= - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* COLLAPSE PUBLIC CLASS DEFINITION - * ================================ */ - - var Collapse = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, $.fn.collapse.defaults, options) - - if (this.options.parent) { - this.$parent = $(this.options.parent) - } - - this.options.toggle && this.toggle() - } - - Collapse.prototype = { - - constructor: Collapse - - , dimension: function () { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } - - , show: function () { - var dimension - , scroll - , actives - , hasData - - if (this.transitioning || this.$element.hasClass('in')) return - - dimension = this.dimension() - scroll = $.camelCase(['scroll', dimension].join('-')) - actives = this.$parent && this.$parent.find('> .accordion-group > .in') - - if (actives && actives.length) { - hasData = actives.data('collapse') - if (hasData && hasData.transitioning) return - actives.collapse('hide') - hasData || actives.data('collapse', null) - } - - this.$element[dimension](0) - this.transition('addClass', $.Event('show'), 'shown') - $.support.transition && this.$element[dimension](this.$element[0][scroll]) - } - - , hide: function () { - var dimension - if (this.transitioning || !this.$element.hasClass('in')) return - dimension = this.dimension() - this.reset(this.$element[dimension]()) - this.transition('removeClass', $.Event('hide'), 'hidden') - this.$element[dimension](0) - } - - , reset: function (size) { - var dimension = this.dimension() - - this.$element - .removeClass('collapse') - [dimension](size || 'auto') - [0].offsetWidth - - this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') - - return this - } - - , transition: function (method, startEvent, completeEvent) { - var that = this - , complete = function () { - if (startEvent.type == 'show') that.reset() - that.transitioning = 0 - that.$element.trigger(completeEvent) - } - - this.$element.trigger(startEvent) - - if (startEvent.isDefaultPrevented()) return - - this.transitioning = 1 - - this.$element[method]('in') - - $.support.transition && this.$element.hasClass('collapse') ? - this.$element.one($.support.transition.end, complete) : - complete() - } - - , toggle: function () { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } - - } - - - /* COLLAPSE PLUGIN DEFINITION - * ========================== */ - - var old = $.fn.collapse - - $.fn.collapse = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('collapse') - , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option) - if (!data) $this.data('collapse', (data = new Collapse(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.collapse.defaults = { - toggle: true - } - - $.fn.collapse.Constructor = Collapse - - - /* COLLAPSE NO CONFLICT - * ==================== */ - - $.fn.collapse.noConflict = function () { - $.fn.collapse = old - return this - } - - - /* COLLAPSE DATA-API - * ================= */ - - $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { - var $this = $(this), href - , target = $this.attr('data-target') - || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - , option = $(target).data('collapse') ? 'toggle' : $this.data() - $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') - $(target).collapse(option) - }) - -}(window.jQuery); \ No newline at end of file diff --git a/js/bootstrap-dropdown.js b/js/bootstrap-dropdown.js deleted file mode 100644 index ec86cf0d7095..000000000000 --- a/js/bootstrap-dropdown.js +++ /dev/null @@ -1,165 +0,0 @@ -/* ============================================================ - * bootstrap-dropdown.js v2.3.0 - * http://twitter.github.com/bootstrap/javascript.html#dropdowns - * ============================================================ - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* DROPDOWN CLASS DEFINITION - * ========================= */ - - var toggle = '[data-toggle=dropdown]' - , Dropdown = function (element) { - var $el = $(element).on('click.dropdown.data-api', this.toggle) - $('html').on('click.dropdown.data-api', function () { - $el.parent().removeClass('open') - }) - } - - Dropdown.prototype = { - - constructor: Dropdown - - , toggle: function (e) { - var $this = $(this) - , $parent - , isActive - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - clearMenus() - - if (!isActive) { - $parent.toggleClass('open') - } - - $this.focus() - - return false - } - - , keydown: function (e) { - var $this - , $items - , $active - , $parent - , isActive - , index - - if (!/(38|40|27)/.test(e.keyCode)) return - - $this = $(this) - - e.preventDefault() - e.stopPropagation() - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - if (!isActive || (isActive && e.keyCode == 27)) { - if (e.which == 27) $parent.find(toggle).focus() - return $this.click() - } - - $items = $('[role=menu] li:not(.divider):visible a', $parent) - - if (!$items.length) return - - index = $items.index($items.filter(':focus')) - - if (e.keyCode == 38 && index > 0) index-- // up - if (e.keyCode == 40 && index < $items.length - 1) index++ // down - if (!~index) index = 0 - - $items - .eq(index) - .focus() - } - - } - - function clearMenus() { - $(toggle).each(function () { - getParent($(this)).removeClass('open') - }) - } - - function getParent($this) { - var selector = $this.attr('data-target') - , $parent - - if (!selector) { - selector = $this.attr('href') - selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } - - $parent = selector && $(selector) - - if (!$parent || !$parent.length) $parent = $this.parent() - - return $parent - } - - - /* DROPDOWN PLUGIN DEFINITION - * ========================== */ - - var old = $.fn.dropdown - - $.fn.dropdown = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('dropdown') - if (!data) $this.data('dropdown', (data = new Dropdown(this))) - if (typeof option == 'string') data[option].call($this) - }) - } - - $.fn.dropdown.Constructor = Dropdown - - - /* DROPDOWN NO CONFLICT - * ==================== */ - - $.fn.dropdown.noConflict = function () { - $.fn.dropdown = old - return this - } - - - /* APPLY TO STANDARD DROPDOWN ELEMENTS - * =================================== */ - - $(document) - .on('click.dropdown.data-api', clearMenus) - .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) - .on('.dropdown-menu', function (e) { e.stopPropagation() }) - .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle) - .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) - -}(window.jQuery); diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js deleted file mode 100644 index b5ffa95b3b76..000000000000 --- a/js/bootstrap-modal.js +++ /dev/null @@ -1,247 +0,0 @@ -/* ========================================================= - * bootstrap-modal.js v2.3.0 - * http://twitter.github.com/bootstrap/javascript.html#modals - * ========================================================= - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================= */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* MODAL CLASS DEFINITION - * ====================== */ - - var Modal = function (element, options) { - this.options = options - this.$element = $(element) - .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) - this.options.remote && this.$element.find('.modal-body').load(this.options.remote) - } - - Modal.prototype = { - - constructor: Modal - - , toggle: function () { - return this[!this.isShown ? 'show' : 'hide']() - } - - , show: function () { - var that = this - , e = $.Event('show') - - this.$element.trigger(e) - - if (this.isShown || e.isDefaultPrevented()) return - - this.isShown = true - - this.escape() - - this.backdrop(function () { - var transition = $.support.transition && that.$element.hasClass('fade') - - if (!that.$element.parent().length) { - that.$element.appendTo(document.body) //don't move modals dom position - } - - that.$element.show() - - if (transition) { - that.$element[0].offsetWidth // force reflow - } - - that.$element - .addClass('in') - .attr('aria-hidden', false) - - that.enforceFocus() - - transition ? - that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : - that.$element.focus().trigger('shown') - - }) - } - - , hide: function (e) { - e && e.preventDefault() - - var that = this - - e = $.Event('hide') - - this.$element.trigger(e) - - if (!this.isShown || e.isDefaultPrevented()) return - - this.isShown = false - - this.escape() - - $(document).off('focusin.modal') - - this.$element - .removeClass('in') - .attr('aria-hidden', true) - - $.support.transition && this.$element.hasClass('fade') ? - this.hideWithTransition() : - this.hideModal() - } - - , enforceFocus: function () { - var that = this - $(document).on('focusin.modal', function (e) { - if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { - that.$element.focus() - } - }) - } - - , escape: function () { - var that = this - if (this.isShown && this.options.keyboard) { - this.$element.on('keyup.dismiss.modal', function ( e ) { - e.which == 27 && that.hide() - }) - } else if (!this.isShown) { - this.$element.off('keyup.dismiss.modal') - } - } - - , hideWithTransition: function () { - var that = this - , timeout = setTimeout(function () { - that.$element.off($.support.transition.end) - that.hideModal() - }, 500) - - this.$element.one($.support.transition.end, function () { - clearTimeout(timeout) - that.hideModal() - }) - } - - , hideModal: function () { - var that = this - this.$element.hide() - this.backdrop(function () { - that.removeBackdrop() - that.$element.trigger('hidden') - }) - } - - , removeBackdrop: function () { - this.$backdrop.remove() - this.$backdrop = null - } - - , backdrop: function (callback) { - var that = this - , animate = this.$element.hasClass('fade') ? 'fade' : '' - - if (this.isShown && this.options.backdrop) { - var doAnimate = $.support.transition && animate - - this.$backdrop = $(' + + +
+
+

الجداول

+ دليل الإستخدام +
+ +
+ + + + # + الاسم الاول + الكنية + الاسم المستعار + + + + + 1 + Mark + Otto + @mdo + + + 2 + Jacob + Thornton + @fat + + + 3 + John + Doe + @social + + + + `} /> + + + + + # + الاسم الاول + الكنية + الاسم المستعار + + + + + 1 + Mark + Otto + @mdo + + + 2 + Jacob + Thornton + @fat + + + 3 + John + Doe + @social + + + + `} /> + + + + + Class + عنوان + عنوان + + + + + Default + خلية + خلية + `, + ...getData('theme-colors').map((themeColor) => ` + ${themeColor.title} + خلية + خلية + `), + ` + + `]} /> + + + + + # + الاسم الاول + الكنية + الاسم المستعار + + + + + 1 + Mark + Otto + @mdo + + + 2 + Jacob + Thornton + @fat + + + 3 + John + Doe + @social + + + + `} /> +
+
+ + + +
+

النماذج

+ +
+
+

نظرة عامة

+ دليل الإستخدام +
+ +
+ +
+ + +
لن نقوم بمشاركة بريدك الإلكتروني مع أي شخص آخر.
+
+
+ + +
+
+ + +
+
+ + +
+
+ أزرار الاختيار الأحادي +
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+ + + `} /> +
+
+
+
+

الحقول المعطلة

+ دليل الإستخدام +
+ +
+ +
+
+ + +
+
+ + +
+
+
+ + +
+
+
+ أزرار اختيار أحادي معطلين +
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+ +
+ + `} /> +
+
+
+
+

الأحجام

+ دليل الإستخدام +
+ +
+ + +
+
+ +
+
+ +
+ `} /> + + + + +
+ +
+
+ +
+ `} /> + +
+
+
+

مجموعة الإدخال

+ دليل الإستخدام +
+ +
+ + أنا اسمي + +
+
+ + وغيرها +
+ +
+ + https://example.com/users/ +
+
+ .00 + + $ +
+
+ مع textarea + +
+ `} /> + +
+
+
+

الحقول ذوي العناوين العائمة

+ دليل الإستخدام +
+ +
+ +
+ + +
+
+ + +
+ + `} /> +
+
+
+
+

التحقق

+ دليل الإستخدام +
+ +
+ +
+ + +
+ يبدو صحيحًا! +
+
+
+ + +
+ يبدو صحيحًا! +
+
+
+ +
+ + @ +
+ يرجى اختيار اسم مستخدم. +
+
+
+
+ + +
+ يرجى إدخال مدينة صحيحة. +
+
+
+ + +
+ يرجى اختيار ولاية صحيحة. +
+
+
+ + +
+ يرجى إدخال رمز بريدي صحيح. +
+
+
+
+ + +
+ تجب الموافقة قبل إرسال النموذج. +
+
+
+
+ +
+ + `} /> +
+
+
+ +
+

العناصر

+ +
+
+

المطوية

+ دليل الإستخدام +
+ +
+ +
+

+ +

+
+
+ هذا هو محتوى عنصر المطوية الأول. سيكون المحتوى مخفيًا بشكل إفتراضي حتى يقوم Bootstrap بإضافة الكلاسات اللازمة لكل عنصر في المطوية. هذه الكلاسات تتحكم بالمظهر العام ووتتحكم أيضا بإظهار وإخفاء أقسام المطوية عبر حركات CSS الإنتقالية. يمكنك تعديل أي من هذه عبر كلاسات CSS خاصة بك، او عبر تغيير القيم الإفتراضية المقدمة من Bootstrap. من الجدير بالذكر أنه يمكن وضع أي كود HTML هنا، ولكن الحركة الإنتقالية قد تحد من الoverflow. +
+
+
+
+

+ +

+
+
+ هذا هو محتوى عنصر المطوية الثاني. سيكون المحتوى مخفيًا بشكل إفتراضي حتى يقوم Bootstrap بإضافة الكلاسات اللازمة لكل عنصر في المطوية. هذه الكلاسات تتحكم بالمظهر العام ووتتحكم أيضا بإظهار وإخفاء أقسام المطوية عبر حركات CSS الإنتقالية. يمكنك تعديل أي من هذه عبر كلاسات CSS خاصة بك، او عبر تغيير القيم الإفتراضية المقدمة من Bootstrap. من الجدير بالذكر أنه يمكن وضع أي كود HTML هنا، ولكن الحركة الإنتقالية قد تحد من الoverflow. +
+
+
+
+

+ +

+
+
+ هذا هو محتوى عنصر المطوية الثالث. سيكون المحتوى مخفيًا بشكل إفتراضي حتى يقوم Bootstrap بإضافة الكلاسات اللازمة لكل عنصر في المطوية. هذه الكلاسات تتحكم بالمظهر العام ووتتحكم أيضا بإظهار وإخفاء أقسام المطوية عبر حركات CSS الإنتقالية. يمكنك تعديل أي من هذه عبر كلاسات CSS خاصة بك، او عبر تغيير القيم الإفتراضية المقدمة من Bootstrap. من الجدير بالذكر أنه يمكن وضع أي كود HTML هنا، ولكن الحركة الإنتقالية قد تحد من الoverflow. +
+
+
+
+ `} /> + +
+
+
+

الإنذارات

+ دليل الإستخدام +
+ +
+ ` + + `)} /> + + +

أحسنت!

+

لقد نجحت في قراءة رسالة التنبيه المهمة هذه. سيتم تشغيل نص المثال هذا لفترة أطول قليلاً حتى تتمكن من رؤية كيفية عمل التباعد داخل التنبيه مع هذا النوع من المحتوى.

+
+

كلما احتجت إلى ذلك ، تأكد من استخدام أدوات الهامش للحفاظ على الأشياء لطيفة ومرتبة.

+
+ `} /> + +
+
+
+

الشارة

+ دليل الإستخدام +
+ +
+ مثال على عنوان جديد

+

مثال على عنوان جديد

+

مثال على عنوان جديد

+

مثال على عنوان جديد

+

مثال على عنوان جديد

+

مثال على عنوان جديد

+

مثال على عنوان جديد

+

مثال على عنوان جديد

+ `} /> + + ` + ${themeColor.title} + `)} /> +
+
+ +
+
+

الأزرار

+ دليل الإستخدام +
+ +
+ ` + + `), + ``]} /> + + ` + + `)} /> + + زر صغير + + + `} /> +
+
+ +
+
+

البطاقة

+ دليل الإستخدام +
+ +
+ +
+
+ +
+
عنوان البطاقة
+

بعض الأمثلة السريعة للنصوص للبناء على عنوان البطاقة وتشكيل الجزء الأكبر من محتوى البطاقة.

+ اذهب لمكان ما +
+
+
+
+
+
+ متميز +
+
+
عنوان البطاقة
+

بعض الأمثلة السريعة للنصوص للبناء على عنوان البطاقة وتشكيل الجزء الأكبر من محتوى البطاقة.

+ اذهب لمكان ما +
+ +
+
+
+
+
+
عنوان البطاقة
+

بعض الأمثلة السريعة للنصوص للبناء على عنوان البطاقة وتشكيل الجزء الأكبر من محتوى البطاقة.

+
+
    +
  • عنصر
  • +
  • عنصر آخر
  • +
  • عنصر ثالث
  • +
+ +
+
+
+
+
+
+ +
+
+
+
عنوان البطاقة
+

هذه بطاقة أعرض مع نص داعم تحتها كمقدمة طبيعية لمحتوى إضافي. هذا المحتوى أطول قليلاً.

+

آخر تحديث منذ 3 دقائق

+
+
+
+
+
+
+ `} /> + +
+ + +
+
+

مجموعة العناصر

+ دليل الإستخدام +
+ +
+ +
  • عنصر معطل
  • +
  • عنصر ثاني
  • +
  • عنصر ثالث
  • +
  • عنصر رابع
  • +
  • وعنصر خامس أيضًا
  • + + `} /> + + +
  • عنصر
  • +
  • عنصر ثاني
  • +
  • عنصر ثالث
  • +
  • عنصر رابع
  • +
  • وعنصر خامس أيضًا
  • + + `} /> + + + عنصر مجموعة قائمة default بسيط`, + ...getData('theme-colors').map((themeColor) => ` + عنصر مجموعة قائمة ${themeColor.name} بسيط + `), + `
    + `]} /> + +
    + + + + +
    +
    +

    الصناديق المنبثقة

    + دليل الإستخدام +
    + +
    + + انقر لعرض/إخفاء الصندوق المنبثق + + `} /> + + + انبثاق إلى الأعلى + + + + + `} /> +
    +
    +
    +
    +

    شريط التقدم

    + دليل الإستخدام +
    + +
    + +
    0%
    +
    +
    +
    25%
    +
    +
    +
    50%
    +
    +
    +
    75%
    +
    +
    +
    100%
    +
    + `} /> + + +
    +
    +
    +
    +
    +
    + + `} /> + +
    +
    +
    +

    المخطوطة

    + دليل الإستخدام +
    + +
    +
    + +
    +

    @fat

    +

    محتوى لتوضيح كيف تعمل المخطوطة. ببساطة، المخطوطة عبارة عن منشور طويل يحتوي على عدة أقسام، ولديه شريط تنقل يسهل الوصول إلى هذه الأقسام الفرعية.

    +

    @mdo

    +

    بصرف النظر عن تحسيننا جدوى المكيّفات أو عدم تحسينها، فإن الطلب على الطاقة سيزداد. وطبقاً لما جاء في مقالة معهد ماساشوستس للتكنولوجيا، السالف ذكره، ثمَّة أمر يجب عدم إغفاله، وهو كيف أن هذا الطلب سيضغط على نظم توفير الطاقة الحالية. إذ لا بد من إعادة تأهيل كل شبكات الكهرباء، وتوسيعها لتلبية طلب الطاقة في زمن الذروة، خلال موجات الحرارة المتزايدة. فحين يكون الحر شديداً يجنح الناس إلى البقاء في الداخل، وإلى زيادة تشغيل المكيّفات، سعياً إلى جو لطيف وهم يستخدمون أدوات وأجهزة مختلفة أخرى.

    +

    واحد

    +

    وكل هذه الأمور المتزامنة من تشغيل الأجهزة، يزيد الضغط على شبكات الطاقة، كما أسلفنا. لكن مجرد زيادة سعة الشبكة ليس كافياً. إذ لا بد من تطوير الشبكات الذكية التي تستخدم الجسّاسات، ونظم المراقبة، والبرامج الإلكترونية، لتحديد متى يكون الشاغلون في المبنى، ومتى يكون ثمَّة حاجة إلى الطاقة، ومتى تكون الحرارة منخفضة، وبذلك يخرج الناس، فلا يستخدمون كثيراً من الكهرباء.

    +

    اثنان

    +

    مع الأسف، كل هذه الحلول المبتكرة مكلِّفة، وهذا ما يجعلها عديمة الجدوى في نظر بعض الشركات الخاصة والمواطن المتقشّف. إن بعض الأفراد الواعين بيئياً يبذلون قصارى جهدهم في تقليص استهلاكهم من الطاقة، ويعون جيداً أهمية أجهزة التكييف المجدية والأرفق بالبيئة. ولكن جهات كثيرة لن تتحرّك لمجرد حافز سلامة المناخ ووقف هدر الطاقة، ما دامت لا تحركها حوافز قانونية. وعلى الحكومات أن تُقدِم عند الاهتمام بالتغيّر المناخي، على وضع التشريعات المناسبة. فبالنظم والحوافز والدعم، يمكن دفع الشركات إلى اعتماد الحلول الأجدى في مكاتبها.

    +

    ثلاثة

    +

    وكما يتبيّن لنا، من عدد الحلول الملطِّفة للمشكلة، ومن تنوّعها، وهي الحلول التي أسلفنا الحديث عنها، فإن التكنولوجيا التي نحتاج إليها من أجل معالجة هذه التحديات، هي في مدى قدرتنا، لكنها ربما تتطلّب بعض التحسين، ودعماً استثمارياً أكبر!

    +

    ولا مانع من إضافة محتوى آخر ليس تحت أي قسم معين.

    +
    +
    +
    +
    +
    +
    +

    الدوائر المتحركة

    + دليل الإستخدام +
    + +
    + ` +
    + جار التحميل... +
    + `)} /> + + ` +
    + جار التحميل... +
    + `)} /> +
    +
    +
    +
    +

    الإشعارات

    + دليل الإستخدام +
    + +
    + +
    + + Bootstrap + قبل 11 دقيقة + +
    +
    + مرحبًا بالعالم! هذه رسالة إشعار. +
    +
    + `} /> + +
    +
    +
    +

    التلميحات

    + دليل الإستخدام +
    + +
    + تلميح يظهر في الأعلى + + + + + `} /> +
    +
    +
    + + + + + + diff --git a/site/src/assets/examples/cheatsheet/cheatsheet.css b/site/src/assets/examples/cheatsheet/cheatsheet.css new file mode 100644 index 000000000000..5721a028e9cc --- /dev/null +++ b/site/src/assets/examples/cheatsheet/cheatsheet.css @@ -0,0 +1,163 @@ +body { + scroll-behavior: smooth; +} + +/** + * Bootstrap "Journal code" icon + * @link https://icons.getbootstrap.com/icons/journal-code/ + */ +.bd-heading a::before { + display: inline-block; + width: 1em; + height: 1em; + margin-right: .25rem; + content: ""; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M4 1h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2h1a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1H2a2 2 0 0 1 2-2z'/%3E%3Cpath d='M2 5v-.5a.5.5 0 0 1 1 0V5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0V8h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0v.5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2z'/%3E%3Cpath fill-rule='evenodd' d='M8.646 5.646a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L10.293 8 8.646 6.354a.5.5 0 0 1 0-.708zm-1.292 0a.5.5 0 0 0-.708 0l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708L5.707 8l1.647-1.646a.5.5 0 0 0 0-.708z'/%3E%3C/svg%3E"); + background-size: 1em; +} + +/* stylelint-disable-next-line selector-max-universal */ +.bd-heading + div > * + * { + margin-top: 3rem; +} + +/* Table of contents */ +.bd-aside a { + padding: .1875rem .5rem; + margin-top: .125rem; + margin-left: .3125rem; + color: var(--bs-body-color); +} + +.bd-aside a:hover, +.bd-aside a:focus { + color: var(--bs-body-color); + background-color: rgba(121, 82, 179, .1); +} + +.bd-aside .active { + font-weight: 600; + color: var(--bs-body-color); +} + +.bd-aside .btn { + padding: .25rem .5rem; + font-weight: 600; + color: var(--bs-body-color); +} + +.bd-aside .btn:hover, +.bd-aside .btn:focus { + color: var(--bs-body-color); + background-color: rgba(121, 82, 179, .1); +} + +.bd-aside .btn:focus { + box-shadow: 0 0 0 1px rgba(121, 82, 179, .7); +} + +.bd-aside .btn::before { + width: 1.25em; + line-height: 0; + content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ccc' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e"); + transition: transform .35s ease; + + /* rtl:raw: + transform: rotate(180deg) translateX(-2px); + */ + transform-origin: .5em 50%; +} + +.bd-aside .btn[aria-expanded="true"]::before { + transform: rotate(90deg)/* rtl:ignore */; +} + + +/* Examples */ +.scrollspy-example { + height: 200px; +} + +[id="modal"] .bd-example .btn, +[id="buttons"] .bd-example .btn, +[id="tooltips"] .bd-example .btn, +[id="popovers"] .bd-example .btn, +[id="dropdowns"] .bd-example .btn-group, +[id="dropdowns"] .bd-example .dropdown, +[id="dropdowns"] .bd-example .dropup, +[id="dropdowns"] .bd-example .dropend, +[id="dropdowns"] .bd-example .dropstart { + margin: 0 1rem 1rem 0; +} + +/* Layout */ +@media (min-width: 1200px) { + body { + display: grid; + grid-template-rows: auto; + grid-template-columns: 1fr 4fr 1fr; + gap: 1rem; + } + + .bd-header { + position: fixed; + top: 0; + /* rtl:begin:ignore */ + right: 0; + left: 0; + /* rtl:end:ignore */ + z-index: 1030; + grid-column: 1 / span 3; + } + + .bd-aside, + .bd-cheatsheet { + padding-top: 4rem; + } + + /** + * 1. Too bad only Firefox supports subgrids ATM + */ + .bd-cheatsheet, + .bd-cheatsheet section, + .bd-cheatsheet article { + display: inherit; /* 1 */ + grid-template-rows: auto; + grid-template-columns: 1fr 4fr; + grid-column: 1 / span 2; + gap: inherit; /* 1 */ + } + + .bd-aside { + grid-area: 1 / 3; + scroll-margin-top: 4rem; + } + + .bd-cheatsheet section, + .bd-cheatsheet section > h2 { + top: 2rem; + scroll-margin-top: 2rem; + } + + .bd-cheatsheet section > h2::before { + position: absolute; + /* rtl:begin:ignore */ + top: 0; + right: 0; + bottom: -2rem; + left: 0; + /* rtl:end:ignore */ + z-index: -1; + content: ""; + } + + .bd-cheatsheet article, + .bd-cheatsheet .bd-heading { + top: 8rem; + scroll-margin-top: 8rem; + } + + .bd-cheatsheet .bd-heading { + z-index: 1; + } +} diff --git a/site/src/assets/examples/cheatsheet/cheatsheet.js b/site/src/assets/examples/cheatsheet/cheatsheet.js new file mode 100644 index 000000000000..e25a89e75d6f --- /dev/null +++ b/site/src/assets/examples/cheatsheet/cheatsheet.js @@ -0,0 +1,73 @@ +/* global bootstrap: false */ + +(() => { + 'use strict' + + // Tooltip and popover demos + document.querySelectorAll('.tooltip-demo') + .forEach(tooltip => { + new bootstrap.Tooltip(tooltip, { + selector: '[data-bs-toggle="tooltip"]' + }) + }) + + document.querySelectorAll('[data-bs-toggle="popover"]') + .forEach(popover => { + new bootstrap.Popover(popover) + }) + + document.querySelectorAll('.toast') + .forEach(toastNode => { + const toast = new bootstrap.Toast(toastNode, { + autohide: false + }) + + toast.show() + }) + + // Disable empty links and submit buttons + document.querySelectorAll('[href="#"], [type="submit"]') + .forEach(link => { + link.addEventListener('click', event => { + event.preventDefault() + }) + }) + + function setActiveItem() { + const { hash } = window.location + + if (hash === '') { + return + } + + const link = document.querySelector(`.bd-aside a[href="${hash}"]`) + + if (!link) { + return + } + + const active = document.querySelector('.bd-aside .active') + const parent = link.parentNode.parentNode.previousElementSibling + + link.classList.add('active') + + if (parent.classList.contains('collapsed')) { + parent.click() + } + + if (!active) { + return + } + + const expanded = active.parentNode.parentNode.previousElementSibling + + active.classList.remove('active') + + if (expanded && parent !== expanded) { + expanded.click() + } + } + + setActiveItem() + window.addEventListener('hashchange', setActiveItem) +})() diff --git a/site/src/assets/examples/cheatsheet/cheatsheet.rtl.css b/site/src/assets/examples/cheatsheet/cheatsheet.rtl.css new file mode 100644 index 000000000000..416e39fcaf66 --- /dev/null +++ b/site/src/assets/examples/cheatsheet/cheatsheet.rtl.css @@ -0,0 +1,156 @@ +body { + scroll-behavior: smooth; +} + +/** + * Bootstrap "Journal code" icon + * @link https://icons.getbootstrap.com/icons/journal-code/ + */ +.bd-heading a::before { + display: inline-block; + width: 1em; + height: 1em; + margin-left: .25rem; + content: ""; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M4 1h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2h1a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1H2a2 2 0 0 1 2-2z'/%3E%3Cpath d='M2 5v-.5a.5.5 0 0 1 1 0V5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0V8h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0v.5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2z'/%3E%3Cpath fill-rule='evenodd' d='M8.646 5.646a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L10.293 8 8.646 6.354a.5.5 0 0 1 0-.708zm-1.292 0a.5.5 0 0 0-.708 0l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708L5.707 8l1.647-1.646a.5.5 0 0 0 0-.708z'/%3E%3C/svg%3E"); + background-size: 1em; +} + +/* stylelint-disable-next-line selector-max-universal */ +.bd-heading + div > * + * { + margin-top: 3rem; +} + +/* Table of contents */ +.bd-aside a { + padding: .1875rem .5rem; + margin-top: .125rem; + margin-right: .3125rem; + color: var(--bs-body-color); +} + +.bd-aside a:hover, +.bd-aside a:focus { + color: var(--bs-body-color); + background-color: rgba(121, 82, 179, .1); +} + +.bd-aside .active { + font-weight: 600; + color: var(--bs-body-color); +} + +.bd-aside .btn { + padding: .25rem .5rem; + font-weight: 600; + color: var(--bs-body-color); +} + +.bd-aside .btn:hover, +.bd-aside .btn:focus { + color: var(--bs-body-color); + background-color: rgba(121, 82, 179, .1); +} + +.bd-aside .btn:focus { + box-shadow: 0 0 0 1px rgba(121, 82, 179, .7); +} + +.bd-aside .btn::before { + width: 1.25em; + line-height: 0; + content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ccc' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e"); + transition: transform .35s ease; + transform: rotate(180deg) translateX(-2px); + transform-origin: .5em 50%; +} + +.bd-aside .btn[aria-expanded="true"]::before { + transform: rotate(90deg); +} + + +/* Examples */ +.scrollspy-example { + height: 200px; +} + +[id="modal"] .bd-example .btn, +[id="buttons"] .bd-example .btn, +[id="tooltips"] .bd-example .btn, +[id="popovers"] .bd-example .btn, +[id="dropdowns"] .bd-example .btn-group, +[id="dropdowns"] .bd-example .dropdown, +[id="dropdowns"] .bd-example .dropup, +[id="dropdowns"] .bd-example .dropend, +[id="dropdowns"] .bd-example .dropstart { + margin: 0 0 1rem 1rem; +} + +/* Layout */ +@media (min-width: 1200px) { + body { + display: grid; + grid-template-rows: auto; + grid-template-columns: 1fr 4fr 1fr; + gap: 1rem; + } + + .bd-header { + position: fixed; + top: 0; + right: 0; + left: 0; + z-index: 1030; + grid-column: 1 / span 3; + } + + .bd-aside, + .bd-cheatsheet { + padding-top: 4rem; + } + + /** + * 1. Too bad only Firefox supports subgrids ATM + */ + .bd-cheatsheet, + .bd-cheatsheet section, + .bd-cheatsheet article { + display: inherit; /* 1 */ + grid-template-rows: auto; + grid-template-columns: 1fr 4fr; + grid-column: 1 / span 2; + gap: inherit; /* 1 */ + } + + .bd-aside { + grid-area: 1 / 3; + scroll-margin-top: 4rem; + } + + .bd-cheatsheet section, + .bd-cheatsheet section > h2 { + top: 2rem; + scroll-margin-top: 2rem; + } + + .bd-cheatsheet section > h2::before { + position: absolute; + top: 0; + right: 0; + bottom: -2rem; + left: 0; + z-index: -1; + content: ""; + } + + .bd-cheatsheet article, + .bd-cheatsheet .bd-heading { + top: 8rem; + scroll-margin-top: 8rem; + } + + .bd-cheatsheet .bd-heading { + z-index: 1; + } +} diff --git a/site/src/assets/examples/cheatsheet/index.astro b/site/src/assets/examples/cheatsheet/index.astro new file mode 100644 index 000000000000..ae2752e0f71e --- /dev/null +++ b/site/src/assets/examples/cheatsheet/index.astro @@ -0,0 +1,1563 @@ +--- +import { getData } from '@libs/data' +import { getVersionedDocsPath } from '@libs/path' +import Example from '@shortcodes/Example.astro' +import Placeholder from '@shortcodes/Placeholder.astro' + +export const title = 'Cheatsheet' +export const extra_css = ['cheatsheet.css'] +export const extra_js = [{ src: 'cheatsheet.js' }] +export const body_class = 'bg-body-tertiary' +--- + +
    +
    +

    + Bootstrap + Cheatsheet +

    + RTL cheatsheet +
    +
    + +
    +
    +

    Contents

    + +
    +
    +

    Typography

    + Documentation +
    + +
    + Display 1

    +

    Display 2

    +

    Display 3

    +

    Display 4

    +

    Display 5

    +

    Display 6

    `} /> + + Heading 1

    +

    Heading 2

    +

    Heading 3

    +

    Heading 4

    +

    Heading 5

    +

    Heading 6

    `} /> + + + This is a lead paragraph. It stands out from regular paragraphs. +

    `} /> + + You can use the mark tag to highlight text.

    +

    This line of text is meant to be treated as deleted text.

    +

    This line of text is meant to be treated as no longer accurate.

    +

    This line of text is meant to be treated as an addition to the document.

    +

    This line of text will render as underlined.

    +

    This line of text is meant to be treated as fine print.

    +

    This line rendered as bold text.

    +

    This line rendered as italicized text.

    `} /> + + `} /> + + +

    A well-known quote, contained in a blockquote element.

    +
    Someone famous in Source Title
    + `} /> + + +
  • This is a list.
  • +
  • It appears completely unstyled.
  • +
  • Structurally, it's still a list.
  • +
  • However, this style only applies to immediate child elements.
  • +
  • Nested lists: +
      +
    • are unaffected by this style
    • +
    • will still show a bullet
    • +
    • and have appropriate left margin
    • +
    +
  • +
  • This may still come in handy in some situations.
  • + `} /> + + +
  • This is a list item.
  • +
  • And another one.
  • +
  • But they're displayed inline.
  • + `} /> +
    +
    + +
    +
    +

    Tables

    + Documentation +
    +
    + + + + # + First + Last + Handle + + + + + 1 + Mark + Otto + @mdo + + + 2 + Jacob + Thornton + @fat + + + 3 + John + Doe + @social + + + `} /> + + + + + # + First + Last + Handle + + + + + 1 + Mark + Otto + @mdo + + + 2 + Jacob + Thornton + @fat + + + 3 + John + Doe + @social + + + `} /> + + + + + Class + Heading + Heading + + + + + Default + Cell + Cell + `, + ...getData('theme-colors').map((themeColor) => ` + ${themeColor.title} + Cell + Cell + `), + ` + `]} /> + + + + + # + First + Last + Handle + + + + + 1 + Mark + Otto + @mdo + + + 2 + Jacob + Thornton + @fat + + + 3 + John + Doe + @social + + + `} /> +
    +
    + +
    +
    +

    Figures

    + Documentation +
    + +
    + + +
    A caption for the above image.
    + `} /> +
    +
    +
    + +
    +

    Forms

    + +
    +
    +

    Overview

    + Documentation +
    + +
    + +
    + + +
    We'll never share your email with anyone else.
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + Radios buttons +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    + + `} /> +
    +
    +
    +
    +

    Disabled forms

    + Documentation +
    + +
    + +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    +
    + Disabled radios buttons +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    + +
    + `} /> +
    +
    +
    +
    +

    Sizing

    + Documentation +
    + +
    + + +
    +
    + +
    +
    + +
    `} /> + + + + +
    + +
    +
    + +
    + `} /> + +
    +
    +
    +

    Input group

    + Documentation +
    + +
    + + @ + +
    +
    + + @example.com +
    + +
    + https://example.com/users/ + +
    +
    + $ + + .00 +
    +
    + With textarea + +
    + `} /> + +
    +
    +
    +

    Floating labels

    + Documentation +
    + +
    + +
    + + +
    +
    + + +
    + + `} /> +
    +
    +
    +
    +

    Validation

    + Documentation +
    + +
    + +
    + + +
    + Looks good! +
    +
    +
    + + +
    + Looks good! +
    +
    +
    + +
    + @ + +
    + Please choose a username. +
    +
    +
    +
    + + +
    + Please provide a valid city. +
    +
    +
    + + +
    + Please select a valid state. +
    +
    +
    + + +
    + Please provide a valid zip. +
    +
    +
    +
    + + +
    + You must agree before submitting. +
    +
    +
    +
    + +
    + + `} /> +
    +
    +
    + +
    +

    Components

    + +
    +
    +

    Accordion

    + Documentation +
    + +
    + +
    +

    + +

    +
    +
    + This is the first item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
    +
    +
    +
    +

    + +

    +
    +
    + This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
    +
    +
    +
    +

    + +

    +
    +
    + This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
    +
    +
    +
    + `} /> + +
    +
    +
    +

    Alerts

    + Documentation +
    + +
    + ` + + `)} /> + + +

    Well done!

    +

    Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.

    +
    +

    Whenever you need to, be sure to use margin utilities to keep things nice and tidy.

    +
    + `} /> + +
    +
    +
    +

    Badge

    + Documentation +
    + +
    + Example heading New

    +

    Example heading New

    +

    Example heading New

    +

    Example heading New

    +

    Example heading New

    +

    Example heading New

    +

    Example heading New

    +

    Example heading New

    + `} /> + + ` + ${themeColor.title} + `)} /> +
    +
    + +
    +
    +

    Buttons

    + Documentation +
    +
    + ` + + `), + ``]} /> + + ` + + `)} /> + + Small button + + + `} /> +
    +
    +
    +
    +

    Button group

    + Documentation +
    + +
    + +
    + + + + +
    +
    + + + +
    +
    + +
    +
    + `} /> + +
    +
    +
    +

    Card

    + Documentation +
    + +
    + +
    +
    + +
    +
    Card title
    +

    Some quick example text to build on the card title and make up the bulk of the card's content.

    + Go somewhere +
    +
    +
    +
    +
    +
    + Featured +
    +
    +
    Card title
    +

    Some quick example text to build on the card title and make up the bulk of the card's content.

    + Go somewhere +
    + +
    +
    +
    +
    +
    +
    Card title
    +

    Some quick example text to build on the card title and make up the bulk of the card's content.

    +
    +
      +
    • An item
    • +
    • A second item
    • +
    • A third item
    • +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    Card title
    +

    This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

    +

    Last updated 3 mins ago

    +
    +
    +
    +
    +
    +
    + `} /> + +
    + + + + + + + +
    +
    +

    Popovers

    + Documentation +
    + +
    + Click to toggle popover + `} /> + + + Popover on top + + + + + `} /> +
    +
    +
    +
    +

    Progress

    + Documentation +
    + +
    + +
    0%
    +
    +
    +
    25%
    +
    +
    +
    50%
    +
    +
    +
    75%
    +
    +
    +
    100%
    +
    + `} /> + + +
    +
    +
    +
    +
    +
    + + `} /> + +
    +
    +
    +

    Scrollspy

    + Documentation +
    + +
    +
    + +
    +

    First heading

    +

    This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.

    +

    Second heading

    +

    This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.

    +

    Third heading

    +

    This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.

    +

    Fourth heading

    +

    This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.

    +

    Fifth heading

    +

    This is some placeholder content for the scrollspy page. Note that as you scroll down the page, the appropriate navigation link is highlighted. It's repeated throughout the component example. We keep adding some more example copy here to emphasize the scrolling and highlighting.

    +
    +
    +
    +
    +
    +
    +

    Spinners

    + Documentation +
    + +
    + ` +
    + Loading... +
    + `)} /> + + ` +
    + Loading... +
    + `)} /> +
    +
    +
    +
    +

    Toasts

    + Documentation +
    + +
    + +
    + + Bootstrap + 11 mins ago + +
    +
    + Hello, world! This is a toast message. +
    +
    + `} /> + +
    +
    +
    +

    Tooltips

    + Documentation +
    + +
    + Tooltip on top + + + + + `} /> +
    +
    +
    +
    + + + + + + diff --git a/site/src/assets/examples/checkout-rtl/index.astro b/site/src/assets/examples/checkout-rtl/index.astro new file mode 100644 index 000000000000..1b019357375d --- /dev/null +++ b/site/src/assets/examples/checkout-rtl/index.astro @@ -0,0 +1,231 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'مثال إتمام الشراء' +export const direction = 'rtl' +export const extra_css = ['../checkout/checkout.css'] +export const extra_js = [{ src: '../checkout/checkout.js' }] +export const body_class = 'bg-body-tertiary' +--- + +
    +
    +
    + +

    نموذج إتمام الشراء

    +

    فيما يلي مثال على نموذج تم إنشاؤه بالكامل باستخدام عناصر تحكم النموذج في Bootstrap. لكل مجموعة نماذج مطلوبة حالة تحقق يمكن تشغيلها بمحاولة إرسال النموذج دون استكماله.

    +
    + +
    +
    +

    + عربة التسوق + 3 +

    +
      +
    • +
      +
      اسم المنتج
      + وصف مختصر +
      + $12 +
    • +
    • +
      +
      المنتج الثاني
      + وصف مختصر +
      + $8 +
    • +
    • +
      +
      البند الثالث
      + وصف مختصر +
      + $5 +
    • +
    • +
      +
      رمز ترويجي
      + EXAMPLECODE +
      + -$5 +
    • +
    • + مجموع (USD) + $20 +
    • +
    + +
    +
    + + +
    +
    +
    +
    +

    عنوان الفوترة

    +
    +
    +
    + + +
    + يرجى إدخال اسم أول صحيح. +
    +
    + +
    + + +
    + يرجى إدخال اسم عائلة صحيح. +
    +
    + +
    + +
    + @ + +
    + اسم المستخدم الخاص بك مطلوب. +
    +
    +
    + +
    + + +
    + يرجى إدخال عنوان بريد إلكتروني صحيح لتصلكم تحديثات الشحن. +
    +
    + +
    + + +
    + يرجى إدخال عنوان الشحن الخاص بك. +
    +
    + +
    + + +
    + +
    + + +
    + يرجى اختيار بلد صحيح. +
    +
    + +
    + + +
    + يرجى اختيار اسم منطقة صحيح. +
    +
    + +
    + + +
    + الرمز البريدي مطلوب. +
    +
    +
    + +
    + +
    + + +
    + +
    + + +
    + +
    + +

    طريقة الدفع

    + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
    +
    + + + الاسم الكامل كما هو معروض على البطاقة +
    + الاسم على البطاقة مطلوب +
    +
    + +
    + + +
    + رقم بطاقة الائتمان مطلوب +
    +
    + +
    + + +
    + تاريخ انتهاء الصلاحية مطلوب +
    +
    + +
    + + +
    + رمز الحماية مطلوب +
    +
    +
    + +
    + + +
    +
    +
    +
    + +
    diff --git a/site/src/assets/examples/checkout/checkout.css b/site/src/assets/examples/checkout/checkout.css new file mode 100644 index 000000000000..e5ea31c405fd --- /dev/null +++ b/site/src/assets/examples/checkout/checkout.css @@ -0,0 +1,3 @@ +.container { + max-width: 960px; +} diff --git a/site/src/assets/examples/checkout/checkout.js b/site/src/assets/examples/checkout/checkout.js new file mode 100644 index 000000000000..30ea0aa6b1e0 --- /dev/null +++ b/site/src/assets/examples/checkout/checkout.js @@ -0,0 +1,19 @@ +// Example starter JavaScript for disabling form submissions if there are invalid fields +(() => { + 'use strict' + + // Fetch all the forms we want to apply custom Bootstrap validation styles to + const forms = document.querySelectorAll('.needs-validation') + + // Loop over them and prevent submission + Array.from(forms).forEach(form => { + form.addEventListener('submit', event => { + if (!form.checkValidity()) { + event.preventDefault() + event.stopPropagation() + } + + form.classList.add('was-validated') + }, false) + }) +})() diff --git a/site/src/assets/examples/checkout/index.astro b/site/src/assets/examples/checkout/index.astro new file mode 100644 index 000000000000..029bc796bf85 --- /dev/null +++ b/site/src/assets/examples/checkout/index.astro @@ -0,0 +1,231 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'Checkout example' +export const extra_css = ['checkout.css'] +export const extra_js = [{ src: 'checkout.js' }] +export const body_class = 'bg-body-tertiary' +--- + +
    +
    +
    + +

    Checkout form

    +

    Below is an example form built entirely with Bootstrap’s form controls. Each required form group has a validation state that can be triggered by attempting to submit the form without completing it.

    +
    + +
    +
    +

    + Your cart + 3 +

    +
      +
    • +
      +
      Product name
      + Brief description +
      + $12 +
    • +
    • +
      +
      Second product
      + Brief description +
      + $8 +
    • +
    • +
      +
      Third item
      + Brief description +
      + $5 +
    • +
    • +
      +
      Promo code
      + EXAMPLECODE +
      + −$5 +
    • +
    • + Total (USD) + $20 +
    • +
    + +
    +
    + + +
    +
    +
    +
    +

    Billing address

    +
    +
    +
    + + +
    + Valid first name is required. +
    +
    + +
    + + +
    + Valid last name is required. +
    +
    + +
    + +
    + @ + +
    + Your username is required. +
    +
    +
    + +
    + + +
    + Please enter a valid email address for shipping updates. +
    +
    + +
    + + +
    + Please enter your shipping address. +
    +
    + +
    + + +
    + +
    + + +
    + Please select a valid country. +
    +
    + +
    + + +
    + Please provide a valid state. +
    +
    + +
    + + +
    + Zip code required. +
    +
    +
    + +
    + +
    + + +
    + +
    + + +
    + +
    + +

    Payment

    + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
    +
    + + + Full name as displayed on card +
    + Name on card is required +
    +
    + +
    + + +
    + Credit card number is required +
    +
    + +
    + + +
    + Expiration date required +
    +
    + +
    + + +
    + Security code required +
    +
    +
    + +
    + + +
    +
    +
    +
    + + +
    diff --git a/site/src/assets/examples/cover/cover.css b/site/src/assets/examples/cover/cover.css new file mode 100644 index 000000000000..2e7aef8f88c3 --- /dev/null +++ b/site/src/assets/examples/cover/cover.css @@ -0,0 +1,50 @@ +/* + * Globals + */ + + +/* Custom default button */ +.btn-light, +.btn-light:hover, +.btn-light:focus { + color: #333; + text-shadow: none; /* Prevent inheritance from `body` */ +} + + +/* + * Base structure + */ + +body { + text-shadow: 0 .05rem .1rem rgba(0, 0, 0, .5); + box-shadow: inset 0 0 5rem rgba(0, 0, 0, .5); +} + +.cover-container { + max-width: 42em; +} + + +/* + * Header + */ + +.nav-masthead .nav-link { + color: rgba(255, 255, 255, .5); + border-bottom: .25rem solid transparent; +} + +.nav-masthead .nav-link:hover, +.nav-masthead .nav-link:focus { + border-bottom-color: rgba(255, 255, 255, .25); +} + +.nav-masthead .nav-link + .nav-link { + margin-left: 1rem; +} + +.nav-masthead .active { + color: #fff; + border-bottom-color: #fff; +} diff --git a/site/src/assets/examples/cover/index.astro b/site/src/assets/examples/cover/index.astro new file mode 100644 index 000000000000..3af731501617 --- /dev/null +++ b/site/src/assets/examples/cover/index.astro @@ -0,0 +1,31 @@ +--- +export const title = 'Cover Template' +export const extra_css = ['cover.css'] +export const html_class = 'h-100' +export const body_class = 'd-flex h-100 text-center text-bg-dark' +--- + +
    +
    +
    +

    Cover

    + +
    +
    + +
    +

    Cover your page.

    +

    Cover is a one-page template for building simple and beautiful home pages. Download, edit the text, and add your own fullscreen background photo to make it your own.

    +

    + Learn more +

    +
    + + +
    diff --git a/site/src/assets/examples/dashboard-rtl/dashboard.js b/site/src/assets/examples/dashboard-rtl/dashboard.js new file mode 100644 index 000000000000..590eb3e38486 --- /dev/null +++ b/site/src/assets/examples/dashboard-rtl/dashboard.js @@ -0,0 +1,48 @@ +/* globals Chart:false */ + +(() => { + 'use strict' + + // Graphs + const ctx = document.getElementById('myChart') + new Chart(ctx, { + type: 'line', + data: { + labels: [ + 'الأحد', + 'الإثنين', + 'الثلاثاء', + 'الأربعاء', + 'الخميس', + 'الجمعة', + 'السبت' + ], + datasets: [{ + data: [ + 15339, + 21345, + 18483, + 24003, + 23489, + 24092, + 12034 + ], + lineTension: 0, + backgroundColor: 'transparent', + borderColor: '#007bff', + borderWidth: 4, + pointBackgroundColor: '#007bff' + }] + }, + options: { + plugins: { + legend: { + display: false + }, + tooltip: { + boxPadding: 3 + } + } + } + }) +})() diff --git a/site/src/assets/examples/dashboard-rtl/index.astro b/site/src/assets/examples/dashboard-rtl/index.astro new file mode 100644 index 000000000000..c5758e95c383 --- /dev/null +++ b/site/src/assets/examples/dashboard-rtl/index.astro @@ -0,0 +1,330 @@ +--- +export const title = 'قالب لوحة القيادة' +export const direction = 'rtl' +export const extra_css = ['../dashboard/dashboard.rtl.css'] +export const extra_js = [ + { src: 'https://cdn.jsdelivr.net/npm/chart.js@4.3.2/dist/chart.umd.js', integrity: 'sha384-eI7PSr3L1XLISH8JdDII5YN/njoSsxfbrkCTnJrzXt+ENP5MOVBxD+l6sEG4zoLp'}, + { src: 'dashboard.js'} +] +--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + +
    +
    +

    لوحة القيادة

    +
    +
    + + +
    + +
    +
    + + + +

    عنوان القسم

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #عنوانعنوانعنوانعنوان
    1,001بياناتعشوائيةتثريالجدول
    1,002تثريمبهةتصميمتنسيق
    1,003عشوائيةغنيةقيمةمفيدة
    1,003معلوماتتثريتوضيحيةعشوائية
    1,004الجدولبياناتتنسيققيمة
    1,005قيمةمبهةالجدولتثري
    1,006قيمةتوضيحيةغنيةعشوائية
    1,007تثريمفيدةمعلوماتمبهة
    1,008بياناتعشوائيةتثريالجدول
    1,009تثريمبهةتصميمتنسيق
    1,010عشوائيةغنيةقيمةمفيدة
    1,011معلوماتتثريتوضيحيةعشوائية
    1,012الجدولتثريتنسيققيمة
    1,013قيمةمبهةالجدولتصميم
    1,014قيمةتوضيحيةغنيةعشوائية
    1,015بياناتمفيدةمعلوماتالجدول
    +
    +
    +
    +
    diff --git a/site/src/assets/examples/dashboard/dashboard.css b/site/src/assets/examples/dashboard/dashboard.css new file mode 100644 index 000000000000..154940c90b0b --- /dev/null +++ b/site/src/assets/examples/dashboard/dashboard.css @@ -0,0 +1,48 @@ +.bi { + display: inline-block; + width: 1rem; + height: 1rem; +} + +/* + * Sidebar + */ + +@media (min-width: 768px) { + .sidebar .offcanvas-lg { + position: -webkit-sticky; + position: sticky; + top: 48px; + } + .navbar-search { + display: block; + } +} + +.sidebar .nav-link { + font-size: .875rem; + font-weight: 500; +} + +.sidebar .nav-link.active { + color: #2470dc; +} + +.sidebar-heading { + font-size: .75rem; +} + +/* + * Navbar + */ + +.navbar-brand { + padding-top: .75rem; + padding-bottom: .75rem; + background-color: rgba(0, 0, 0, .25); + box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25); +} + +.navbar .form-control { + padding: .75rem 1rem; +} diff --git a/site/src/assets/examples/dashboard/dashboard.js b/site/src/assets/examples/dashboard/dashboard.js new file mode 100644 index 000000000000..0bae98736b8f --- /dev/null +++ b/site/src/assets/examples/dashboard/dashboard.js @@ -0,0 +1,48 @@ +/* globals Chart:false */ + +(() => { + 'use strict' + + // Graphs + const ctx = document.getElementById('myChart') + new Chart(ctx, { + type: 'line', + data: { + labels: [ + 'Sunday', + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday' + ], + datasets: [{ + data: [ + 15339, + 21345, + 18483, + 24003, + 23489, + 24092, + 12034 + ], + lineTension: 0, + backgroundColor: 'transparent', + borderColor: '#007bff', + borderWidth: 4, + pointBackgroundColor: '#007bff' + }] + }, + options: { + plugins: { + legend: { + display: false + }, + tooltip: { + boxPadding: 3 + } + } + } + }) +})() diff --git a/site/src/assets/examples/dashboard/dashboard.rtl.css b/site/src/assets/examples/dashboard/dashboard.rtl.css new file mode 100644 index 000000000000..5c8a7e25719c --- /dev/null +++ b/site/src/assets/examples/dashboard/dashboard.rtl.css @@ -0,0 +1,48 @@ +.bi { + display: inline-block; + width: 1rem; + height: 1rem; +} + +/* + * Sidebar + */ + +@media (min-width: 768px) { + .sidebar .offcanvas-lg { + position: -webkit-sticky; + position: sticky; + top: 48px; + } + .navbar-search { + display: block; + } +} + +.sidebar .nav-link { + font-size: .875rem; + font-weight: 500; +} + +.sidebar .nav-link.active { + color: #2470dc; +} + +.sidebar-heading { + font-size: .75rem; +} + +/* + * Navbar + */ + +.navbar-brand { + padding-top: .75rem; + padding-bottom: .75rem; + background-color: rgba(0, 0, 0, .25); + box-shadow: inset 1px 0 0 rgba(0, 0, 0, .25); +} + +.navbar .form-control { + padding: .75rem 1rem; +} diff --git a/site/src/assets/examples/dashboard/index.astro b/site/src/assets/examples/dashboard/index.astro new file mode 100644 index 000000000000..4d33c7fb83db --- /dev/null +++ b/site/src/assets/examples/dashboard/index.astro @@ -0,0 +1,329 @@ +--- +export const title = 'Dashboard Template' +export const extra_css = ['dashboard.css'] +export const extra_js = [ + { src: 'https://cdn.jsdelivr.net/npm/chart.js@4.3.2/dist/chart.umd.js', integrity: 'sha384-eI7PSr3L1XLISH8JdDII5YN/njoSsxfbrkCTnJrzXt+ENP5MOVBxD+l6sEG4zoLp'}, + { src: 'dashboard.js'} +] +--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + +
    +
    +

    Dashboard

    +
    +
    + + +
    + +
    +
    + + + +

    Section title

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #HeaderHeaderHeaderHeader
    1,001randomdataplaceholdertext
    1,002placeholderirrelevantvisuallayout
    1,003datarichdashboardtabular
    1,003informationplaceholderillustrativedata
    1,004textrandomlayoutdashboard
    1,005dashboardirrelevanttextplaceholder
    1,006dashboardillustrativerichdata
    1,007placeholdertabularinformationirrelevant
    1,008randomdataplaceholdertext
    1,009placeholderirrelevantvisuallayout
    1,010datarichdashboardtabular
    1,011informationplaceholderillustrativedata
    1,012textplaceholderlayoutdashboard
    1,013dashboardirrelevanttextvisual
    1,014dashboardillustrativerichdata
    1,015randomtabularinformationtext
    +
    +
    +
    +
    diff --git a/site/src/assets/examples/dropdowns/dropdowns.css b/site/src/assets/examples/dropdowns/dropdowns.css new file mode 100644 index 000000000000..f633e2cd8373 --- /dev/null +++ b/site/src/assets/examples/dropdowns/dropdowns.css @@ -0,0 +1,71 @@ +.dropdown-item-danger { + color: var(--bs-red); +} +.dropdown-item-danger:hover, +.dropdown-item-danger:focus { + color: #fff; + background-color: var(--bs-red); +} +.dropdown-item-danger.active { + background-color: var(--bs-red); +} + +.btn-hover-light { + color: var(--bs-body-color); + background-color: var(--bs-body-bg); +} +.btn-hover-light:hover, +.btn-hover-light:focus { + color: var(--bs-link-hover-color); + background-color: var(--bs-tertiary-bg); +} + +.cal-month, +.cal-days, +.cal-weekdays { + display: grid; + grid-template-columns: repeat(7, 1fr); + align-items: center; +} +.cal-month-name { + grid-column-start: 2; + grid-column-end: 7; + text-align: center; +} +.cal-weekday, +.cal-btn { + display: flex; + flex-shrink: 0; + align-items: center; + justify-content: center; + height: 3rem; + padding: 0; +} +.cal-btn:not([disabled]) { + font-weight: 500; + color: var(--bs-emphasis-color); +} +.cal-btn:hover, +.cal-btn:focus { + background-color: var(--bs-secondary-bg); +} +.cal-btn[disabled] { + border: 0; + opacity: .5; +} + +.w-220px { + width: 220px; +} + +.w-280px { + width: 280px; +} + +.w-340px { + width: 340px; +} + +.opacity-10 { + opacity: .1; +} diff --git a/site/src/assets/examples/dropdowns/index.astro b/site/src/assets/examples/dropdowns/index.astro new file mode 100644 index 000000000000..812109e41688 --- /dev/null +++ b/site/src/assets/examples/dropdowns/index.astro @@ -0,0 +1,459 @@ +--- +export const title = 'Dropdowns' +export const extra_css = ['dropdowns.css'] +--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + +
    + + + +
    + +
    + + diff --git a/site/src/assets/examples/features/features.css b/site/src/assets/examples/features/features.css new file mode 100644 index 000000000000..debc26364745 --- /dev/null +++ b/site/src/assets/examples/features/features.css @@ -0,0 +1,26 @@ +.feature-icon { + width: 4rem; + height: 4rem; + border-radius: .75rem; +} + +.icon-square { + width: 3rem; + height: 3rem; + border-radius: .75rem; +} + +.text-shadow-1 { text-shadow: 0 .125rem .25rem rgba(0, 0, 0, .25); } +.text-shadow-2 { text-shadow: 0 .25rem .5rem rgba(0, 0, 0, .25); } +.text-shadow-3 { text-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .25); } + +.card-cover { + background-repeat: no-repeat; + background-position: center center; + background-size: cover; +} + +.feature-icon-small { + width: 3rem; + height: 3rem; +} diff --git a/site/src/assets/examples/features/index.astro b/site/src/assets/examples/features/index.astro new file mode 100644 index 000000000000..7a3a7640d6bc --- /dev/null +++ b/site/src/assets/examples/features/index.astro @@ -0,0 +1,337 @@ +--- +export const title = 'Features' +export const extra_css = ['features.css'] +--- + + + + Bootstrap + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Features examples

    + + + +
    + +
    +

    Hanging icons

    +
    +
    +
    + +
    +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.

    + + Primary button + +
    +
    +
    +
    + +
    +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.

    + + Primary button + +
    +
    +
    +
    + +
    +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.

    + + Primary button + +
    +
    +
    +
    + +
    + +
    +

    Custom cards

    + +
    +
    +
    +
    +

    Short title, long jacket

    +
      +
    • + Bootstrap +
    • +
    • + + Earth +
    • +
    • + + 3d +
    • +
    +
    +
    +
    + +
    +
    +
    +

    Much longer title that wraps to multiple lines

    +
      +
    • + Bootstrap +
    • +
    • + + Pakistan +
    • +
    • + + 4d +
    • +
    +
    +
    +
    + +
    +
    +
    +

    Another longer title belongs here

    +
      +
    • + Bootstrap +
    • +
    • + + California +
    • +
    • + + 5d +
    • +
    +
    +
    +
    +
    +
    + +
    + +
    +

    Icon grid

    + +
    +
    + +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading.

    +
    +
    +
    + +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading.

    +
    +
    +
    + +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading.

    +
    +
    +
    + +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading.

    +
    +
    +
    + +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading.

    +
    +
    +
    + +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading.

    +
    +
    +
    + +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading.

    +
    +
    +
    + +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading.

    +
    +
    +
    +
    + +
    + +
    +

    Features with title

    + +
    +
    +

    Left-aligned title explaining these awesome features

    +

    Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.

    + Primary button +
    + +
    +
    +
    +
    + +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading.

    +
    + +
    +
    + +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading.

    +
    + +
    +
    + +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading.

    +
    + +
    +
    + +
    +

    Featured title

    +

    Paragraph of text beneath the heading to explain the heading.

    +
    +
    +
    +
    +
    +
    diff --git a/site/src/assets/examples/features/unsplash-photo-1.jpg b/site/src/assets/examples/features/unsplash-photo-1.jpg new file mode 100644 index 000000000000..283acd0b4cad Binary files /dev/null and b/site/src/assets/examples/features/unsplash-photo-1.jpg differ diff --git a/site/src/assets/examples/features/unsplash-photo-2.jpg b/site/src/assets/examples/features/unsplash-photo-2.jpg new file mode 100644 index 000000000000..81eae64d8ef7 Binary files /dev/null and b/site/src/assets/examples/features/unsplash-photo-2.jpg differ diff --git a/site/src/assets/examples/features/unsplash-photo-3.jpg b/site/src/assets/examples/features/unsplash-photo-3.jpg new file mode 100644 index 000000000000..0f401d1e12d1 Binary files /dev/null and b/site/src/assets/examples/features/unsplash-photo-3.jpg differ diff --git a/site/src/assets/examples/footers/index.astro b/site/src/assets/examples/footers/index.astro new file mode 100644 index 000000000000..9aaaa9f6884e --- /dev/null +++ b/site/src/assets/examples/footers/index.astro @@ -0,0 +1,179 @@ +--- +export const title = 'Footers' +--- + + + + Bootstrap + + + + + + + + + + +
    + +
    + +
    + +
    +
    +
    + + + + © {new Date().getFullYear()} Company, Inc +
    + + +
    +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + + +
    + +
    diff --git a/site/src/assets/examples/grid/grid.css b/site/src/assets/examples/grid/grid.css new file mode 100644 index 000000000000..cbc7c311fb1b --- /dev/null +++ b/site/src/assets/examples/grid/grid.css @@ -0,0 +1,13 @@ +.themed-grid-col { + padding-top: .75rem; + padding-bottom: .75rem; + background-color: rgba(112.520718, 44.062154, 249.437846, .15); + border: 1px solid rgba(112.520718, 44.062154, 249.437846, .3); +} + +.themed-container { + padding: .75rem; + margin-bottom: 1.5rem; + background-color: rgba(112.520718, 44.062154, 249.437846, .15); + border: 1px solid rgba(112.520718, 44.062154, 249.437846, .3); +} diff --git a/site/src/assets/examples/grid/index.astro b/site/src/assets/examples/grid/index.astro new file mode 100644 index 000000000000..2c01d8de9dbf --- /dev/null +++ b/site/src/assets/examples/grid/index.astro @@ -0,0 +1,185 @@ +--- +export const title = 'Grid Template' +export const extra_css = ['grid.css'] +export const body_class = 'py-4' +--- + +
    +
    + +

    Bootstrap grid examples

    +

    Basic grid layouts to get you familiar with building within the Bootstrap grid system.

    +

    In these examples the .themed-grid-col class is added to the columns to add some theming. This is not a class that is available in Bootstrap by default.

    + +

    Five grid tiers

    +

    There are five tiers to the Bootstrap grid system, one for each range of devices we support. Each tier starts at a minimum viewport size and automatically applies to the larger devices unless overridden.

    + +
    +
    .col-4
    +
    .col-4
    +
    .col-4
    +
    + +
    +
    .col-sm-4
    +
    .col-sm-4
    +
    .col-sm-4
    +
    + +
    +
    .col-md-4
    +
    .col-md-4
    +
    .col-md-4
    +
    + +
    +
    .col-lg-4
    +
    .col-lg-4
    +
    .col-lg-4
    +
    + +
    +
    .col-xl-4
    +
    .col-xl-4
    +
    .col-xl-4
    +
    + +
    +
    .col-xxl-4
    +
    .col-xxl-4
    +
    .col-xxl-4
    +
    + +

    Three equal columns

    +

    Get three equal-width columns starting at desktops and scaling to large desktops. On mobile devices, tablets and below, the columns will automatically stack.

    +
    +
    .col-md-4
    +
    .col-md-4
    +
    .col-md-4
    +
    + +

    Three equal columns alternative

    +

    By using the .row-cols-* classes, you can easily create a grid with equal columns.

    +
    +
    .col child of .row-cols-md-3
    +
    .col child of .row-cols-md-3
    +
    .col child of .row-cols-md-3
    +
    + +

    Three unequal columns

    +

    Get three columns starting at desktops and scaling to large desktops of various widths. Remember, grid columns should add up to twelve for a single horizontal block. More than that, and columns start stacking no matter the viewport.

    +
    +
    .col-md-3
    +
    .col-md-6
    +
    .col-md-3
    +
    + +

    Two columns

    +

    Get two columns starting at desktops and scaling to large desktops.

    +
    +
    .col-md-8
    +
    .col-md-4
    +
    + +

    Full width, single column

    +

    + No grid classes are necessary for full-width elements. +

    + +
    + +

    Two columns with two nested columns

    +

    Per the documentation, nesting is easy—just put a row of columns within an existing column. This gives you two columns starting at desktops and scaling to large desktops, with another two (equal widths) within the larger column.

    +

    At mobile device sizes, tablets and down, these columns and their nested columns will stack.

    +
    +
    +
    + .col-md-8 +
    +
    +
    .col-md-6
    +
    .col-md-6
    +
    +
    +
    .col-md-4
    +
    + +
    + +

    Mixed: mobile and desktop

    +

    The Bootstrap v5 grid system has six tiers of classes: xs (extra small, this class infix is not used), sm (small), md (medium), lg (large), xl (x-large), and xxl (xx-large). You can use nearly any combination of these classes to create more dynamic and flexible layouts.

    +

    Each tier of classes scales up, meaning if you plan on setting the same widths for md, lg, xl and xxl, you only need to specify md.

    +
    +
    .col-md-8
    +
    .col-6 .col-md-4
    +
    +
    +
    .col-6 .col-md-4
    +
    .col-6 .col-md-4
    +
    .col-6 .col-md-4
    +
    +
    +
    .col-6
    +
    .col-6
    +
    + +
    + +

    Mixed: mobile, tablet, and desktop

    +
    +
    .col-sm-6 .col-lg-8
    +
    .col-6 .col-lg-4
    +
    +
    +
    .col-6 .col-sm-4
    +
    .col-6 .col-sm-4
    +
    .col-6 .col-sm-4
    +
    + +
    + +

    Gutters

    +

    With .gx-* classes, the horizontal gutters can be adjusted.

    +
    +
    .col with .gx-4 gutters
    +
    .col with .gx-4 gutters
    +
    .col with .gx-4 gutters
    +
    .col with .gx-4 gutters
    +
    .col with .gx-4 gutters
    +
    .col with .gx-4 gutters
    +
    +

    Use the .gy-* classes to control the vertical gutters.

    +
    +
    .col with .gy-4 gutters
    +
    .col with .gy-4 gutters
    +
    .col with .gy-4 gutters
    +
    .col with .gy-4 gutters
    +
    .col with .gy-4 gutters
    +
    .col with .gy-4 gutters
    +
    +

    With .g-* classes, the gutters in both directions can be adjusted.

    +
    +
    .col with .g-3 gutters
    +
    .col with .g-3 gutters
    +
    .col with .g-3 gutters
    +
    .col with .g-3 gutters
    +
    .col with .g-3 gutters
    +
    .col with .g-3 gutters
    +
    +
    + +
    +
    + +

    Containers

    +

    Additional classes added in Bootstrap v4.4 allow containers that are 100% wide until a particular breakpoint. v5 adds a new xxl breakpoint.

    +
    + +
    .container
    +
    .container-sm
    +
    .container-md
    +
    .container-lg
    +
    .container-xl
    +
    .container-xxl
    +
    .container-fluid
    +
    diff --git a/site/src/assets/examples/headers/headers.css b/site/src/assets/examples/headers/headers.css new file mode 100644 index 000000000000..f887573febf5 --- /dev/null +++ b/site/src/assets/examples/headers/headers.css @@ -0,0 +1,15 @@ +.form-control-dark { + border-color: var(--bs-gray); +} +.form-control-dark:focus { + border-color: #fff; + box-shadow: 0 0 0 .25rem rgba(255, 255, 255, .25); +} + +.text-small { + font-size: 85%; +} + +.dropdown-toggle:not(:focus) { + outline: 0; +} diff --git a/site/src/assets/examples/headers/index.astro b/site/src/assets/examples/headers/index.astro new file mode 100644 index 000000000000..a233ae9039e6 --- /dev/null +++ b/site/src/assets/examples/headers/index.astro @@ -0,0 +1,294 @@ +--- +export const title = 'Headers' +export const extra_css = ['headers.css'] +--- + + + + Bootstrap + + + + + + + + + + + + + + + + + + + + + +
    +

    Headers examples

    + + + +
    + +
    +
    + +
    +
    + +
    + +
    +
    +
    + + + +
    + + + +
    + + +
    +
    +
    + +
    + +
    +
    +
    + + + + + + + + +
    + + +
    +
    +
    +
    + +
    + +
    +
    +
    + + + + + + + + + +
    +
    +
    + +
    + +
    +
    + + +
    + + + +
    +
    +
    + +
    +
    +
    +









    +
    +
    +









    +
    +
    +
    + +
    + + +
    + +
    + +
    + +
    + +
    +
    + + +
    + + +
    +
    +
    +
    + +
    +
    diff --git a/site/src/assets/examples/heroes/bootstrap-docs.png b/site/src/assets/examples/heroes/bootstrap-docs.png new file mode 100644 index 000000000000..a4e9b9864a27 Binary files /dev/null and b/site/src/assets/examples/heroes/bootstrap-docs.png differ diff --git a/site/src/assets/examples/heroes/bootstrap-themes.png b/site/src/assets/examples/heroes/bootstrap-themes.png new file mode 100644 index 000000000000..13c32337d6e1 Binary files /dev/null and b/site/src/assets/examples/heroes/bootstrap-themes.png differ diff --git a/site/src/assets/examples/heroes/heroes.css b/site/src/assets/examples/heroes/heroes.css new file mode 100644 index 000000000000..e9deaf744f34 --- /dev/null +++ b/site/src/assets/examples/heroes/heroes.css @@ -0,0 +1,3 @@ +@media (min-width: 992px) { + .rounded-lg-3 { border-radius: .3rem; } +} diff --git a/site/src/assets/examples/heroes/index.astro b/site/src/assets/examples/heroes/index.astro new file mode 100644 index 000000000000..853776e7bc90 --- /dev/null +++ b/site/src/assets/examples/heroes/index.astro @@ -0,0 +1,124 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'Heroes' +export const extra_css = ['heroes.css'] +--- + +
    +

    Heroes examples

    + +
    + +

    Centered hero

    +
    +

    Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.

    +
    + + +
    +
    +
    + +
    + +
    +

    Centered screenshot

    +
    +

    Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.

    +
    + + +
    +
    +
    +
    + Example image +
    +
    +
    + +
    + +
    +
    +
    + Bootstrap Themes +
    +
    +

    Responsive left-aligned hero with image

    +

    Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.

    +
    + + +
    +
    +
    +
    + +
    + +
    +
    +
    +

    Vertically centered hero sign-up form

    +

    Below is an example form built entirely with Bootstrap’s form controls. Each required form group has a validation state that can be triggered by attempting to submit the form without completing it.

    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + +
    + +
    + By clicking Sign up, you agree to the terms of use. +
    +
    +
    +
    + +
    + +
    +
    +
    +

    Border hero with cropped image and shadows

    +

    Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.

    +
    + + +
    +
    +
    + +
    +
    +
    + +
    + +
    +
    +

    Dark color hero

    +
    +

    Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.

    +
    + + +
    +
    +
    +
    + +
    +
    diff --git a/site/src/assets/examples/jumbotron/index.astro b/site/src/assets/examples/jumbotron/index.astro new file mode 100644 index 000000000000..6874af1ca363 --- /dev/null +++ b/site/src/assets/examples/jumbotron/index.astro @@ -0,0 +1,43 @@ +--- +export const title = 'Jumbotron example' +--- + +
    +
    +
    + + Bootstrap + Jumbotron example + +
    + +
    +
    +

    Custom jumbotron

    +

    Using a series of utilities, you can create this jumbotron, just like the one in previous versions of Bootstrap. Check out the examples below for how you can remix and restyle it to your liking.

    + +
    +
    + +
    +
    +
    +

    Change the background

    +

    Swap the background-color utility and add a `.text-*` color utility to mix up the jumbotron look. Then, mix and match with additional component themes and more.

    + +
    +
    +
    +
    +

    Add borders

    +

    Or, keep it light and add a border for some added definition to the boundaries of your content. Be sure to look under the hood at the source HTML here as we've adjusted the alignment and sizing of both column's content for equal-height.

    + +
    +
    +
    + +
    + © {new Date().getFullYear()} +
    +
    +
    diff --git a/site/src/assets/examples/jumbotrons/index.astro b/site/src/assets/examples/jumbotrons/index.astro new file mode 100644 index 000000000000..587e793024c3 --- /dev/null +++ b/site/src/assets/examples/jumbotrons/index.astro @@ -0,0 +1,79 @@ +--- +export const title = 'Jumbotrons' +export const extra_css = ['jumbotrons.css'] +--- + + + + Bootstrap + + + + + + + + + + + +
    +
    + +

    Jumbotron with icon

    +

    + This is a custom jumbotron featuring an SVG image at the top, some longer text that wraps early thanks to a responsive .col-* class, and a customized call to action. +

    +
    + + +
    +
    +
    + +
    + +
    +
    + + +

    Placeholder jumbotron

    +

    + This faded back jumbotron is useful for placeholder content. It's also a great way to add a bit of context to a page or section when no content is available and to encourage visitors to take a specific action. +

    + +
    +
    + +
    + +
    +
    +
    +

    Full-width jumbotron

    +

    + This takes the basic jumbotron above and makes its background edge-to-edge with a .container inside to align content. Similar to above, it's been recreated with built-in grid and utility classes. +

    +
    +
    +
    + +
    + +
    +
    +

    Basic jumbotron

    +

    + This is a simple Bootstrap jumbotron that sits within a .container, recreated with built-in utility classes. +

    +
    +
    + +
    diff --git a/site/src/assets/examples/jumbotrons/jumbotrons.css b/site/src/assets/examples/jumbotrons/jumbotrons.css new file mode 100644 index 000000000000..d7d065ed64b6 --- /dev/null +++ b/site/src/assets/examples/jumbotrons/jumbotrons.css @@ -0,0 +1 @@ +.border-dashed { --bs-border-style: dashed; } diff --git a/site/src/assets/examples/list-groups/index.astro b/site/src/assets/examples/list-groups/index.astro new file mode 100644 index 000000000000..220678f07ef4 --- /dev/null +++ b/site/src/assets/examples/list-groups/index.astro @@ -0,0 +1,222 @@ +--- +export const title = 'List groups' +export const extra_css = ['list-groups.css'] +--- + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + + + +
    + +
    + + + +
    +
    + +
    + +
    +
    + + + + +
    +
    + +
    + +
    +
    + + + + + + + + + + + +
    +
    + +
    + +
    +
    +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    +
    +
    diff --git a/site/src/assets/examples/list-groups/list-groups.css b/site/src/assets/examples/list-groups/list-groups.css new file mode 100644 index 000000000000..b90cfa065533 --- /dev/null +++ b/site/src/assets/examples/list-groups/list-groups.css @@ -0,0 +1,63 @@ +.list-group { + width: 100%; + max-width: 460px; + margin-inline: 1.5rem; +} + +.form-check-input:checked + .form-checked-content { + opacity: .5; +} + +.form-check-input-placeholder { + border-style: dashed; +} +[contenteditable]:focus { + outline: 0; +} + +.list-group-checkable .list-group-item { + cursor: pointer; +} +.list-group-item-check { + position: absolute; + clip: rect(0, 0, 0, 0); +} +.list-group-item-check:hover + .list-group-item { + background-color: var(--bs-secondary-bg); +} +.list-group-item-check:checked + .list-group-item { + color: #fff; + background-color: var(--bs-primary); + border-color: var(--bs-primary); +} +.list-group-item-check[disabled] + .list-group-item, +.list-group-item-check:disabled + .list-group-item { + pointer-events: none; + filter: none; + opacity: .5; +} + +.list-group-radio .list-group-item { + cursor: pointer; + border-radius: .5rem; +} +.list-group-radio .form-check-input { + z-index: 2; + margin-top: -.5em; +} +.list-group-radio .list-group-item:hover, +.list-group-radio .list-group-item:focus { + background-color: var(--bs-secondary-bg); +} + +.list-group-radio .form-check-input:checked + .list-group-item { + background-color: var(--bs-body); + border-color: var(--bs-primary); + box-shadow: 0 0 0 2px var(--bs-primary); +} +.list-group-radio .form-check-input[disabled] + .list-group-item, +.list-group-radio .form-check-input:disabled + .list-group-item { + pointer-events: none; + filter: none; + opacity: .5; +} diff --git a/site/src/assets/examples/masonry/index.astro b/site/src/assets/examples/masonry/index.astro new file mode 100644 index 000000000000..b31254920707 --- /dev/null +++ b/site/src/assets/examples/masonry/index.astro @@ -0,0 +1,106 @@ +--- +export const title = 'Masonry example' +export const extra_js = [{ + src: 'https://cdn.jsdelivr.net/npm/masonry-layout@4.2.2/dist/masonry.pkgd.min.js', + integrity: 'sha384-GNFwBvfVxBkLMJpYMOABq3c+d3KnQxudP/mGPkzpZSTYykLBNsZEnG2D9G/X/+7D', + async: true +}] +import Placeholder from "@shortcodes/Placeholder.astro" +--- + +
    +

    Bootstrap and Masonry

    +

    Integrate Masonry with the Bootstrap grid system and cards component.

    + +

    Masonry is not included in Bootstrap. Add it by including the JavaScript plugin manually, or using a CDN like so:

    + +
    
    +<script src="https://cdn.jsdelivr.net/npm/masonry-layout@4.2.2/dist/masonry.pkgd.min.js" integrity="sha384-GNFwBvfVxBkLMJpYMOABq3c+d3KnQxudP/mGPkzpZSTYykLBNsZEnG2D9G/X/+7D" crossorigin="anonymous" async></script>
    +  
    + +

    By adding data-masonry='{"percentPosition": true }' to the .row wrapper, we can combine the powers of Bootstrap's responsive grid and Masonry's positioning.

    + +
    + +
    +
    +
    + +
    +
    Card title that wraps to a new line
    +

    This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

    +
    +
    +
    +
    +
    +
    +
    +

    A well-known quote, contained in a blockquote element.

    +
    + +
    +
    +
    +
    +
    + +
    +
    Card title
    +

    This card has supporting text below as a natural lead-in to additional content.

    +

    Last updated 3 mins ago

    +
    +
    +
    +
    +
    +
    +
    +

    A well-known quote, contained in a blockquote element.

    +
    + +
    +
    +
    +
    +
    +
    +
    Card title
    +

    This card has a regular title and short paragraph of text below it.

    +

    Last updated 3 mins ago

    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +

    A well-known quote, contained in a blockquote element.

    +
    + +
    +
    +
    +
    +
    +
    +
    Card title
    +

    This is another card with title and supporting text below. This card has some additional content to make it slightly taller overall.

    +

    Last updated 3 mins ago

    +
    +
    +
    +
    + +
    diff --git a/site/src/assets/examples/modals/index.astro b/site/src/assets/examples/modals/index.astro new file mode 100644 index 000000000000..9514f6f1fb0b --- /dev/null +++ b/site/src/assets/examples/modals/index.astro @@ -0,0 +1,147 @@ +--- +export const title = 'Modals' +export const extra_css = ['modals.css'] +--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    diff --git a/site/src/assets/examples/modals/modals.css b/site/src/assets/examples/modals/modals.css new file mode 100644 index 000000000000..194e16aca6eb --- /dev/null +++ b/site/src/assets/examples/modals/modals.css @@ -0,0 +1,7 @@ +.modal-sheet .modal-dialog { + width: 380px; + transition: bottom .75s ease-in-out; +} +.modal-sheet .modal-footer { + padding-bottom: 2rem; +} diff --git a/site/src/assets/examples/navbar-bottom/index.astro b/site/src/assets/examples/navbar-bottom/index.astro new file mode 100644 index 000000000000..35aa348c69b2 --- /dev/null +++ b/site/src/assets/examples/navbar-bottom/index.astro @@ -0,0 +1,42 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'Bottom navbar example' +--- + +
    +
    +

    Bottom Navbar example

    +

    This example is a quick exercise to illustrate how the bottom navbar works.

    + View navbar docs » +
    +
    + diff --git a/site/src/assets/examples/navbar-fixed/index.astro b/site/src/assets/examples/navbar-fixed/index.astro new file mode 100644 index 000000000000..3524255c2f5f --- /dev/null +++ b/site/src/assets/examples/navbar-fixed/index.astro @@ -0,0 +1,40 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'Fixed top navbar example' +export const extra_css = ['navbar-fixed.css'] +--- + + + +
    +
    +

    Navbar example

    +

    This example is a quick exercise to illustrate how fixed to top navbar works. As you scroll, it will remain fixed to the top of your browser’s viewport.

    + View navbar docs » +
    +
    diff --git a/site/src/assets/examples/navbar-fixed/navbar-fixed.css b/site/src/assets/examples/navbar-fixed/navbar-fixed.css new file mode 100644 index 000000000000..c77c0c1475bd --- /dev/null +++ b/site/src/assets/examples/navbar-fixed/navbar-fixed.css @@ -0,0 +1,5 @@ +/* Show it is fixed to the top */ +body { + min-height: 75rem; + padding-top: 4.5rem; +} diff --git a/site/src/assets/examples/navbar-static/index.astro b/site/src/assets/examples/navbar-static/index.astro new file mode 100644 index 000000000000..600b313ec5c1 --- /dev/null +++ b/site/src/assets/examples/navbar-static/index.astro @@ -0,0 +1,40 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'Top navbar example' +export const extra_css = ['navbar-static.css'] +--- + + + +
    +
    +

    Navbar example

    +

    This example is a quick exercise to illustrate how the top-aligned navbar works. As you scroll, this navbar remains in its original position and moves with the rest of the page.

    + View navbar docs » +
    +
    diff --git a/site/src/assets/examples/navbar-static/navbar-static.css b/site/src/assets/examples/navbar-static/navbar-static.css new file mode 100644 index 000000000000..25bbdde09464 --- /dev/null +++ b/site/src/assets/examples/navbar-static/navbar-static.css @@ -0,0 +1,4 @@ +/* Show it's not fixed to the top */ +body { + min-height: 75rem; +} diff --git a/site/src/assets/examples/navbars-offcanvas/index.astro b/site/src/assets/examples/navbars-offcanvas/index.astro new file mode 100644 index 000000000000..ec6b03f76d92 --- /dev/null +++ b/site/src/assets/examples/navbars-offcanvas/index.astro @@ -0,0 +1,147 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'Navbar Template' +export const extra_css = ['navbars-offcanvas.css'] +--- + +
    + + + + + + +
    +
    +
    +

    Navbar with offcanvas examples

    +

    This example shows how responsive offcanvas menus work within the navbar. For positioning of navbars, checkout the top and fixed top examples.

    +

    From the top down, you'll see a dark navbar, light navbar and a responsive navbar—each with offcanvases built in. Resize your browser window to the large breakpoint to see the toggle for the offcanvas.

    +

    + Learn more about offcanvas navbars » +

    +
    +
    +
    +
    diff --git a/site/src/assets/examples/navbars-offcanvas/navbars-offcanvas.css b/site/src/assets/examples/navbars-offcanvas/navbars-offcanvas.css new file mode 100644 index 000000000000..70d209409d82 --- /dev/null +++ b/site/src/assets/examples/navbars-offcanvas/navbars-offcanvas.css @@ -0,0 +1,7 @@ +body { + padding-bottom: 20px; +} + +.navbar { + margin-bottom: 20px; +} diff --git a/site/src/assets/examples/navbars/index.astro b/site/src/assets/examples/navbars/index.astro new file mode 100644 index 000000000000..c48993f8d217 --- /dev/null +++ b/site/src/assets/examples/navbars/index.astro @@ -0,0 +1,450 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'Navbar Template' +export const extra_css = ['navbars.css'] +--- + +
    + + + + + + + + + + + + + + + + + + +
    +

    Matching .container-xl...

    +
    + + + +
    + + + + + + +
    +
    +
    +

    Navbar examples

    +

    This example is a quick exercise to illustrate how the navbar and its contents work. Some navbars extend the width of the viewport, others are confined within a .container. For positioning of navbars, checkout the top and fixed top examples.

    +

    At the smallest breakpoint, the collapse plugin is used to hide the links and show a menu button to toggle the collapsed content.

    +

    + View navbar docs » +

    +
    +
    +
    +
    +
    diff --git a/site/src/assets/examples/navbars/navbars.css b/site/src/assets/examples/navbars/navbars.css new file mode 100644 index 000000000000..70d209409d82 --- /dev/null +++ b/site/src/assets/examples/navbars/navbars.css @@ -0,0 +1,7 @@ +body { + padding-bottom: 20px; +} + +.navbar { + margin-bottom: 20px; +} diff --git a/site/src/assets/examples/offcanvas-navbar/index.astro b/site/src/assets/examples/offcanvas-navbar/index.astro new file mode 100644 index 000000000000..ac94ca882af6 --- /dev/null +++ b/site/src/assets/examples/offcanvas-navbar/index.astro @@ -0,0 +1,140 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'Offcanvas navbar template' +export const extra_css = ['offcanvas-navbar.css'] +export const extra_js = [{ src: 'offcanvas-navbar.js' }] +export const body_class = 'bg-body-tertiary' +export const aliases = '/docs/[[config:docs_version]]/examples/offcanvas/' +import Placeholder from "@shortcodes/Placeholder.astro" +--- + + + + + +
    +
    + +
    +

    Bootstrap

    + Since 2011 +
    +
    + +
    +
    Recent updates
    +
    + +

    + @username + Some representative placeholder content, with some information about this user. Imagine this being some sort of status update, perhaps? +

    +
    +
    + +

    + @username + Some more representative placeholder content, related to this other user. Another status update, perhaps. +

    +
    +
    + +

    + @username + This user also gets some representative placeholder content. Maybe they did something interesting, and you really want to highlight this in the recent updates. +

    +
    + + All updates + +
    + +
    +
    Suggestions
    +
    + +
    +
    + Full Name + Follow +
    + @username +
    +
    +
    + +
    +
    + Full Name + Follow +
    + @username +
    +
    +
    + +
    +
    + Full Name + Follow +
    + @username +
    +
    + + All suggestions + +
    +
    diff --git a/site/src/assets/examples/offcanvas-navbar/offcanvas-navbar.css b/site/src/assets/examples/offcanvas-navbar/offcanvas-navbar.css new file mode 100644 index 000000000000..f855b96a5564 --- /dev/null +++ b/site/src/assets/examples/offcanvas-navbar/offcanvas-navbar.css @@ -0,0 +1,52 @@ +html, +body { + overflow-x: hidden; /* Prevent scroll on narrow devices */ +} + +body { + padding-top: 56px; +} + +@media (max-width: 991.98px) { + .offcanvas-collapse { + position: fixed; + top: 56px; /* Height of navbar */ + bottom: 0; + left: 100%; + width: 100%; + padding-right: 1rem; + padding-left: 1rem; + overflow-y: auto; + visibility: hidden; + background-color: #343a40; + transition: transform .3s ease-in-out, visibility .3s ease-in-out; + } + .offcanvas-collapse.open { + visibility: visible; + transform: translateX(-100%); + } +} + +.nav-scroller .nav { + color: rgba(255, 255, 255, .75); +} + +.nav-scroller .nav-link { + padding-top: .75rem; + padding-bottom: .75rem; + font-size: .875rem; + color: #6c757d; +} + +.nav-scroller .nav-link:hover { + color: #007bff; +} + +.nav-scroller .active { + font-weight: 500; + color: #343a40; +} + +.bg-purple { + background-color: #6f42c1; +} diff --git a/site/src/assets/examples/offcanvas-navbar/offcanvas-navbar.js b/site/src/assets/examples/offcanvas-navbar/offcanvas-navbar.js new file mode 100644 index 000000000000..b97a1716489f --- /dev/null +++ b/site/src/assets/examples/offcanvas-navbar/offcanvas-navbar.js @@ -0,0 +1,7 @@ +(() => { + 'use strict' + + document.querySelector('#navbarSideCollapse').addEventListener('click', () => { + document.querySelector('.offcanvas-collapse').classList.toggle('open') + }) +})() diff --git a/site/src/assets/examples/pricing/index.astro b/site/src/assets/examples/pricing/index.astro new file mode 100644 index 000000000000..e51668fceb55 --- /dev/null +++ b/site/src/assets/examples/pricing/index.astro @@ -0,0 +1,186 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'Pricing example' +export const extra_css = ['pricing.css'] +--- + + + + Check + + + + +
    +
    + + +
    +

    Pricing

    +

    Quickly build an effective pricing table for your potential customers with this Bootstrap example. It’s built with default Bootstrap components and utilities with little customization.

    +
    +
    + +
    +
    +
    +
    +
    +

    Free

    +
    +
    +

    $0/mo

    +
      +
    • 10 users included
    • +
    • 2 GB of storage
    • +
    • Email support
    • +
    • Help center access
    • +
    + +
    +
    +
    +
    +
    +
    +

    Pro

    +
    +
    +

    $15/mo

    +
      +
    • 20 users included
    • +
    • 10 GB of storage
    • +
    • Priority email support
    • +
    • Help center access
    • +
    + +
    +
    +
    +
    +
    +
    +

    Enterprise

    +
    +
    +

    $29/mo

    +
      +
    • 30 users included
    • +
    • 15 GB of storage
    • +
    • Phone and email support
    • +
    • Help center access
    • +
    + +
    +
    +
    +
    + +

    Compare plans

    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FreeProEnterprise
    Public
    Private
    Permissions
    Sharing
    Unlimited members
    Extra security
    +
    +
    + + +
    diff --git a/site/src/assets/examples/pricing/pricing.css b/site/src/assets/examples/pricing/pricing.css new file mode 100644 index 000000000000..c65d0208f33b --- /dev/null +++ b/site/src/assets/examples/pricing/pricing.css @@ -0,0 +1,11 @@ +body { + background-image: linear-gradient(180deg, var(--bs-secondary-bg), var(--bs-body-bg) 100px, var(--bs-body-bg)); +} + +.container { + max-width: 960px; +} + +.pricing-header { + max-width: 700px; +} diff --git a/site/src/assets/examples/product/index.astro b/site/src/assets/examples/product/index.astro new file mode 100644 index 000000000000..7c98d11a18c2 --- /dev/null +++ b/site/src/assets/examples/product/index.astro @@ -0,0 +1,187 @@ +--- +export const title = 'Product example' +export const extra_css = ['product.css'] +--- + + + + + + + + + + + + + + + + +
    +
    +
    +

    Designed for engineers

    +

    Build anything you want with Aperture

    + +
    +
    +
    +
    + +
    +
    +
    +

    Another headline

    +

    And an even wittier subheading.

    +
    +
    +
    +
    +
    +

    Another headline

    +

    And an even wittier subheading.

    +
    +
    +
    +
    + +
    +
    +
    +

    Another headline

    +

    And an even wittier subheading.

    +
    +
    +
    +
    +
    +

    Another headline

    +

    And an even wittier subheading.

    +
    +
    +
    +
    + +
    +
    +
    +

    Another headline

    +

    And an even wittier subheading.

    +
    +
    +
    +
    +
    +

    Another headline

    +

    And an even wittier subheading.

    +
    +
    +
    +
    + +
    +
    +
    +

    Another headline

    +

    And an even wittier subheading.

    +
    +
    +
    +
    +
    +

    Another headline

    +

    And an even wittier subheading.

    +
    +
    +
    +
    +
    + + diff --git a/site/src/assets/examples/product/product.css b/site/src/assets/examples/product/product.css new file mode 100644 index 000000000000..6c90ae51ec34 --- /dev/null +++ b/site/src/assets/examples/product/product.css @@ -0,0 +1,74 @@ +.container { + max-width: 960px; +} + +.icon-link > .bi { + width: .75em; + height: .75em; +} + +/* + * Custom translucent site header + */ + +.site-header { + background-color: rgba(0, 0, 0, .85); + -webkit-backdrop-filter: saturate(180%) blur(20px); + backdrop-filter: saturate(180%) blur(20px); +} +.site-header a { + color: #8e8e8e; + transition: color .15s ease-in-out; +} +.site-header a:hover { + color: #fff; + text-decoration: none; +} + +/* + * Dummy devices (replace them with your own or something else entirely!) + */ + +.product-device { + position: absolute; + right: 10%; + bottom: -30%; + width: 300px; + height: 540px; + background-color: #333; + border-radius: 21px; + transform: rotate(30deg); +} + +.product-device::before { + position: absolute; + top: 10%; + right: 10px; + bottom: 10%; + left: 10px; + content: ""; + background-color: rgba(255, 255, 255, .1); + border-radius: 5px; +} + +.product-device-2 { + top: -25%; + right: auto; + bottom: 0; + left: 5%; + background-color: #e5e5e5; +} + + +/* + * Extra utilities + */ + +.flex-equal > * { + flex: 1; +} +@media (min-width: 768px) { + .flex-md-equal > * { + flex: 1; + } +} diff --git a/site/src/assets/examples/sidebars/index.astro b/site/src/assets/examples/sidebars/index.astro new file mode 100644 index 000000000000..de67a80b68d0 --- /dev/null +++ b/site/src/assets/examples/sidebars/index.astro @@ -0,0 +1,352 @@ +--- +export const title = 'Sidebars' +export const extra_css = ['sidebars.css'] +export const extra_js = [{src: 'sidebars.js'}] +--- + + + + Bootstrap + + + + + + + + + + + + + + + + + + + + + +
    +

    Sidebars examples

    + + + +
    + + + +
    + +
    + + + Icon-only + + + +
    + +
    + +
    + + + Collapsible + + +
    + +
    + + + +
    +
    diff --git a/site/src/assets/examples/sidebars/sidebars.css b/site/src/assets/examples/sidebars/sidebars.css new file mode 100644 index 000000000000..f6a8f1c53dca --- /dev/null +++ b/site/src/assets/examples/sidebars/sidebars.css @@ -0,0 +1,63 @@ +body { + min-height: 100vh; + min-height: -webkit-fill-available; +} + +html { + height: -webkit-fill-available; +} + +main { + height: 100vh; + height: -webkit-fill-available; + max-height: 100vh; + overflow-x: auto; + overflow-y: hidden; +} + +.dropdown-toggle { outline: 0; } + +.btn-toggle { + padding: .25rem .5rem; + font-weight: 600; + color: var(--bs-emphasis-color); + background-color: transparent; +} +.btn-toggle:hover, +.btn-toggle:focus { + color: rgba(var(--bs-emphasis-color-rgb), .85); + background-color: var(--bs-tertiary-bg); +} + +.btn-toggle::before { + width: 1.25em; + line-height: 0; + content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%280,0,0,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e"); + transition: transform .35s ease; + transform-origin: .5em 50%; +} + +[data-bs-theme="dark"] .btn-toggle::before { + content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%28255,255,255,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e"); +} + +.btn-toggle[aria-expanded="true"] { + color: rgba(var(--bs-emphasis-color-rgb), .85); +} +.btn-toggle[aria-expanded="true"]::before { + transform: rotate(90deg); +} + +.btn-toggle-nav a { + padding: .1875rem .5rem; + margin-top: .125rem; + margin-left: 1.25rem; +} +.btn-toggle-nav a:hover, +.btn-toggle-nav a:focus { + background-color: var(--bs-tertiary-bg); +} + +.scrollarea { + overflow-y: auto; +} diff --git a/site/src/assets/examples/sidebars/sidebars.js b/site/src/assets/examples/sidebars/sidebars.js new file mode 100644 index 000000000000..4075f1f155d9 --- /dev/null +++ b/site/src/assets/examples/sidebars/sidebars.js @@ -0,0 +1,8 @@ +/* global bootstrap: false */ +(() => { + 'use strict' + const tooltipTriggerList = Array.from(document.querySelectorAll('[data-bs-toggle="tooltip"]')) + tooltipTriggerList.forEach(tooltipTriggerEl => { + new bootstrap.Tooltip(tooltipTriggerEl) + }) +})() diff --git a/site/src/assets/examples/sign-in/index.astro b/site/src/assets/examples/sign-in/index.astro new file mode 100644 index 000000000000..ffbd75b999c0 --- /dev/null +++ b/site/src/assets/examples/sign-in/index.astro @@ -0,0 +1,32 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'Signin Template' +export const extra_css = ['sign-in.css'] +export const body_class = 'd-flex align-items-center py-4 bg-body-tertiary' +--- + +
    +
    + +

    Please sign in

    + +
    + + +
    +
    + + +
    + +
    + + +
    + +

    © 2017–{new Date().getFullYear()}

    +
    +
    diff --git a/site/src/assets/examples/sign-in/sign-in.css b/site/src/assets/examples/sign-in/sign-in.css new file mode 100644 index 000000000000..641f6d906e4c --- /dev/null +++ b/site/src/assets/examples/sign-in/sign-in.css @@ -0,0 +1,25 @@ +html, +body { + height: 100%; +} + +.form-signin { + max-width: 330px; + padding: 1rem; +} + +.form-signin .form-floating:focus-within { + z-index: 2; +} + +.form-signin input[type="email"] { + margin-bottom: -1px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} + +.form-signin input[type="password"] { + margin-bottom: 10px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} diff --git a/site/src/assets/examples/starter-template/index.astro b/site/src/assets/examples/starter-template/index.astro new file mode 100644 index 000000000000..0af3165384bc --- /dev/null +++ b/site/src/assets/examples/starter-template/index.astro @@ -0,0 +1,108 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'Starter Template' +--- + + + + + + + Bootstrap + + + + +
    +
    + + + Starter template + +
    + +
    +

    Get started with Bootstrap

    +

    Quickly and easily get started with Bootstrap's compiled, production-ready files with this barebones example featuring some basic HTML and helpful links. Download all our examples to get started.

    + + + +
    + +
    +
    +

    Starter projects

    +

    Ready to go beyond the starter template? Check out these open source projects that you can quickly duplicate to a new GitHub repository.

    + +
    + +
    +

    Guides

    +

    Read more detailed instructions and documentation on using or contributing to Bootstrap.

    + +
    +
    +
    +
    + Created by the Bootstrap team · © {new Date().getFullYear()} +
    +
    diff --git a/site/src/assets/examples/sticky-footer-navbar/index.astro b/site/src/assets/examples/sticky-footer-navbar/index.astro new file mode 100644 index 000000000000..9b9b5ebb9893 --- /dev/null +++ b/site/src/assets/examples/sticky-footer-navbar/index.astro @@ -0,0 +1,52 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'Sticky Footer Navbar Template' +export const extra_css = ['sticky-footer-navbar.css'] +export const html_class = 'h-100' +export const body_class = 'd-flex flex-column h-100' +--- + +
    + + +
    + + +
    +
    +

    Sticky footer with fixed navbar

    +

    Pin a footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS. A fixed navbar has been added with padding-top: 60px; on the main > .container.

    +

    Back to the default sticky footer minus the navbar.

    +
    +
    + +
    +
    + Place sticky footer content here. +
    +
    diff --git a/site/src/assets/examples/sticky-footer-navbar/sticky-footer-navbar.css b/site/src/assets/examples/sticky-footer-navbar/sticky-footer-navbar.css new file mode 100644 index 000000000000..3087ead7dbde --- /dev/null +++ b/site/src/assets/examples/sticky-footer-navbar/sticky-footer-navbar.css @@ -0,0 +1,7 @@ +/* Custom page CSS +-------------------------------------------------- */ +/* Not required for template or sticky footer method. */ + +main > .container { + padding: 60px 15px 0; +} diff --git a/site/src/assets/examples/sticky-footer/index.astro b/site/src/assets/examples/sticky-footer/index.astro new file mode 100644 index 000000000000..b436ad0c4d9a --- /dev/null +++ b/site/src/assets/examples/sticky-footer/index.astro @@ -0,0 +1,23 @@ +--- +import { getVersionedDocsPath } from '@libs/path' + +export const title = 'Sticky Footer Template' +export const extra_css = ['sticky-footer.css'] +export const html_class = 'h-100' +export const body_class = 'd-flex flex-column h-100' +--- + + +
    +
    +

    Sticky footer

    +

    Pin a footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS.

    +

    Use the sticky footer with a fixed navbar if need be, too.

    +
    +
    + +
    +
    + Place sticky footer content here. +
    +
    diff --git a/site/src/assets/examples/sticky-footer/sticky-footer.css b/site/src/assets/examples/sticky-footer/sticky-footer.css new file mode 100644 index 000000000000..f8be43729457 --- /dev/null +++ b/site/src/assets/examples/sticky-footer/sticky-footer.css @@ -0,0 +1,9 @@ +/* Custom page CSS +-------------------------------------------------- */ +/* Not required for template or sticky footer method. */ + +.container { + width: auto; + max-width: 680px; + padding: 0 15px; +} diff --git a/site/src/assets/partials/sidebar.js b/site/src/assets/partials/sidebar.js new file mode 100644 index 000000000000..bf42e7b5ef04 --- /dev/null +++ b/site/src/assets/partials/sidebar.js @@ -0,0 +1,30 @@ +// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT +// IT'S ALL JUST JUNK FOR OUR DOCS! +// ++++++++++++++++++++++++++++++++++++++++++ + +/* + * JavaScript for Bootstrap's docs (https://getbootstrap.com/) + * Copyright 2011-2025 The Bootstrap Authors + * Licensed under the Creative Commons Attribution 3.0 Unported License. + * For details, see https://creativecommons.org/licenses/by/3.0/. + */ + +export default () => { + // Scroll the active sidebar link into view + const sidenav = document.querySelector('.bd-sidebar') + const sidenavActiveLink = document.querySelector('.bd-links-nav .active') + + if (!sidenav || !sidenavActiveLink) { + return + } + + const sidenavHeight = sidenav.clientHeight + const sidenavActiveLinkTop = sidenavActiveLink.offsetTop + const sidenavActiveLinkHeight = sidenavActiveLink.clientHeight + const viewportTop = sidenavActiveLinkTop + const viewportBottom = viewportTop - sidenavHeight + sidenavActiveLinkHeight + + if (sidenav.scrollTop > viewportTop || sidenav.scrollTop < viewportBottom) { + sidenav.scrollTop = viewportTop - (sidenavHeight / 2) + (sidenavActiveLinkHeight / 2) + } +} diff --git a/site/src/assets/partials/snippets.js b/site/src/assets/partials/snippets.js new file mode 100644 index 000000000000..498071b415a2 --- /dev/null +++ b/site/src/assets/partials/snippets.js @@ -0,0 +1,168 @@ +// NOTICE!!! Initially embedded in our docs this JavaScript +// file contains elements that can help you create reproducible +// use cases in StackBlitz for instance. +// In a real project please adapt this content to your needs. +// ++++++++++++++++++++++++++++++++++++++++++ + +/* + * JavaScript for Bootstrap's docs (https://getbootstrap.com/) + * Copyright 2011-2025 The Bootstrap Authors + * Licensed under the Creative Commons Attribution 3.0 Unported License. + * For details, see https://creativecommons.org/licenses/by/3.0/. + */ + +/* global bootstrap: false */ + +export default () => { + // -------- + // Tooltips + // -------- + // Instantiate all tooltips in a docs or StackBlitz + document.querySelectorAll('[data-bs-toggle="tooltip"]') + .forEach(tooltip => { + new bootstrap.Tooltip(tooltip) + }) + + // -------- + // Popovers + // -------- + // Instantiate all popovers in docs or StackBlitz + document.querySelectorAll('[data-bs-toggle="popover"]') + .forEach(popover => { + new bootstrap.Popover(popover) + }) + + // ------------------------------- + // Toasts + // ------------------------------- + // Used by 'Placement' example in docs or StackBlitz + const toastPlacement = document.getElementById('toastPlacement') + if (toastPlacement) { + document.getElementById('selectToastPlacement').addEventListener('change', function () { + if (!toastPlacement.dataset.originalClass) { + toastPlacement.dataset.originalClass = toastPlacement.className + } + + toastPlacement.className = `${toastPlacement.dataset.originalClass} ${this.value}` + }) + } + + // Instantiate all toasts in docs pages only + document.querySelectorAll('.bd-example .toast') + .forEach(toastNode => { + const toast = new bootstrap.Toast(toastNode, { + autohide: false + }) + + toast.show() + }) + + // Instantiate all toasts in docs pages only + // js-docs-start live-toast + const toastTrigger = document.getElementById('liveToastBtn') + const toastLiveExample = document.getElementById('liveToast') + + if (toastTrigger) { + const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastLiveExample) + toastTrigger.addEventListener('click', () => { + toastBootstrap.show() + }) + } + // js-docs-end live-toast + + // ------------------------------- + // Alerts + // ------------------------------- + // Used in 'Show live alert' example in docs or StackBlitz + + // js-docs-start live-alert + const alertPlaceholder = document.getElementById('liveAlertPlaceholder') + const appendAlert = (message, type) => { + const wrapper = document.createElement('div') + wrapper.innerHTML = [ + `' + ].join('') + + alertPlaceholder.append(wrapper) + } + + const alertTrigger = document.getElementById('liveAlertBtn') + if (alertTrigger) { + alertTrigger.addEventListener('click', () => { + appendAlert('Nice, you triggered this alert message!', 'success') + }) + } + // js-docs-end live-alert + + // -------- + // Carousels + // -------- + // Instantiate all non-autoplaying carousels in docs or StackBlitz + document.querySelectorAll('.carousel:not([data-bs-ride="carousel"])') + .forEach(carousel => { + bootstrap.Carousel.getOrCreateInstance(carousel) + }) + + // ------------------------------- + // Checks & Radios + // ------------------------------- + // Indeterminate checkbox example in docs and StackBlitz + document.querySelectorAll('.bd-example-indeterminate [type="checkbox"]') + .forEach(checkbox => { + if (checkbox.id.includes('Indeterminate')) { + checkbox.indeterminate = true + } + }) + + // ------------------------------- + // Links + // ------------------------------- + // Disable empty links in docs examples only + document.querySelectorAll('.bd-content [href="#"]') + .forEach(link => { + link.addEventListener('click', event => { + event.preventDefault() + }) + }) + + // ------------------------------- + // Modal + // ------------------------------- + // Modal 'Varying modal content' example in docs and StackBlitz + // js-docs-start varying-modal-content + const exampleModal = document.getElementById('exampleModal') + if (exampleModal) { + exampleModal.addEventListener('show.bs.modal', event => { + // Button that triggered the modal + const button = event.relatedTarget + // Extract info from data-bs-* attributes + const recipient = button.getAttribute('data-bs-whatever') + // If necessary, you could initiate an Ajax request here + // and then do the updating in a callback. + + // Update the modal's content. + const modalTitle = exampleModal.querySelector('.modal-title') + const modalBodyInput = exampleModal.querySelector('.modal-body input') + + modalTitle.textContent = `New message to ${recipient}` + modalBodyInput.value = recipient + }) + } + // js-docs-end varying-modal-content + + // ------------------------------- + // Offcanvas + // ------------------------------- + // 'Offcanvas components' example in docs only + const myOffcanvas = document.querySelectorAll('.bd-example-offcanvas .offcanvas') + if (myOffcanvas) { + myOffcanvas.forEach(offcanvas => { + offcanvas.addEventListener('show.bs.offcanvas', event => { + event.preventDefault() + }, false) + }) + } +} diff --git a/site/src/assets/search.js b/site/src/assets/search.js new file mode 100644 index 000000000000..1077babdb376 --- /dev/null +++ b/site/src/assets/search.js @@ -0,0 +1,59 @@ +// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT +// IT'S ALL JUST JUNK FOR OUR DOCS! +// ++++++++++++++++++++++++++++++++++++++++++ + +/*! + * JavaScript for Bootstrap's docs (https://getbootstrap.com/) + * Copyright 2024-2025 The Bootstrap Authors + * Licensed under the Creative Commons Attribution 3.0 Unported License. + * For details, see https://creativecommons.org/licenses/by/3.0/. + */ + +import docsearch from '@docsearch/js' + +(() => { + // These values will be replaced by Astro's Vite plugin + const CONFIG = { + apiKey: '__API_KEY__', + indexName: '__INDEX_NAME__', + appId: '__APP_ID__' + } + + const searchElement = document.getElementById('docsearch') + + if (!searchElement) { + return + } + + const siteDocsVersion = searchElement.getAttribute('data-bd-docs-version') + + docsearch({ + apiKey: CONFIG.apiKey, + indexName: CONFIG.indexName, + appId: CONFIG.appId, + container: searchElement, + searchParameters: { + facetFilters: [`version:${siteDocsVersion}`] + }, + transformItems(items) { + return items.map(item => { + const liveUrl = 'https://getbootstrap.com/' + + item.url = window.location.origin.startsWith(liveUrl) ? + // On production, return the result as is + item.url : + // On development or Netlify, replace `item.url` with a trailing slash, + // so that the result link is relative to the server root + item.url.replace(liveUrl, '/') + + // Prevent jumping to first header + if (item.anchor === 'content') { + item.url = item.url.replace(/#content$/, '') + item.anchor = null + } + + return item + }) + } + }) +})() diff --git a/site/src/assets/snippets.js b/site/src/assets/snippets.js new file mode 100644 index 000000000000..d18ab41c4f19 --- /dev/null +++ b/site/src/assets/snippets.js @@ -0,0 +1,15 @@ +/* + * JavaScript for Bootstrap's docs (https://getbootstrap.com/) + * Copyright 2011-2025 The Bootstrap Authors + * Licensed under the Creative Commons Attribution 3.0 Unported License. + * For details, see https://creativecommons.org/licenses/by/3.0/. + */ + +// Note that this file is not published; we only include it in scripts.html +// for StackBlitz to work + +/* eslint-disable import/no-unresolved */ +import snippets from 'js/partials/snippets.js' +/* eslint-enable import/no-unresolved */ + +snippets() diff --git a/site/src/assets/stackblitz.js b/site/src/assets/stackblitz.js new file mode 100644 index 000000000000..0b450a7d4dc3 --- /dev/null +++ b/site/src/assets/stackblitz.js @@ -0,0 +1,89 @@ +// NOTICE!!! Initially embedded in our docs this JavaScript +// file contains elements that can help you create reproducible +// use cases in StackBlitz for instance. +// In a real project please adapt this content to your needs. +// ++++++++++++++++++++++++++++++++++++++++++ + +/*! + * JavaScript for Bootstrap's docs (https://getbootstrap.com/) + * Copyright 2024-2025 The Bootstrap Authors + * Licensed under the Creative Commons Attribution 3.0 Unported License. + * For details, see https://creativecommons.org/licenses/by/3.0/. + */ + +import sdk from '@stackblitz/sdk' +// eslint-disable-next-line import/no-unresolved +import snippetsContent from './partials/snippets.js?raw' + +// These values will be replaced by Astro's Vite plugin +const CONFIG = { + cssCdn: '__CSS_CDN__', + jsBundleCdn: '__JS_BUNDLE_CDN__', + docsVersion: '__DOCS_VERSION__' +} + +// Open in StackBlitz logic +document.querySelectorAll('.btn-edit').forEach(btn => { + btn.addEventListener('click', event => { + const codeSnippet = event.target.closest('.bd-code-snippet') + const exampleEl = codeSnippet.querySelector('.bd-example') + + const htmlSnippet = exampleEl.innerHTML + const jsSnippet = codeSnippet.querySelector('.btn-edit').getAttribute('data-sb-js-snippet') + // Get extra classes for this example + const classes = Array.from(exampleEl.classList).join(' ') + + openBootstrapSnippet(htmlSnippet, jsSnippet, classes) + }) +}) + +const openBootstrapSnippet = (htmlSnippet, jsSnippet, classes) => { + const indexHtml = ` + + + + + + + Bootstrap Example + + + + +${htmlSnippet.trimStart().replace(/^/gm, ' ').replace(/^ {4}$/gm, '').trimEnd()} + + +` + + // Modify the snippets content to convert export default to a variable and invoke it + let modifiedSnippetsContent = '' + + if (jsSnippet) { + // Replace export default with a variable assignment + modifiedSnippetsContent = snippetsContent.replace( + 'export default () => {', + 'const snippets_default = () => {' + ) + + // Add IIFE wrapper and execution + modifiedSnippetsContent = `(() => { + ${modifiedSnippetsContent} + + // + snippets_default(); +})();` + } + + const project = { + files: { + 'index.html': indexHtml, + ...(jsSnippet && { 'index.js': modifiedSnippetsContent }) + }, + title: 'Bootstrap Example', + description: `Official example from ${window.location.href}`, + template: jsSnippet ? 'javascript' : 'html', + tags: ['bootstrap'] + } + + sdk.openProject(project, { openFile: 'index.html' }) +} diff --git a/site/src/components/Ads.astro b/site/src/components/Ads.astro new file mode 100644 index 000000000000..2a53c0a615f5 --- /dev/null +++ b/site/src/components/Ads.astro @@ -0,0 +1,9 @@ +--- +--- + + diff --git a/site/src/components/DocsScripts.astro b/site/src/components/DocsScripts.astro new file mode 100644 index 000000000000..3fab14b26c3e --- /dev/null +++ b/site/src/components/DocsScripts.astro @@ -0,0 +1,4 @@ +--- +--- + + diff --git a/site/src/components/DocsSidebar.astro b/site/src/components/DocsSidebar.astro new file mode 100644 index 000000000000..1282ed7026e1 --- /dev/null +++ b/site/src/components/DocsSidebar.astro @@ -0,0 +1,84 @@ +--- +import { getData } from '@libs/data' +import { getConfig } from '@libs/config' +import { docsPages } from '@libs/content' +import { getSlug } from '@libs/utils' + +const sidebar = getData('sidebar') +--- + + diff --git a/site/src/components/Scripts.astro b/site/src/components/Scripts.astro new file mode 100644 index 000000000000..a4f3064b94d0 --- /dev/null +++ b/site/src/components/Scripts.astro @@ -0,0 +1,18 @@ +--- +import { getVersionedBsJsProps } from '@libs/bootstrap' +import type { Layout } from '@libs/layout' +import DocsScripts from './DocsScripts.astro' + +interface Props { + layout: Layout +} + +const { layout } = Astro.props +--- + + + + + + +{layout === 'docs' && } diff --git a/site/src/components/TableOfContents.astro b/site/src/components/TableOfContents.astro new file mode 100644 index 000000000000..7f3f3557a475 --- /dev/null +++ b/site/src/components/TableOfContents.astro @@ -0,0 +1,26 @@ +--- +import type { MarkdownHeading } from 'astro' +import { generateToc, type TocEntry } from '@libs/toc' + +interface Props { + headings?: MarkdownHeading[] + entries?: TocEntry[] +} + +const { entries, headings } = Astro.props + +const toc = entries ? entries : generateToc(headings ?? []) +--- + +
      + { + toc.map(({ children, slug, text }) => { + return ( +
    • + {text} + {children.length > 0 && } +
    • + ) + }) + } +
    diff --git a/site/src/components/footer/Footer.astro b/site/src/components/footer/Footer.astro new file mode 100644 index 000000000000..5232081ede05 --- /dev/null +++ b/site/src/components/footer/Footer.astro @@ -0,0 +1,95 @@ +--- +import BootstrapWhiteFillIcon from '@components/icons/BootstrapWhiteFillIcon.astro' +import { getConfig } from '@libs/config' +import { getVersionedDocsPath } from '@libs/path' +--- + + diff --git a/site/src/components/head/Analytics.astro b/site/src/components/head/Analytics.astro new file mode 100644 index 000000000000..00b80ad9ac4b --- /dev/null +++ b/site/src/components/head/Analytics.astro @@ -0,0 +1,6 @@ +--- +import { getConfig } from '@libs/config' +--- + + diff --git a/site/src/components/head/Favicons.astro b/site/src/components/head/Favicons.astro new file mode 100644 index 000000000000..9c462c90bc77 --- /dev/null +++ b/site/src/components/head/Favicons.astro @@ -0,0 +1,11 @@ +--- +import { getVersionedDocsPath } from '@libs/path' +--- + + + + + + + + diff --git a/site/src/components/head/Head.astro b/site/src/components/head/Head.astro new file mode 100644 index 000000000000..434ba8359c46 --- /dev/null +++ b/site/src/components/head/Head.astro @@ -0,0 +1,54 @@ +--- +import { getConfig } from '@libs/config' +import { getVersionedDocsPath } from '@libs/path' +import type { Layout } from '@libs/layout' +import Stylesheet from '@components/head/Stylesheet.astro' +import Favicons from '@components/head/Favicons.astro' +import Social from '@components/head/Social.astro' +import Analytics from '@components/head/Analytics.astro' +import Scss from '@components/head/Scss.astro' + +interface Props { + description: string + direction?: 'rtl' + layout: Layout + robots: string | undefined + thumbnail: string + title: string +} + +const { description, direction, layout, robots, thumbnail, title } = Astro.props + +const canonicalUrl = new URL(Astro.url.pathname, Astro.site) + +const isHome = Astro.url.pathname === '/' +const pageTitle = isHome + ? `${getConfig().title} · ${getConfig().subtitle}` + : `${title} · ${getConfig().title} v${getConfig().docs_version}` +--- + + + + + + + + + + + + + + + +{pageTitle} + +{robots && } + + + + + + + + diff --git a/site/src/components/head/Scss.astro b/site/src/components/head/Scss.astro new file mode 100644 index 000000000000..fc10fe75ab8a --- /dev/null +++ b/site/src/components/head/Scss.astro @@ -0,0 +1,7 @@ +--- +--- + + diff --git a/site/src/components/head/Social.astro b/site/src/components/head/Social.astro new file mode 100644 index 000000000000..bf97d1e8bebb --- /dev/null +++ b/site/src/components/head/Social.astro @@ -0,0 +1,31 @@ +--- +import { getConfig } from '@libs/config' +import { getVersionedDocsPath } from '@libs/path' +import { getStaticImageSize } from '@libs/image' +import type { Layout } from '@libs/layout' + +interface Props { + description: string + layout: Layout + thumbnail: string + title: string +} + +const { description, layout, thumbnail, title } = Astro.props + +const socialImageUrl = new URL(getVersionedDocsPath(`assets/${thumbnail}`), Astro.site) +const socialImageSize = await getStaticImageSize(`/docs/[version]/assets/${thumbnail}`) +--- + + + + + + + + + + + + + diff --git a/site/src/components/head/Stylesheet.astro b/site/src/components/head/Stylesheet.astro new file mode 100644 index 000000000000..d0203893a478 --- /dev/null +++ b/site/src/components/head/Stylesheet.astro @@ -0,0 +1,13 @@ +--- +import { getVersionedBsCssProps } from '@libs/bootstrap' +import type { Layout } from '@libs/layout' + +interface Props { + direction?: 'rtl' + layout: Layout +} + +const { direction } = Astro.props +--- + + diff --git a/site/src/components/header/Header.astro b/site/src/components/header/Header.astro new file mode 100644 index 000000000000..e68b160a198b --- /dev/null +++ b/site/src/components/header/Header.astro @@ -0,0 +1,20 @@ +--- +import type { CollectionEntry } from 'astro:content' +import type { Layout } from '@libs/layout' +import Skippy from '@components/header/Skippy.astro' +import Symbols from '@components/icons/Symbols.astro' +import Navigation from '@components/header/Navigation.astro' + +interface Props { + addedIn?: CollectionEntry<'docs'>['data']['added'] + layout: Layout + title: string +} + +const { addedIn, layout, title } = Astro.props +--- + + + + + diff --git a/site/src/components/header/LinkItem.astro b/site/src/components/header/LinkItem.astro new file mode 100644 index 000000000000..0b3f42f50e01 --- /dev/null +++ b/site/src/components/header/LinkItem.astro @@ -0,0 +1,24 @@ +--- +interface Props { + active?: boolean + class?: string + href: string + rel?: HTMLAnchorElement['rel'] + target?: HTMLAnchorElement['target'] + track?: boolean +} + +const { active, class: className, track, ...props } = Astro.props + +const content = await Astro.slots.render('default') +--- + + diff --git a/site/src/components/header/Navigation.astro b/site/src/components/header/Navigation.astro new file mode 100644 index 000000000000..4e55d54ff82f --- /dev/null +++ b/site/src/components/header/Navigation.astro @@ -0,0 +1,131 @@ +--- +import type { CollectionEntry } from 'astro:content' +import { getConfig } from '@libs/config' +import { getVersionedDocsPath } from '@libs/path' +import type { Layout } from '@libs/layout' +import BootstrapWhiteFillIcon from '@components/icons/BootstrapWhiteFillIcon.astro' +import GitHubIcon from '@components/icons/GitHubIcon.astro' +import HamburgerIcon from '@components/icons/HamburgerIcon.astro' +import LinkItem from '@components/header/LinkItem.astro' +import OpenCollectiveIcon from '@components/icons/OpenCollectiveIcon.astro' +import XIcon from '@components/icons/XIcon.astro' +import Versions from '@components/header/Versions.astro' +import ThemeToggler from '@layouts/partials/ThemeToggler.astro' + +interface Props { + addedIn?: CollectionEntry<'docs'>['data']['added'] + layout: Layout + title: string +} + +const { addedIn, layout, title } = Astro.props +--- + + diff --git a/site/src/components/header/Skippy.astro b/site/src/components/header/Skippy.astro new file mode 100644 index 000000000000..aa5ba1dbde1b --- /dev/null +++ b/site/src/components/header/Skippy.astro @@ -0,0 +1,22 @@ +--- +import type { Layout } from '@libs/layout' + +interface Props { + layout: Layout +} + +const { layout } = Astro.props +--- + +
    +
    + Skip to main content + { + layout === 'docs' && ( + + Skip to docs navigation + + ) + } +
    +
    diff --git a/site/src/components/header/Versions.astro b/site/src/components/header/Versions.astro new file mode 100644 index 000000000000..a1119e0a322d --- /dev/null +++ b/site/src/components/header/Versions.astro @@ -0,0 +1,96 @@ +--- +import type { CollectionEntry } from 'astro:content' +import { getConfig } from '@libs/config' +import type { Layout } from '@libs/layout' +import { getVersionedDocsPath } from '@libs/path' + +interface Props { + addedIn?: CollectionEntry<'docs'>['data']['added'] + layout: Layout +} + +const { addedIn, layout } = Astro.props +const { slug, version } = Astro.params + +const isHome = Astro.url.pathname === '/' + +let versionsLink = '' + +if (layout === 'docs' && version === getConfig().docs_version) { + versionsLink = `${slug}/` +} else if (layout === 'single' && Astro.url.pathname.startsWith(getVersionedDocsPath(''))) { + versionsLink = Astro.url.pathname.replace(getVersionedDocsPath(''), '') +} + +const addedIn51 = addedIn?.version === '5.1' +const addedIn52 = addedIn?.version === '5.2' +const addedIn53 = addedIn?.version === '5.3' +--- + + diff --git a/site/src/components/home/CSSVariables.astro b/site/src/components/home/CSSVariables.astro new file mode 100644 index 000000000000..92dad9dd2efb --- /dev/null +++ b/site/src/components/home/CSSVariables.astro @@ -0,0 +1,71 @@ +--- +import { getVersionedDocsPath } from '@libs/path' +import Code from '@shortcodes/Code.astro' +--- + +
    +
    +
    + +
    +

    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. +

    + +
    +
    +

    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. +

    + +
    +
    +
    diff --git a/site/src/components/home/ComponentUtilities.astro b/site/src/components/home/ComponentUtilities.astro new file mode 100644 index 000000000000..b54d4e4084c3 --- /dev/null +++ b/site/src/components/home/ComponentUtilities.astro @@ -0,0 +1,158 @@ +--- +import { getVersionedDocsPath } from '@libs/path' +import Code from '@shortcodes/Code.astro' +--- + +
    +
    +
    + +
    + +
    + +
    +

    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. +

    +
    + + +
    + + + + +`} + lang="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. +

    + +

    + + Explore the utility API + + +

    +
    +
    +
    diff --git a/site/src/components/home/Customize.astro b/site/src/components/home/Customize.astro new file mode 100644 index 000000000000..7422c517c6e9 --- /dev/null +++ b/site/src/components/home/Customize.astro @@ -0,0 +1,69 @@ +--- +import { getVersionedDocsPath } from '@libs/path' +import Code from '@shortcodes/Code.astro' +--- + +
    +
    + +
    +

    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.

    + +

    Learn more about our global Sass options.

    +
    +
    +

    Include what you need

    +

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

    + +

    Learn more about using Bootstrap with Sass.

    +
    +
    diff --git a/site/src/components/home/GetStarted.astro b/site/src/components/home/GetStarted.astro new file mode 100644 index 000000000000..4ad6807c76b0 --- /dev/null +++ b/site/src/components/home/GetStarted.astro @@ -0,0 +1,115 @@ +--- +import { getConfig } from '@libs/config' +import { getVersionedDocsPath } from '@libs/path' +import Code from '@shortcodes/Code.astro' +--- + +
    +
    + +
    +

    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 any demo from our Examples repo to quickly jumpstart Bootstrap projects. +

    + + +

    + 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. +

    + `} + lang="html" + /> + `} + lang="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/src/components/home/Icons.astro b/site/src/components/home/Icons.astro new file mode 100644 index 000000000000..4991dab599af --- /dev/null +++ b/site/src/components/home/Icons.astro @@ -0,0 +1,28 @@ +--- +import { getConfig } from '@libs/config' +import CircleSquareIcon from '@components/icons/CircleSquareIcon.astro' +import ResponsiveImage from '@layouts/partials/ResponsiveImage.astro' +--- + +
    +
    +
    + +
    +

    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 + + +

    +
    +
    + +
    +
    diff --git a/site/src/components/home/MastHead.astro b/site/src/components/home/MastHead.astro new file mode 100644 index 000000000000..f9054bac34fe --- /dev/null +++ b/site/src/components/home/MastHead.astro @@ -0,0 +1,60 @@ +--- +import { getConfig } from '@libs/config' +import { getVersionedDocsPath } from '@libs/path' +import Ads from '@components/Ads.astro' +import Code from '@components/shortcodes/Code.astro' +import ResponsiveImage from '@layouts/partials/ResponsiveImage.astro' +--- + +
    +
    +
    + + + Get Security Updates for Bootstrap 3 & 4 + + + + +

    Build fast, responsive sites with Bootstrap

    +

    + Powerful, extensible, and feature-packed frontend toolkit. Build and customize with Sass, utilize prebuilt grid + system and components, and bring projects to life with powerful JavaScript plugins. +

    + +

    + Currently v{getConfig().current_version} + · + Download + · + All releases +

    + +
    +
    +
    diff --git a/site/src/components/home/Plugins.astro b/site/src/components/home/Plugins.astro new file mode 100644 index 000000000000..236ac5a151d6 --- /dev/null +++ b/site/src/components/home/Plugins.astro @@ -0,0 +1,90 @@ +--- +import { getVersionedDocsPath } from '@libs/path' +import { getData } from '@libs/data' +import Code from '@shortcodes/Code.astro' + +const plugins = getData('plugins') +--- + +
    +
    +
    + +
    +

    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. +

    +
    + +
    + + + +
    `} + lang="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. +

    +
    +
    + { + plugins.map((plugin) => { + return ( + + ) + }) + } +
    +
    + +
    diff --git a/site/src/components/home/Themes.astro b/site/src/components/home/Themes.astro new file mode 100644 index 000000000000..68dd5e12b603 --- /dev/null +++ b/site/src/components/home/Themes.astro @@ -0,0 +1,35 @@ +--- +import { getConfig } from '@libs/config' +import DropletFillIcon from '@components/icons/DropletFillIcon.astro' +import ResponsiveImage from '@layouts/partials/ResponsiveImage.astro' +--- + +
    +
    +
    + +
    +

    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 + + +

    +
    +
    + +
    +
    diff --git a/site/src/components/icons/BootstrapWhiteFillIcon.astro b/site/src/components/icons/BootstrapWhiteFillIcon.astro new file mode 100644 index 000000000000..ef40e6a42597 --- /dev/null +++ b/site/src/components/icons/BootstrapWhiteFillIcon.astro @@ -0,0 +1,18 @@ +--- +import type { SvgIconProps } from '@libs/icon' + +type Props = SvgIconProps + +const { class: className, height, width } = Astro.props +--- + + + Bootstrap + + + diff --git a/site/src/components/icons/CircleSquareIcon.astro b/site/src/components/icons/CircleSquareIcon.astro new file mode 100644 index 000000000000..d71895069132 --- /dev/null +++ b/site/src/components/icons/CircleSquareIcon.astro @@ -0,0 +1,23 @@ +--- +import type { SvgIconProps } from '@libs/icon' + +type Props = SvgIconProps + +const { class: className, height, width } = Astro.props +--- + + diff --git a/site/src/components/icons/DropletFillIcon.astro b/site/src/components/icons/DropletFillIcon.astro new file mode 100644 index 000000000000..d1fe5b519d99 --- /dev/null +++ b/site/src/components/icons/DropletFillIcon.astro @@ -0,0 +1,24 @@ +--- +import type { SvgIconProps } from '@libs/icon' + +type Props = SvgIconProps + +const { class: className, height, width } = Astro.props +--- + + diff --git a/site/src/components/icons/GitHubIcon.astro b/site/src/components/icons/GitHubIcon.astro new file mode 100644 index 000000000000..faa01434d22d --- /dev/null +++ b/site/src/components/icons/GitHubIcon.astro @@ -0,0 +1,24 @@ +--- +import type { SvgIconProps } from '@libs/icon' + +type Props = SvgIconProps + +const { class: className, height, width } = Astro.props +--- + + + GitHub + + + diff --git a/site/src/components/icons/HamburgerIcon.astro b/site/src/components/icons/HamburgerIcon.astro new file mode 100644 index 000000000000..8ff4730a8546 --- /dev/null +++ b/site/src/components/icons/HamburgerIcon.astro @@ -0,0 +1,23 @@ +--- +import type { SvgIconProps } from '@libs/icon' + +type Props = SvgIconProps + +const { class: className, height, width } = Astro.props +--- + + diff --git a/site/src/components/icons/OpenCollectiveIcon.astro b/site/src/components/icons/OpenCollectiveIcon.astro new file mode 100644 index 000000000000..fc501641102c --- /dev/null +++ b/site/src/components/icons/OpenCollectiveIcon.astro @@ -0,0 +1,26 @@ +--- +import type { SvgIconProps } from '@libs/icon' + +type Props = SvgIconProps + +const { class: className, height, width } = Astro.props +--- + + + Open Collective + + + + diff --git a/site/src/components/icons/Symbols.astro b/site/src/components/icons/Symbols.astro new file mode 100644 index 000000000000..44d3e7310f6a --- /dev/null +++ b/site/src/components/icons/Symbols.astro @@ -0,0 +1,148 @@ +--- +--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/site/src/components/icons/XIcon.astro b/site/src/components/icons/XIcon.astro new file mode 100644 index 000000000000..ea0f4bd8e1ee --- /dev/null +++ b/site/src/components/icons/XIcon.astro @@ -0,0 +1,23 @@ +--- +import type { SvgIconProps } from '@libs/icon' + +type Props = SvgIconProps + +const { class: className, height, width } = Astro.props +--- + + + X + + + diff --git a/site/src/components/shortcodes/AddedIn.astro b/site/src/components/shortcodes/AddedIn.astro new file mode 100644 index 000000000000..d9a26ce50e7c --- /dev/null +++ b/site/src/components/shortcodes/AddedIn.astro @@ -0,0 +1,16 @@ +--- +/* + * Outputs badge to identify the first version something was added + */ + +interface Props { + version: string +} + +const { version } = Astro.props +--- + +Added in v{version} diff --git a/site/src/components/shortcodes/BsTable.astro b/site/src/components/shortcodes/BsTable.astro new file mode 100644 index 000000000000..df80455ff0c0 --- /dev/null +++ b/site/src/components/shortcodes/BsTable.astro @@ -0,0 +1,16 @@ +--- +interface Props { + /** + * The CSS class to apply to the table. + * Note that the prop is not used in this component, but in a rehype plugin applying the classes to the table element + * directly on the HTML AST (HAST) generated by Astro. + * @default "table" + * @see src/libs/rehype.ts + */ + class?: string +} +--- + +
    + +
    diff --git a/site/src/components/shortcodes/Callout.astro b/site/src/components/shortcodes/Callout.astro new file mode 100644 index 000000000000..11243c848271 --- /dev/null +++ b/site/src/components/shortcodes/Callout.astro @@ -0,0 +1,44 @@ +--- +import { getCalloutByName } from '@libs/content' +import type { MarkdownInstance } from 'astro' + +interface Props { + /** + * The name of an existing callout to display located in `src/content/callouts`. + * This will override any content passed in via the default slot. + */ + name?: + | 'danger-async-methods' + | 'info-mediaqueries-breakpoints' + | 'info-npm-starter' + | 'info-prefersreducedmotion' + | 'info-sanitizer' + | 'warning-color-assistive-technologies' + | 'warning-data-bs-title-vs-title' + | 'warning-input-support' + /** + * The type of callout to display. One of `info`, `danger`, or `warning`. + * @default 'info' + */ + type?: 'danger' | 'info' | 'warning' +} + +const { name, type = 'info' } = Astro.props + +let Content: MarkdownInstance<{}>['Content'] | undefined + +if (name) { + const callout = await getCalloutByName(name) + + if (!callout) { + throw new Error(`Could not find callout with name '${name}'.`) + } + + const namedCallout = await callout.render() + Content = namedCallout.Content +} +--- + +
    + {Content ? : } +
    diff --git a/site/src/components/shortcodes/CalloutDeprecatedDarkVariants.astro b/site/src/components/shortcodes/CalloutDeprecatedDarkVariants.astro new file mode 100644 index 000000000000..4033900d96e0 --- /dev/null +++ b/site/src/components/shortcodes/CalloutDeprecatedDarkVariants.astro @@ -0,0 +1,19 @@ +--- +/* + * Outputs message about dark mode component variants being deprecated in v5.3. + */ + +interface Props { + component: string +} + +const { component } = Astro.props +--- + +
    +

    + Heads up! Dark variants for components were deprecated in v5.3.0 with the introduction of color modes. + Instead of adding .{component}-dark, set data-bs-theme="dark" on the root element, a parent + wrapper, or the component itself. +

    +
    diff --git a/site/src/components/shortcodes/Code.astro b/site/src/components/shortcodes/Code.astro new file mode 100644 index 000000000000..231002a50b62 --- /dev/null +++ b/site/src/components/shortcodes/Code.astro @@ -0,0 +1,156 @@ +--- +import fs from 'node:fs' +import path from 'node:path' +import { Prism } from '@astrojs/prism' + +interface Props { + /** + * The CSS class(es) to be added to the `pre` HTML element when rendering code blocks in Markdown. + * Note that this prop is not used when the component is invoked directly. + */ + class?: string + /** + * The code to highlight. + * If an array is passed, elements will be joined with a new line. + */ + code?: string | string[] + /** + * The CSS class(es) to be added to the `div` wrapper HTML element. + */ + containerClass?: string + /** + * The language to use for highlighting. + * @see https://prismjs.com/#supported-languages + */ + lang?: string + /** + * If the `filePath` prop is defined, this prop can be used to specify a regex containing a match group to extract + * only a part of the file. + */ + fileMatch?: string + /** + * A path to the file containing the code to highlight relative to the root of the repository. + * This takes precedence over the `code` prop. + */ + filePath?: string +} + +const { class: className, code, containerClass, fileMatch, filePath, lang } = Astro.props + +let codeToDisplay = filePath + ? fs.readFileSync(path.join(process.cwd(), filePath), 'utf8') + : Array.isArray(code) + ? code.join('\n') + : code + +if (filePath && fileMatch && codeToDisplay) { + const match = codeToDisplay.match(new RegExp(fileMatch)) + + if (!match || !match[0]) { + throw new Error(`The file at ${filePath} does not contains a match for the regex '${fileMatch}'.`) + } + + codeToDisplay = match[0] +} +--- + + + +
    + { + Astro.slots.has('pre') ? ( + + ) : ( +
    + +
    + ) + } +
    + { + codeToDisplay && lang ? ( + + ) : ( + /* prettier-ignore */
    + ) + } +
    +
    diff --git a/site/src/components/shortcodes/DeprecatedIn.astro b/site/src/components/shortcodes/DeprecatedIn.astro new file mode 100644 index 000000000000..50ba42b95d0d --- /dev/null +++ b/site/src/components/shortcodes/DeprecatedIn.astro @@ -0,0 +1,17 @@ +--- +/* + * Outputs badge to identify the version something was deprecated + */ + +interface Props { + version: string +} + +const { version } = Astro.props +--- + + + Deprecated in v{version} + diff --git a/site/src/components/shortcodes/Example.astro b/site/src/components/shortcodes/Example.astro new file mode 100644 index 000000000000..a09fffeb31fb --- /dev/null +++ b/site/src/components/shortcodes/Example.astro @@ -0,0 +1,105 @@ +--- +import { replacePlaceholdersInHtml } from '@libs/placeholder' +import { Prism } from '@astrojs/prism' + +interface Props { + /** + * Defines if extra JS snippet should be added to StackBlitz or not. + * @default false + */ + addStackblitzJs?: boolean + /** + * The example code. + * If an array is passed, elements will be joined with a new line. + */ + code: string | string[] + /** + * The CSS class(es) to be added to the preview wrapping `div` element. + */ + class?: string + /** + * The preview wrapping `div` element ID. + */ + id?: string + /** + * Language used to display the code. + * @default 'html' + */ + lang?: string + /** + * Defines if the markup should be visible or not. + * @default true + */ + showMarkup?: boolean + /** + * Defines if the preview should be visible or not. + * @default true + */ + showPreview?: boolean +} + +const { + addStackblitzJs = false, + code, + class: className, + id, + lang = 'html', + showMarkup = true, + showPreview = true +} = Astro.props + +let markup = Array.isArray(code) ? code.join('\n') : code +markup = replacePlaceholdersInHtml(markup) + +const simplifiedMarkup = markup + .replace( + //g, + (match, classes) => `...` + ) + .replace( + //g, + (match, classes) => `...` + ) +--- + +
    + { + showPreview && ( +
    + +
    + ) + } + + { + showMarkup && ( + <> + {showPreview && ( +
    + {lang} +
    + + +
    +
    + )} +
    + +
    + + ) + } +
    diff --git a/site/src/components/shortcodes/GuideFooter.mdx b/site/src/components/shortcodes/GuideFooter.mdx new file mode 100644 index 000000000000..426a71f271c2 --- /dev/null +++ b/site/src/components/shortcodes/GuideFooter.mdx @@ -0,0 +1,3 @@ +
    + +_See something wrong or out of date here? Please [open an issue on GitHub]([[config:repo]]/issues/new/choose). Need help troubleshooting? [Search or start a discussion]([[config:repo]]/discussions) on GitHub._ diff --git a/site/src/components/shortcodes/JsDataAttributes.mdx b/site/src/components/shortcodes/JsDataAttributes.mdx new file mode 100644 index 000000000000..b7c6c0a7a858 --- /dev/null +++ b/site/src/components/shortcodes/JsDataAttributes.mdx @@ -0,0 +1,5 @@ +As options can be passed via data attributes or JavaScript, you can append an option name to `data-bs-`, as in `data-bs-animation="{value}"`. Make sure to change the case type of the option name from “_camelCase_” to “_kebab-case_” when passing the options via data attributes. For example, use `data-bs-custom-class="beautifier"` instead of `data-bs-customClass="beautifier"`. + +As of Bootstrap 5.2.0, all components support an **experimental** reserved data attribute `data-bs-config` that can house simple component configuration as a JSON string. When an element has `data-bs-config='{"delay":0, "title":123}'` and `data-bs-title="456"` attributes, the final `title` value will be `456` and the separate data attributes will override values given on `data-bs-config`. In addition, existing data attributes are able to house JSON values like `data-bs-delay='{"show":0,"hide":150}'`. + +The final configuration object is the merged result of `data-bs-config`, `data-bs-`, and `js object` where the latest given key-value overrides the others. diff --git a/site/src/components/shortcodes/JsDismiss.astro b/site/src/components/shortcodes/JsDismiss.astro new file mode 100644 index 000000000000..d1da8fc4d6ac --- /dev/null +++ b/site/src/components/shortcodes/JsDismiss.astro @@ -0,0 +1,29 @@ +--- +import Code from '@shortcodes/Code.astro' + +interface Props { + name: string +} + +const { name } = Astro.props +--- + +

    + Dismissal can be achieved with the data-bs-dismiss attribute on a button within the {name} as demonstrated below: +

    + +`} + lang="html" +/> + +

    + or on a button outside the {name} using the additional data-bs-target as demonstrated below: +

    + +`} + lang="html" +/> diff --git a/site/src/components/shortcodes/JsDocs.astro b/site/src/components/shortcodes/JsDocs.astro new file mode 100644 index 000000000000..cf756af8c700 --- /dev/null +++ b/site/src/components/shortcodes/JsDocs.astro @@ -0,0 +1,69 @@ +--- +import fs from 'node:fs' +import { getConfig } from '@libs/config' +import Code from '@shortcodes/Code.astro' + +// Prints everything between `// js-docs-start "name"` and `// js-docs-end "name"` +// comments in the docs. + +interface Props { + /** + * Reference name used to find the content to display within the content of the `file` prop. + */ + name: string + /** + * File path that contains the content to display relative to the root of the repository. + */ + file: string +} + +const { name, file } = Astro.props + +if (!name || !file) { + throw new Error( + `Missing required parameter(s) for the '' component, expected both 'name' and 'file' but got 'name: ${name}' and 'file: ${file}'.` + ) +} + +let content: string + +try { + const fileContent = fs.readFileSync(file, 'utf8') + + const matches = fileContent.match(new RegExp(`\/\/ js-docs-start ${name}\n((?:.|\n)*)\/\/ js-docs-end ${name}`, 'm')) + + if (!matches || !matches[1]) { + throw new Error( + `Failed to find the content named '${name}', make sure that '// js-docs-start ${name}' and '// js-docs-end ${name}' are defined.` + ) + } + + content = matches[1] + + // Fix the identation by removing extra spaces at the beginning of each line + const lines = content.split('\n') + const spaceCounts = lines.filter((line) => line.trim().length > 0).map((line) => line.match(/^ */)[0].length) + const minSpaces = spaceCounts.length ? Math.min(...spaceCounts) : 0 + content = lines.map((line) => line.slice(minSpaces)).join('\n') +} catch (error) { + throw new Error(`Failed to find the content to render in the '' component at '${file}'.`, { + cause: error + }) +} +--- + + +
    + + {file} + +
    + +
    +
    +
    diff --git a/site/src/components/shortcodes/Placeholder.astro b/site/src/components/shortcodes/Placeholder.astro new file mode 100644 index 000000000000..3ebde32bcb31 --- /dev/null +++ b/site/src/components/shortcodes/Placeholder.astro @@ -0,0 +1,27 @@ +--- +import { getPlaceholder, type PlaceholderOptions } from '@libs/placeholder' + +type Props = Partial + +const { + options: { background, color, showText, showTitle, text, title }, + props, + type +} = getPlaceholder(Astro.props) +--- + +{ + type === 'img' ? ( + + ) : ( + + {showTitle && {title}} + + {showText && ( + + {text} + + )} + + ) +} diff --git a/site/src/components/shortcodes/ScssDocs.astro b/site/src/components/shortcodes/ScssDocs.astro new file mode 100644 index 000000000000..6c267570eb3e --- /dev/null +++ b/site/src/components/shortcodes/ScssDocs.astro @@ -0,0 +1,71 @@ +--- +import fs from 'node:fs' +import { getConfig } from '@libs/config' +import Code from '@shortcodes/Code.astro' + +// Prints everything between `// scss-docs-start "name"` and `// scss-docs-end "name"` +// comments in the docs. + +interface Props { + /** + * Reference name used to find the content to display within the content of the `file` prop. + */ + name: string + /** + * File path that contains the content to display relative to the root of the repository. + */ + file: string +} + +const { name, file } = Astro.props + +if (!name || !file) { + throw new Error( + `Missing required parameter(s) for the '' component, expected both 'name' and 'file' but got 'name: ${name}' and 'file: ${file}'.` + ) +} + +let content: string + +try { + const fileContent = fs.readFileSync(file, 'utf8') + + const matches = fileContent.match( + new RegExp(`\/\/ scss-docs-start ${name}\n((?:.|\n)*)\/\/ scss-docs-end ${name}`, 'm') + ) + + if (!matches || !matches[1]) { + throw new Error( + `Failed to find the content named '${name}', make sure that '// scss-docs-start ${name}' and '// scss-docs-end ${name}' are defined.` + ) + } + + content = matches[1].replaceAll(' !default', '') + + // Fix the identation by removing extra spaces at the beginning of each line + const lines = content.split('\n') + const spaceCounts = lines.filter((line) => line.trim().length > 0).map((line) => line.match(/^ */)[0].length) + const minSpaces = spaceCounts.length ? Math.min(...spaceCounts) : 0 + content = lines.map((line) => line.slice(minSpaces)).join('\n') +} catch (error) { + throw new Error(`Failed to find the content to render in the '' component at '${file}'.`, { + cause: error + }) +} +--- + + +
    + + {file} + +
    + +
    +
    +
    diff --git a/site/src/components/shortcodes/Table.astro b/site/src/components/shortcodes/Table.astro new file mode 100644 index 000000000000..853b19701c57 --- /dev/null +++ b/site/src/components/shortcodes/Table.astro @@ -0,0 +1,31 @@ +--- +import Code from '@shortcodes/Code.astro' +import * as tableContent from '@shortcodes/TableContent.md' + +interface Props { + /** + * Any class(es) to be added to the `` element (both in the example and code snippet). + */ + class?: string + /** + * Show a simplified version in the example code snippet by replacing the table content inside `
    ` & `
    ` + * with `...`. + * @default true + */ + simplified?: boolean +} + +const { class: className, simplified = true } = Astro.props + +const tableCode = ` +${simplified ? ' ...' : await tableContent.compiledContent()} +` +--- + +
    + + +
    +
    + + diff --git a/site/src/components/shortcodes/TableContent.md b/site/src/components/shortcodes/TableContent.md new file mode 100644 index 000000000000..cee54c6d32a4 --- /dev/null +++ b/site/src/components/shortcodes/TableContent.md @@ -0,0 +1,28 @@ + + + # + First + Last + Handle + + + + + 1 + Mark + Otto + @mdo + + + 2 + Jacob + Thornton + @fat + + + 3 + John + Doe + @social + + diff --git a/site/src/content/callouts/danger-async-methods.md b/site/src/content/callouts/danger-async-methods.md new file mode 100644 index 000000000000..7b7a654b72d8 --- /dev/null +++ b/site/src/content/callouts/danger-async-methods.md @@ -0,0 +1 @@ +**All API methods are asynchronous and start a transition.** They return to the caller as soon as the transition is started, but before it ends. In addition, a method call on a transitioning component will be ignored. [Learn more in our JavaScript docs.](/docs/[[config:docs_version]]/getting-started/javascript/#asynchronous-functions-and-transitions) diff --git a/site/src/content/callouts/info-mediaqueries-breakpoints.md b/site/src/content/callouts/info-mediaqueries-breakpoints.md new file mode 100644 index 000000000000..52be67386a9d --- /dev/null +++ b/site/src/content/callouts/info-mediaqueries-breakpoints.md @@ -0,0 +1 @@ +**Why subtract .02px?** Browsers don’t currently support [range context queries](https://www.w3.org/TR/mediaqueries-4/#range-context), so we work around the limitations of [`min-` and `max-` prefixes](https://www.w3.org/TR/mediaqueries-4/#mq-min-max) and viewports with fractional widths (which can occur under certain conditions on high-dpi devices, for instance) by using values with higher precision. diff --git a/site/src/content/callouts/info-npm-starter.md b/site/src/content/callouts/info-npm-starter.md new file mode 100644 index 000000000000..cc4a50e68fd1 --- /dev/null +++ b/site/src/content/callouts/info-npm-starter.md @@ -0,0 +1 @@ +**Get started with Bootstrap via npm with our starter project!** Head to the [Sass & JS example](https://github.com/twbs/examples/tree/main/sass-js) template repository to see how to build and customize Bootstrap in your own npm project. Includes Sass compiler, Autoprefixer, Stylelint, PurgeCSS, and Bootstrap Icons. diff --git a/site/src/content/callouts/info-prefersreducedmotion.md b/site/src/content/callouts/info-prefersreducedmotion.md new file mode 100644 index 000000000000..49d81ef8ba93 --- /dev/null +++ b/site/src/content/callouts/info-prefersreducedmotion.md @@ -0,0 +1 @@ +The animation effect of this component is dependent on the `prefers-reduced-motion` media query. See the [reduced motion section of our accessibility documentation](/docs/[[config:docs_version]]/getting-started/accessibility/#reduced-motion). diff --git a/site/src/content/callouts/info-sanitizer.md b/site/src/content/callouts/info-sanitizer.md new file mode 100644 index 000000000000..516975b3206c --- /dev/null +++ b/site/src/content/callouts/info-sanitizer.md @@ -0,0 +1 @@ +By default, this component uses the built-in content sanitizer, which strips out any HTML elements that are not explicitly allowed. See the [sanitizer section in our JavaScript documentation](/docs/[[config:docs_version]]/getting-started/javascript/#sanitizer) for more details. diff --git a/site/src/content/callouts/warning-color-assistive-technologies.md b/site/src/content/callouts/warning-color-assistive-technologies.md new file mode 100644 index 000000000000..8afa62ee8cdb --- /dev/null +++ b/site/src/content/callouts/warning-color-assistive-technologies.md @@ -0,0 +1 @@ +**Accessibility tip:** Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies like screen readers. Please ensure the meaning is obvious from the content itself (e.g., the visible text with a [_sufficient_ color contrast](/docs/[[config:docs_version]]/getting-started/accessibility/#color-contrast)) or is included through alternative means, such as additional text hidden with the `.visually-hidden` class. diff --git a/site/src/content/callouts/warning-data-bs-title-vs-title.md b/site/src/content/callouts/warning-data-bs-title-vs-title.md new file mode 100644 index 000000000000..e932f22ad971 --- /dev/null +++ b/site/src/content/callouts/warning-data-bs-title-vs-title.md @@ -0,0 +1 @@ +Feel free to use either `title` or `data-bs-title` in your HTML. When `title` is used, Popper will replace it automatically with `data-bs-title` when the element is rendered. diff --git a/site/src/content/callouts/warning-input-support.md b/site/src/content/callouts/warning-input-support.md new file mode 100644 index 000000000000..f9d9c0abd67d --- /dev/null +++ b/site/src/content/callouts/warning-input-support.md @@ -0,0 +1 @@ +Some date inputs types are [not fully supported](https://caniuse.com/input-datetime) by the latest versions of Safari and Firefox. diff --git a/site/src/content/config.ts b/site/src/content/config.ts new file mode 100644 index 000000000000..387a0052ebef --- /dev/null +++ b/site/src/content/config.ts @@ -0,0 +1,45 @@ +import { z, defineCollection } from 'astro:content' + +const docsSchema = z.object({ + added: z + .object({ + show_badge: z.boolean().optional(), + version: z.string() + }) + .optional(), + aliases: z.string().or(z.string().array()).optional(), + description: z.string(), + direction: z.literal('rtl').optional(), + extra_js: z + .object({ + async: z.boolean().optional(), + src: z.string() + }) + .array() + .optional(), + sections: z + .object({ + description: z.string(), + title: z.string() + }) + .array() + .optional(), + thumbnail: z.string().optional(), + title: z.string(), + toc: z.boolean().optional() +}) + +const docsCollection = defineCollection({ + schema: docsSchema +}) + +const calloutsSchema = z.object({}) + +const calloutsCollection = defineCollection({ + schema: calloutsSchema +}) + +export const collections = { + docs: docsCollection, + callouts: calloutsCollection +} diff --git a/site/src/content/docs/about/brand.mdx b/site/src/content/docs/about/brand.mdx new file mode 100644 index 000000000000..0b1716221308 --- /dev/null +++ b/site/src/content/docs/about/brand.mdx @@ -0,0 +1,41 @@ +--- +title: Brand guidelines +description: Documentation and examples for Bootstrap’s logo and brand usage guidelines. +toc: true +--- + +Have a need for Bootstrap’s brand resources? Great! We have only a few guidelines we follow, and in turn ask you to follow as well. + +## Logo + +When referencing Bootstrap, use our logo mark. Do not modify our logos in any way. Do not use Bootstrap’s branding for your own open or closed source projects. + +
    + Bootstrap +
    + +Our logo mark is also available in black and white. All rules for our primary logo apply to these as well. + +
    +
    + Bootstrap +
    +
    + Bootstrap +
    +
    + +## Name + +Bootstrap should always be referred to as just **Bootstrap**. No capital _s_. + +
    +
    +
    Bootstrap
    + Correct +
    +
    +
    BootStrap
    + Incorrect +
    +
    diff --git a/site/src/content/docs/about/license.mdx b/site/src/content/docs/about/license.mdx new file mode 100644 index 000000000000..6479df67c999 --- /dev/null +++ b/site/src/content/docs/about/license.mdx @@ -0,0 +1,32 @@ +--- +title: License FAQs +description: Commonly asked questions about Bootstrap’s open source license. +--- + +Bootstrap is released under the MIT license and is copyright {new Date().getFullYear()}. Boiled down to smaller chunks, it can be described with the following conditions. + +## It requires you to: + +- Keep the license and copyright notice included in Bootstrap’s CSS and JavaScript files when you use them in your works + +## It permits you to: + +- Freely download and use Bootstrap, in whole or in part, for personal, private, company internal, or commercial purposes +- Use Bootstrap in packages or distributions that you create +- Modify the source code +- Grant a sublicense to modify and distribute Bootstrap to third parties not included in the license + +## It forbids you to: + +- Hold the authors and license owners liable for damages as Bootstrap is provided without warranty +- Hold the creators or copyright holders of Bootstrap liable +- Redistribute any piece of Bootstrap without proper attribution +- Use any marks owned by Bootstrap in any way that might state or imply that Bootstrap endorses your distribution +- Use any marks owned by Bootstrap in any way that might state or imply that you created the Bootstrap software in question + +## It does not require you to: + +- Include the source of Bootstrap itself, or of any modifications you may have made to it, in any redistribution you may assemble that includes it +- Submit changes that you make to Bootstrap back to the Bootstrap project (though such feedback is encouraged) + +The full Bootstrap license is located [in the project repository]([[config:repo]]/blob/v[[config:current_version]]/LICENSE) for more information. diff --git a/site/src/content/docs/about/overview.mdx b/site/src/content/docs/about/overview.mdx new file mode 100644 index 000000000000..efd16c543ed3 --- /dev/null +++ b/site/src/content/docs/about/overview.mdx @@ -0,0 +1,27 @@ +--- +title: About Bootstrap +description: Learn more about the team maintaining Bootstrap, how and why the project started, and how to get involved. +aliases: + - "/about/" + - "/docs/[[config:docs_version]]/about/" +--- + +## Team + +Bootstrap is maintained by a [small team of developers](https://github.com/orgs/twbs/people) on GitHub. We’re actively looking to grow this team and would love to hear from you if you’re excited about CSS at scale, writing and maintaining vanilla JavaScript plugins, and improving build tooling processes for frontend code. + +## History + +Originally created by a designer and a developer at Twitter, Bootstrap has become one of the most popular front-end frameworks and open source projects in the world. + +Bootstrap was created at Twitter in mid-2010 by [@mdo](https://x.com/mdo) and [@fat](https://x.com/fat). Prior to being an open-sourced framework, Bootstrap was known as _Twitter Blueprint_. A few months into development, Twitter held its [first Hack Week](https://blog.x.com/engineering/en_us/a/2010/hack-week) and the project exploded as developers of all skill levels jumped in without any external guidance. It served as the style guide for internal tools development at the company for over a year before its public release, and continues to do so today. + +Originally [released](https://blog.x.com/developer/en_us/a/2011/bootstrap-twitter) on , we’ve since had over [twenty releases]([[config:repo]]/releases), including two major rewrites with v2 and v3. With Bootstrap 2, we added responsive functionality to the entire framework as an optional stylesheet. Building on that with Bootstrap 3, we rewrote the library once more to make it responsive by default with a mobile first approach. + +With Bootstrap 4, we once again rewrote the project to account for two key architectural changes: a migration to Sass and the move to CSS’s flexbox. Our intention is to help in a small way to move the web development community forward by pushing for newer CSS properties, fewer dependencies, and new technologies across more modern browsers. + +Our latest release, Bootstrap 5, focuses on improving v4’s codebase with as few major breaking changes as possible. We improved existing features and components, removed support for older browsers, dropped jQuery for regular JavaScript, and embraced more future-friendly technologies like CSS custom properties as part of our tooling. + +## Get involved + +Get involved with Bootstrap development by [opening an issue]([[config:repo]]/issues/new/choose) or submitting a pull request. Read our [contributing guidelines]([[config:repo]]/blob/v[[config:current_version]]/.github/CONTRIBUTING.md) for information on how we develop. diff --git a/site/src/content/docs/about/team.mdx b/site/src/content/docs/about/team.mdx new file mode 100644 index 000000000000..46b03d87746c --- /dev/null +++ b/site/src/content/docs/about/team.mdx @@ -0,0 +1,23 @@ +--- +title: Team +description: An overview of the founding team and core contributors to Bootstrap. +--- + +import { getData } from '@libs/data' + +Bootstrap is maintained by the founding team and a small group of invaluable core contributors, with the massive support and involvement of our community. + +
    + {getData('core-team').map((member) => { + return ( + + {`@${member.user}`} + + {member.name} @{member.user} + + + ) + })} +
    + +Get involved with Bootstrap development by [opening an issue]([[config:repo]]/issues/new/choose) or submitting a pull request. Read our [contributing guidelines]([[config:repo]]/blob/v[[config:current_version]]/.github/CONTRIBUTING.md) for information on how we develop. diff --git a/site/src/content/docs/about/translations.mdx b/site/src/content/docs/about/translations.mdx new file mode 100644 index 000000000000..7db4ab846cc7 --- /dev/null +++ b/site/src/content/docs/about/translations.mdx @@ -0,0 +1,20 @@ +--- +title: Translations +description: Links to community-translated Bootstrap documentation sites. +--- + +import { getData } from '@libs/data' + +Community members have translated Bootstrap’s documentation into various languages. None are officially supported and they may not always be up-to-date. + + + +**We don’t help organize or host translations, we just link to them.** + +Finished a new or better translation? Open a pull request to add it to our list. diff --git a/site/src/content/docs/components/accordion.mdx b/site/src/content/docs/components/accordion.mdx new file mode 100644 index 000000000000..e8df6d88b625 --- /dev/null +++ b/site/src/content/docs/components/accordion.mdx @@ -0,0 +1,240 @@ +--- +title: Accordion +description: Build vertically collapsing accordions in combination with our Collapse JavaScript plugin. +aliases: + - "/components/" + - "/docs/[[config:docs_version]]/components/" +toc: true +--- + +## How it works + +The accordion uses [collapse]([[docsref:/components/collapse]]) internally to make it collapsible. + + + +## Example + +Click the accordions below to expand/collapse the accordion content. + +To render an accordion that’s expanded by default: +- add the `.show` class on the `.accordion-collapse` element. +- drop the `.collapsed` class from the `.accordion-button` element and set its `aria-expanded` attribute to `true`. + + +
    +

    + +

    +
    +
    + This is the first item’s accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It’s also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
    +
    +
    +
    +

    + +

    +
    +
    + This is the second item’s accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It’s also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
    +
    +
    +
    +

    + +

    +
    +
    + This is the third item’s accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It’s also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
    +
    +
    + `} /> + +### Flush + +Add `.accordion-flush` to remove some borders and rounded corners to render accordions edge-to-edge with their parent container. + + +
    +

    + +

    +
    +
    Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class. This is the first item’s accordion body.
    +
    +
    +
    +

    + +

    +
    +
    Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class. This is the second item’s accordion body. Let’s imagine this being filled with some actual content.
    +
    +
    +
    +

    + +

    +
    +
    Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class. This is the third item’s accordion body. Nothing more exciting happening here in terms of content, but just filling up the space to make it look, at least at first glance, a bit more representative of how this would look in a real-world application.
    +
    +
    + `} /> + +### Always open + +Omit the `data-bs-parent` attribute on each `.accordion-collapse` to make accordion items stay open when another item is opened. + + +
    +

    + +

    +
    +
    + This is the first item’s accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It’s also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
    +
    +
    +
    +

    + +

    +
    +
    + This is the second item’s accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It’s also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
    +
    +
    +
    +

    + +

    +
    +
    + This is the third item’s accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It’s also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. +
    +
    +
    + `} /> + +## Accessibility + +Please read the [collapse accessibility section]([[docsref:/components/collapse#accessibility]]) for more information. + +## CSS + +### Variables + + + +As part of Bootstrap’s evolving CSS variables approach, accordions now use local CSS variables on `.accordion` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. + + + +### Sass variables + + + +## Usage + +The collapse plugin utilizes a few classes to handle the heavy lifting: + +- `.collapse` hides the content +- `.collapse.show` shows the content +- `.collapsing` is added when the transition starts, and removed when it finishes + +These classes can be found in `_transitions.scss`. + +### Via data attributes + +Just add `data-bs-toggle="collapse"` and a `data-bs-target` to the element to automatically assign control of one or more collapsible elements. The `data-bs-target` attribute accepts a CSS selector to apply the collapse to. Be sure to add the class `collapse` to the collapsible element. If you’d like it to default open, add the additional class `show`. + +To add accordion group management to a collapsible area, add the data attribute `data-bs-parent="#selector"`. + +### Via JavaScript + +Enable manually with: + +```js +const accordionCollapseElementList = document.querySelectorAll('#myAccordion .collapse') +const accordionCollapseList = [...accordionCollapseElementList].map(accordionCollapseEl => new bootstrap.Collapse(accordionCollapseEl)) +``` + +### Options + + + + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +`parent` | selector, DOM element | `null` | If parent is provided, then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior - this is dependent on the `card` class). The attribute has to be set on the target collapsible area. | +`toggle` | boolean | `true` | Toggles the collapsible element on invocation. | + + +### Methods + + + +Activates your content as a collapsible element. Accepts an optional options `object`. + +You can create a collapse instance with the constructor, for example: + +```js +const bsCollapse = new bootstrap.Collapse('#myCollapse', { + toggle: false +}) +``` + + +| Method | Description | +| --- | --- | +| `dispose` | Destroys an element’s collapse. (Removes stored data on the DOM element) | +| `getInstance` | Static method which allows you to get the collapse instance associated to a DOM element, you can use it like this: `bootstrap.Collapse.getInstance(element)`. | +| `getOrCreateInstance` | Static method which returns a collapse instance associated to a DOM element or create a new one in case it wasn’t initialized. You can use it like this: `bootstrap.Collapse.getOrCreateInstance(element)`. | +| `hide` | Hides a collapsible element. **Returns to the caller before the collapsible element has actually been hidden** (e.g., before the `hidden.bs.collapse` event occurs). | +| `show` | Shows a collapsible element. **Returns to the caller before the collapsible element has actually been shown** (e.g., before the `shown.bs.collapse` event occurs). | +| `toggle` | Toggles a collapsible element to shown or hidden. **Returns to the caller before the collapsible element has actually been shown or hidden** (i.e. before the `shown.bs.collapse` or `hidden.bs.collapse` event occurs). | + + +### Events + +Bootstrap’s collapse class exposes a few events for hooking into collapse functionality. + + +| Event type | Description | +| --- | --- | +| `hide.bs.collapse` | This event is fired immediately when the `hide` method has been called. | +| `hidden.bs.collapse` | This event is fired when a collapse element has been hidden from the user (will wait for CSS transitions to complete). | +| `show.bs.collapse` | This event fires immediately when the `show` instance method is called. | +| `shown.bs.collapse` | This event is fired when a collapse element has been made visible to the user (will wait for CSS transitions to complete). | + + +```js +const myCollapsible = document.getElementById('myCollapsible') +myCollapsible.addEventListener('hidden.bs.collapse', event => { + // do something... +}) +``` diff --git a/site/src/content/docs/components/alerts.mdx b/site/src/content/docs/components/alerts.mdx new file mode 100644 index 000000000000..e25604462b26 --- /dev/null +++ b/site/src/content/docs/components/alerts.mdx @@ -0,0 +1,218 @@ +--- +title: Alerts +description: Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. +toc: true +--- + +import { getData } from '@libs/data' + +## Examples + +Alerts are available for any length of text, as well as an optional close button. For proper styling, use one of the eight **required** contextual classes (e.g., `.alert-success`). For inline dismissal, use the [alerts JavaScript plugin](#dismissing). + + +**Heads up!** As of v5.3.0, the `alert-variant()` Sass mixin is deprecated. Alert variants now have their CSS variables overridden in [a Sass loop](#sass-loops). + + + ``)} /> + + + +### Live example + +Click the button below to show an alert (hidden with inline styles to start), then dismiss (and destroy) it with the built-in close button. + + +`} /> + +We use the following JavaScript to trigger our live alert demo: + + + +### Link color + +Use the `.alert-link` utility class to quickly provide matching colored links within any alert. + + ``)} /> + +### Additional content + +Alerts can also contain additional HTML elements like headings, paragraphs and dividers. + + +

    Well done!

    +

    Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.

    +
    +

    Whenever you need to, be sure to use margin utilities to keep things nice and tidy.

    + `} /> + +### Icons + +Similarly, you can use [flexbox utilities]([[docsref:/utilities/flex]]) and [Bootstrap Icons]([[config:icons]]) to create alerts with icons. Depending on your icons and content, you may want to add more utilities or custom styles. + + + + + +
    + An example alert with an icon +
    + `} /> + +Need more than one icon for your alerts? Consider using more Bootstrap Icons and making a local SVG sprite like so to easily reference the same icons repeatedly. + + + + + + + + + + + + + + + + + `} /> + +### Dismissing + +Using the alert JavaScript plugin, it’s possible to dismiss any alert inline. Here’s how: + +- Be sure you’ve loaded the alert plugin, or the compiled Bootstrap JavaScript. +- Add a [close button]([[docsref:/components/close-button]]) and the `.alert-dismissible` class, which adds extra padding to the right of the alert and positions the close button. +- On the close button, add the `data-bs-dismiss="alert"` attribute, which triggers the JavaScript functionality. Be sure to use the ` + `} /> + + +When an alert is dismissed, the element is completely removed from the page structure. If a keyboard user dismisses the alert using the close button, their focus will suddenly be lost and, depending on the browser, reset to the start of the page/document. For this reason, we recommend including additional JavaScript that listens for the `closed.bs.alert` event and programmatically sets `focus()` to the most appropriate location in the page. If you’re planning to move focus to a non-interactive element that normally does not receive focus, make sure to add `tabindex="-1"` to the element. + + +## CSS + +### Variables + + + +As part of Bootstrap’s evolving CSS variables approach, alerts now use local CSS variables on `.alert` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. + + + +### Sass variables + + + +### Sass mixins + + + + + +### Sass loops + +Loop that generates the modifier classes with an overriding of CSS variables. + + + +## JavaScript behavior + +### Initialize + +Initialize elements as alerts + +```js +const alertList = document.querySelectorAll('.alert') +const alerts = [...alertList].map(element => new bootstrap.Alert(element)) +``` + + +For the sole purpose of dismissing an alert, it isn’t necessary to initialize the component manually via the JS API. By making use of `data-bs-dismiss="alert"`, the component will be initialized automatically and properly dismissed. + +See the [triggers](#triggers) section for more details. + + +### Triggers + + + +**Note that closing an alert will remove it from the DOM.** + +### Methods + +You can create an alert instance with the alert constructor, for example: + +```js +const bsAlert = new bootstrap.Alert('#myAlert') +``` + +This makes an alert listen for click events on descendant elements which have the `data-bs-dismiss="alert"` attribute. (Not necessary when using the data-api’s auto-initialization.) + + +| Method | Description | +| --- | --- | +| `close` | Closes an alert by removing it from the DOM. If the `.fade` and `.show` classes are present on the element, the alert will fade out before it is removed. | +| `dispose` | Destroys an element’s alert. (Removes stored data on the DOM element) | +| `getInstance` | Static method which allows you to get the alert instance associated to a DOM element. For example: `bootstrap.Alert.getInstance(alert)`. | +| `getOrCreateInstance` | Static method which returns an alert instance associated to a DOM element or create a new one in case it wasn’t initialized. You can use it like this: `bootstrap.Alert.getOrCreateInstance(element)`. | + + +Basic usage: + +```js +const alert = bootstrap.Alert.getOrCreateInstance('#myAlert') +alert.close() +``` + +### Events + +Bootstrap’s alert plugin exposes a few events for hooking into alert functionality. + + +| Event | Description | +| --- | --- | +| `close.bs.alert` | Fires immediately when the `close` instance method is called. | +| `closed.bs.alert` | Fired when the alert has been closed and CSS transitions have completed. | + + +```js +const myAlert = document.getElementById('myAlert') +myAlert.addEventListener('closed.bs.alert', event => { + // do something, for instance, explicitly move focus to the most appropriate element, + // so it doesn’t get lost/reset to the start of the page + // document.getElementById('...').focus() +}) +``` diff --git a/site/src/content/docs/components/badge.mdx b/site/src/content/docs/components/badge.mdx new file mode 100644 index 000000000000..b3e574b6d899 --- /dev/null +++ b/site/src/content/docs/components/badge.mdx @@ -0,0 +1,83 @@ +--- +title: Badges +description: Documentation and examples for badges, our small count and labeling component. +toc: true +--- + +import { getData } from '@libs/data' + +## Examples + +Badges scale to match the size of the immediate parent element by using relative font sizing and `em` units. As of v5, badges no longer have focus or hover styles for links. + +### Headings + +Example heading New +

    Example heading New

    +

    Example heading New

    +

    Example heading New

    +
    Example heading New
    +
    Example heading New
    `} /> + +### Buttons + +Badges can be used as part of links or buttons to provide a counter. + + + Notifications 4 + `} /> + +Note that depending on how they are used, badges may be confusing for users of screen readers and similar assistive technologies. While the styling of badges provides a visual cue as to their purpose, these users will simply be presented with the content of the badge. Depending on the specific situation, these badges may seem like random additional words or numbers at the end of a sentence, link, or button. + +Unless the context is clear (as with the “Notifications” example, where it is understood that the “4” is the number of notifications), consider including additional context with a visually hidden piece of additional text. + +### Positioned + +Use utilities to modify a `.badge` and position it in the corner of a link or button. + + + Inbox + + 99+ + unread messages + + `} /> + +You can also replace the `.badge` class with a few more utilities without a count for a more generic indicator. + + + Profile + + New alerts + + `} /> + +## Background colors + + + +Set a `background-color` with contrasting foreground `color` with [our `.text-bg-{color}` helpers]([[docsref:helpers/color-background]]). Previously it was required to manually pair your choice of [`.text-{color}`]([[docsref:/utilities/colors]]) and [`.bg-{color}`]([[docsref:/utilities/background]]) utilities for styling, which you still may use if you prefer. + + `${themeColor.title}`)} /> + + + +## Pill badges + +Use the `.rounded-pill` utility class to make badges more rounded with a larger `border-radius`. + + `${themeColor.title}`)} /> + +## CSS + +### Variables + + + +As part of Bootstrap’s evolving CSS variables approach, badges now use local CSS variables on `.badge` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. + + + +### Sass variables + + diff --git a/site/src/content/docs/components/breadcrumb.mdx b/site/src/content/docs/components/breadcrumb.mdx new file mode 100644 index 000000000000..50cceb1cc190 --- /dev/null +++ b/site/src/content/docs/components/breadcrumb.mdx @@ -0,0 +1,98 @@ +--- +title: Breadcrumb +description: Indicate the current page’s location within a navigational hierarchy that automatically adds separators via CSS. +toc: true +--- + +## Example + +Use an ordered or unordered list with linked list items to create a minimally styled breadcrumb. Use our utilities to add additional styles as desired. + + + + + + + + `} /> + +## Dividers + +Dividers are automatically added in CSS through [`::before`](https://developer.mozilla.org/en-US/docs/Web/CSS/::before) and [`content`](https://developer.mozilla.org/en-US/docs/Web/CSS/content). They can be changed by modifying a local CSS custom property `--bs-breadcrumb-divider`, or through the `$breadcrumb-divider` Sass variable — and `$breadcrumb-divider-flipped` for its RTL counterpart, if needed. We default to our Sass variable, which is set as a fallback to the custom property. This way, you get a global divider that you can override without recompiling CSS at any time. + + + + `} /> + +When modifying via Sass, the [quote](https://sass-lang.com/documentation/modules/string/#quote) function is required to generate the quotes around a string. For example, using `>` as the divider, you can use this: + +```scss +$breadcrumb-divider: quote(">"); +``` + +It’s also possible to use an **embedded SVG icon**. Apply it via our CSS custom property, or use the Sass variable. + + +**Inlined SVG requires properly escaped characters.** Some reserved characters, such as `<`, `>` and `#`, must be URL-encoded or escaped. We do this with the `$breadcrumb-divider` variable using our [`escape-svg()` Sass function]([[docsref:/customize/sass#escape-svg]]). When customizing the CSS variable, you must handle this yourself. Read [Kevin Weber’s explanations on CodePen](https://codepen.io/kevinweber/pen/dXWoRw ) for more info. + + + + + `} /> + +```scss +$breadcrumb-divider: url("data:image/svg+xml,"); +``` + +You can also remove the divider setting `--bs-breadcrumb-divider: '';` (empty strings in CSS custom properties counts as a value), or setting the Sass variable to `$breadcrumb-divider: none;`. + + + + `} /> + + +```scss +$breadcrumb-divider: none; +``` + +## Accessibility + +Since breadcrumbs provide a navigation, it’s a good idea to add a meaningful label such as `aria-label="breadcrumb"` to describe the type of navigation provided in the ``} /> + +## Directions + + +**Directions are flipped in RTL mode.** As such, `.dropstart` will appear on the right side. + + +### Centered + +Make the dropdown menu centered below the toggle with `.dropdown-center` on the parent element. + + + + + `} /> + +### Dropup + +Trigger dropdown menus above elements by adding `.dropup` to the parent element. + + + + + +
    + + + +
    `} /> + +```html + +
    + + +
    + + +
    + + + +
    +``` + +### Dropup centered + +Make the dropup menu centered above the toggle with `.dropup-center` on the parent element. + + + + + `} /> + +### Dropend + +Trigger dropdown menus at the right of the elements by adding `.dropend` to the parent element. + + + + + +
    + + + +
    `} /> + +```html + +
    + + +
    + + +
    + + + +
    +``` + +### Dropstart + +Trigger dropdown menus at the left of the elements by adding `.dropstart` to the parent element. + + + + + +
    + + + +
    `} /> + +```html + +
    + + +
    + + +
    + + + +
    +``` + +## Menu items + +You can use `` or ` + + `} /> + +You can also create non-interactive dropdown items with `.dropdown-item-text`. Feel free to style further with custom CSS or text utilities. + + +
  • Dropdown item text
  • +
  • Action
  • +
  • Another action
  • +
  • Something else here
  • + `} /> + +### Active + +Add `.active` to items in the dropdown to **style them as active**. To convey the active state to assistive technologies, use the `aria-current` attribute — using the `page` value for the current page, or `true` for the current item in a set. + + +
  • Regular link
  • +
  • Active link
  • +
  • Another link
  • + `} /> + +### Disabled + +Add `.disabled` to items in the dropdown to **style them as disabled**. + + +
  • Regular link
  • +
  • Disabled link
  • +
  • Another link
  • + `} /> + +## Menu alignment + +By default, a dropdown menu is automatically positioned 100% from the top and along the left side of its parent. You can change this with the directional `.drop*` classes, but you can also control them with additional modifier classes. + +Add `.dropdown-menu-end` to a `.dropdown-menu` to right align the dropdown menu. Directions are mirrored when using Bootstrap in RTL, meaning `.dropdown-menu-end` will appear on the left side. + + +**Heads up!** Dropdowns are positioned thanks to Popper except when they are contained in a navbar. + + + + + + `} /> + +### Responsive alignment + +If you want to use responsive alignment, disable dynamic positioning by adding the `data-bs-display="static"` attribute and use the responsive variation classes. + +To align **right** the dropdown menu with the given breakpoint or larger, add `.dropdown-menu{-sm|-md|-lg|-xl|-xxl}-end`. + + + + + `} /> + +To align **left** the dropdown menu with the given breakpoint or larger, add `.dropdown-menu-end` and `.dropdown-menu{-sm|-md|-lg|-xl|-xxl}-start`. + + + + + `} /> + +Note that you don’t need to add a `data-bs-display="static"` attribute to dropdown buttons in navbars, since Popper isn’t used in navbars. + +### Alignment options + +Taking most of the options shown above, here’s a small kitchen sink demo of various dropdown alignment options in one place. + + + + + + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    `} /> + +## Menu content + +### Headers + +Add a header to label sections of actions in any dropdown menu. + + +
  • +
  • Action
  • +
  • Another action
  • + `} /> + +### Dividers + +Separate groups of related menu items with a divider. + + +
  • Action
  • +
  • Another action
  • +
  • Something else here
  • +
  • +
  • Separated link
  • + `} /> + +### Text + +Place any freeform text within a dropdown menu with text and use [spacing utilities]([[docsref:/utilities/spacing]]). Note that you’ll likely need additional sizing styles to constrain the menu width. + + +

    + Some example text that’s free-flowing within the dropdown menu. +

    +

    + And this is more example text. +

    + `} /> + +### Forms + +Put a form within a dropdown menu, or make it into a dropdown menu, and use [margin or padding utilities]([[docsref:/utilities/spacing]]) to give it the negative space you require. + + +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + +
    + + New around here? Sign up + Forgot password? + `} /> + + + + + `} /> + +## Dropdown options + +Use `data-bs-offset` or `data-bs-reference` to change the location of the dropdown. + + + +
    + + + +
    + `} /> + +### Auto close behavior + +By default, the dropdown menu is closed when clicking inside or outside the dropdown menu. You can use the `autoClose` option to change this behavior of the dropdown. + + + + + + +
    + + +
    + +
    + + +
    + +
    + + +
    `} /> + +## CSS + +### Variables + + + +As part of Bootstrap’s evolving CSS variables approach, dropdowns now use local CSS variables on `.dropdown-menu` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. + + + + +Dropdown items include at least one variable that is not set on `.dropdown`. This allows you to provide a new value while Bootstrap defaults to a fallback value. + +- `--bs-dropdown-item-border-radius` + + +Customization through CSS variables can be seen on the `.dropdown-menu-dark` class where we override specific values without adding duplicate CSS selectors. + + + +### Sass variables + +Variables for all dropdowns: + + + +Variables for the [dark dropdown](#dark-dropdowns): + + + +Variables for the CSS-based carets that indicate a dropdown’s interactivity: + + + +### Sass mixins + +Mixins are used to generate the CSS-based carets and can be found in `scss/mixins/_caret.scss`. + + + +## Usage + +Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the `.show` class on the parent `.dropdown-menu`. The `data-bs-toggle="dropdown"` attribute is relied on for closing dropdown menus at an application level, so it’s a good idea to always use it. + + +On touch-enabled devices, opening a dropdown adds empty `mouseover` handlers to the immediate children of the `` element. This admittedly ugly hack is necessary to work around a [quirk in iOs’ event delegation](https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html), which would otherwise prevent a tap anywhere outside of the dropdown from triggering the code that closes the dropdown. Once the dropdown is closed, these additional empty `mouseover` handlers are removed. + + +### Via data attributes + +Add `data-bs-toggle="dropdown"` to a link or button to toggle a dropdown. + +```html + +``` + +### Via JavaScript + + +Dropdowns must have `data-bs-toggle="dropdown"` on their trigger element, regardless of whether you call your dropdown via JavaScript or use the data-api. + + +Call the dropdowns via JavaScript: + +```js +const dropdownElementList = document.querySelectorAll('.dropdown-toggle') +const dropdownList = [...dropdownElementList].map(dropdownToggleEl => new bootstrap.Dropdown(dropdownToggleEl)) +``` + +### Options + + + + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `autoClose` | boolean, string | `true` | Configure the auto close behavior of the dropdown:
    • `true` - the dropdown will be closed by clicking outside or inside the dropdown menu.
    • `false` - the dropdown will be closed by clicking the toggle button and manually calling `hide` or `toggle` method. (Also will not be closed by pressing Esc key)
    • `'inside'` - the dropdown will be closed (only) by clicking inside the dropdown menu.
    • `'outside'` - the dropdown will be closed (only) by clicking outside the dropdown menu.
    Note: the dropdown can always be closed with the Esc key. | +| `boundary` | string, element | `'clippingParents'` | Overflow constraint boundary of the dropdown menu (applies only to Popper’s preventOverflow modifier). By default it’s `clippingParents` and can accept an HTMLElement reference (via JavaScript only). For more information refer to Popper’s [detectOverflow docs](https://popper.js.org/docs/v2/utils/detect-overflow/#boundary). | +| `display` | string | `'dynamic'` | By default, we use Popper for dynamic positioning. Disable this with `static`. | +| `offset` | array, string, function | `[0, 2]` | Offset of the dropdown relative to its target. You can pass a string in data attributes with comma separated values like: `data-bs-offset="10,20"`. When a function is used to determine the offset, it is called with an object containing the popper placement, the reference, and popper rects as its first argument. The triggering element DOM node is passed as the second argument. The function must return an array with two numbers: [skidding](https://popper.js.org/docs/v2/modifiers/offset/#skidding-1), [distance](https://popper.js.org/docs/v2/modifiers/offset/#distance-1). For more information refer to Popper’s [offset docs](https://popper.js.org/docs/v2/modifiers/offset/#options). | +| `popperConfig` | null, object, function | `null` | To change Bootstrap’s default Popper config, see [Popper’s configuration](https://popper.js.org/docs/v2/constructors/#options). When a function is used to create the Popper configuration, it’s called with an object that contains the Bootstrap’s default Popper configuration. It helps you use and merge the default with your own configuration. The function must return a configuration object for Popper. | +| `reference` | string, element, object | `'toggle'` | Reference element of the dropdown menu. Accepts the values of `'toggle'`, `'parent'`, an HTMLElement reference or an object providing `getBoundingClientRect`. For more information refer to Popper’s [constructor docs](https://popper.js.org/docs/v2/constructors/#createpopper) and [virtual element docs](https://popper.js.org/docs/v2/virtual-elements/). | +
    + +#### Using function with `popperConfig` + +```js +const dropdown = new bootstrap.Dropdown(element, { + popperConfig(defaultBsPopperConfig) { + // const newPopperConfig = {...} + // use defaultBsPopperConfig if needed... + // return newPopperConfig + } +}) +``` + +### Methods + + +| Method | Description | +| --- | --- | +| `dispose` | Destroys an element’s dropdown. (Removes stored data on the DOM element) | +| `getInstance` | Static method which allows you to get the dropdown instance associated to a DOM element, you can use it like this: `bootstrap.Dropdown.getInstance(element)`. | +| `getOrCreateInstance` | Static method which returns a dropdown instance associated to a DOM element or create a new one in case it wasn’t initialized. You can use it like this: `bootstrap.Dropdown.getOrCreateInstance(element)`. | +| `hide` | Hides the dropdown menu of a given navbar or tabbed navigation. | +| `show` | Shows the dropdown menu of a given navbar or tabbed navigation. | +| `toggle` | Toggles the dropdown menu of a given navbar or tabbed navigation. | +| `update` | Updates the position of an element’s dropdown. | + + +### Events + +All dropdown events are fired at the toggling element and then bubbled up. So you can also add event listeners on the `.dropdown-menu`’s parent element. `hide.bs.dropdown` and `hidden.bs.dropdown` events have a `clickEvent` property (only when the original Event type is `click`) that contains an Event Object for the click event. + + +| Event type | Description | +| --- | --- | +| `hide.bs.dropdown` | Fires immediately when the `hide` instance method has been called. | +| `hidden.bs.dropdown` | Fired when the dropdown has finished being hidden from the user and CSS transitions have completed. | +| `show.bs.dropdown` | Fires immediately when the `show` instance method is called. | +| `shown.bs.dropdown` | Fired when the dropdown has been made visible to the user and CSS transitions have completed. | + + +```js +const myDropdown = document.getElementById('myDropdown') +myDropdown.addEventListener('show.bs.dropdown', event => { + // do something... +}) +``` diff --git a/site/src/content/docs/components/list-group.mdx b/site/src/content/docs/components/list-group.mdx new file mode 100644 index 000000000000..59827ddd41bb --- /dev/null +++ b/site/src/content/docs/components/list-group.mdx @@ -0,0 +1,448 @@ +--- +title: List group +description: List groups are a flexible and powerful component for displaying a series of content. Modify and extend them to support just about any content within. +toc: true +--- + +import { getData } from '@libs/data' + +## Basic example + +The most basic list group is an unordered list with list items and the proper classes. Build upon it with the options that follow, or with your own CSS as needed. + + +
  • An item
  • +
  • A second item
  • +
  • A third item
  • +
  • A fourth item
  • +
  • And a fifth one
  • + `} /> + +## Active items + +Add `.active` to a `.list-group-item` to indicate the current active selection. + + +
  • An active item
  • +
  • A second item
  • +
  • A third item
  • +
  • A fourth item
  • +
  • And a fifth one
  • + `} /> + +## Links and buttons + +Use ``s or ` + + + + + `} /> + +## Flush + +Add `.list-group-flush` to remove some borders and rounded corners to render list group items edge-to-edge in a parent container (e.g., cards). + + +
  • An item
  • +
  • A second item
  • +
  • A third item
  • +
  • A fourth item
  • +
  • And a fifth one
  • + `} /> + +## Numbered + +Add the `.list-group-numbered` modifier class (and optionally use an `
      ` element) to opt into numbered list group items. Numbers are generated via CSS (as opposed to a `
        `s default browser styling) for better placement inside list group items and to allow for better customization. + +Numbers are generated by `counter-reset` on the `
          `, and then styled and placed with a `::before` pseudo-element on the `
        1. ` with `counter-increment` and `content`. + + +
        2. A list item
        3. +
        4. A list item
        5. +
        6. A list item
        7. +
        `} /> + +These work great with custom content as well. + + +
      1. +
        +
        Subheading
        + Content for list item +
        + 14 +
      2. +
      3. +
        +
        Subheading
        + Content for list item +
        + 14 +
      4. +
      5. +
        +
        Subheading
        + Content for list item +
        + 14 +
      6. +
      `} /> + +## Horizontal + +Add `.list-group-horizontal` to change the layout of list group items from vertical to horizontal across all breakpoints. Alternatively, choose a responsive variant `.list-group-horizontal-{sm|md|lg|xl|xxl}` to make a list group horizontal starting at that breakpoint’s `min-width`. Currently **horizontal list groups cannot be combined with flush list groups.** + +**ProTip:** Want equal-width list group items when horizontal? Add `.flex-fill` to each list group item. + + `
        +
      • An item
      • +
      • A second item
      • +
      • A third item
      • +
      `)} /> + +## Variants + + +**Heads up!** As of v5.3.0, the `list-group-item-variant()` Sass mixin is deprecated. List group item variants now have their CSS variables overridden in [a Sass loop](#sass-loops). + + +Use contextual classes to style list items with a stateful background and color. + + +
    1. A simple default list group item
    2. + `, + ...getData('theme-colors').map((themeColor) => `
    3. A simple ${themeColor.name} list group item
    4. `), + `` + ]} /> + +### For links and buttons + +Contextual classes also work with `.list-group-item-action` for `
      ` and ` + + + + + + + + +```html + +``` + + +In the above static example, we use `
      `, to avoid issues with the heading hierarchy in the documentation page. Structurally, however, a modal dialog represents its own separate document/context, so the `.modal-title` should ideally be an `

      `. If necessary, you can use the [font size utilities]([[docsref:/utilities/text#font-size]]) to control the heading’s appearance. All the following live examples use this approach. + + +### Live demo + +Toggle a working modal demo by clicking the button below. It will slide down and fade in from the top of the page. + + + +
      + +
      + +```html + + + + + +``` + +### Static backdrop + +When backdrop is set to static, the modal will not close when clicking outside of it. Click the button below to try it. + + + +
      + +
      + +```html + + + + + +``` + +### Scrolling long content + +When modals become too long for the user’s viewport or device, they scroll independent of the page itself. Try the demo below to see what we mean. + + + +
      + +
      + +You can also create a scrollable modal that allows scrolling the modal body by adding `.modal-dialog-scrollable` to `.modal-dialog`. + + + +
      + +
      + +```html + + +``` + +### Vertically centered + +Add `.modal-dialog-centered` to `.modal-dialog` to vertically center the modal. + +

      `} /> + +## Display headings + +Traditional heading elements are designed to work best in the meat of your page content. When you need a heading to stand out, consider using a **display heading**—a larger, slightly more opinionated heading style. + +
      +
      Display 1
      +
      Display 2
      +
      Display 3
      +
      Display 4
      +
      Display 5
      +
      Display 6
      +
      + +```html +

      Display 1

      +

      Display 2

      +

      Display 3

      +

      Display 4

      +

      Display 5

      +

      Display 6

      +``` + +Display headings are configured via the `$display-font-sizes` Sass map and two variables, `$display-font-weight` and `$display-line-height`. + +Display headings are customizable via two variables, `$display-font-family` and `$display-font-style`. + + + +## Lead + +Make a paragraph stand out by adding `.lead`. + + + This is a lead paragraph. It stands out from regular paragraphs. +

      `} /> + +## Inline text elements + +Styling for common inline HTML5 elements. + +You can use the mark tag to highlight text.

      +

      This line of text is meant to be treated as deleted text.

      +

      This line of text is meant to be treated as no longer accurate.

      +

      This line of text is meant to be treated as an addition to the document.

      +

      This line of text will render as underlined.

      +

      This line of text is meant to be treated as fine print.

      +

      This line rendered as bold text.

      +

      This line rendered as italicized text.

      `} /> + +Beware that those tags should be used for semantic purpose: + +- `` represents text which is marked or highlighted for reference or notation purposes. +- `` represents side-comments and small print, like copyright and legal text. +- `` represents element that are no longer relevant or no longer accurate. +- `` represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation. + +If you want to style your text, you should use the following classes instead: + +- `.mark` will apply the same styles as ``. +- `.small` will apply the same styles as ``. +- `.text-decoration-underline` will apply the same styles as ``. +- `.text-decoration-line-through` will apply the same styles as ``. + +While not shown above, feel free to use `` and `` in HTML5. `` is meant to highlight words or phrases without conveying additional importance, while `` is mostly for voice, technical terms, etc. + +## Text utilities + +Change text alignment, transform, style, weight, line-height, decoration and color with our [text utilities]([[docsref:/utilities/text]]) and [color utilities]([[docsref:/utilities/colors]]). + +## Abbreviations + +Stylized implementation of HTML’s `` element for abbreviations and acronyms to show the expanded version on hover. Abbreviations have a default underline and gain a help cursor to provide additional context on hover and to users of assistive technologies. + +Add `.initialism` to an abbreviation for a slightly smaller font-size. + +attr

      +

      HTML

      `} /> + +## Blockquotes + +For quoting blocks of content from another source within your document. Wrap `
      ` around any HTML as the quote. + + +

      A well-known quote, contained in a blockquote element.

      +
      `} /> + +### Naming a source + +The HTML spec requires that blockquote attribution be placed outside the `
      `. When providing attribution, wrap your `
      ` in a `
      ` and use a `
      ` or a block level element (e.g., `

      `) with the `.blockquote-footer` class. Be sure to wrap the name of the source work in `` as well. + + +

      +

      A well-known quote, contained in a blockquote element.

      +
      + +
      `} /> + +### Alignment + +Use text utilities as needed to change the alignment of your blockquote. + + +
      +

      A well-known quote, contained in a blockquote element.

      +
      + + `} /> + + +
      +

      A well-known quote, contained in a blockquote element.

      +
      + + `} /> + +## Lists + +### Unstyled + +Remove the default `list-style` and left margin on list items (immediate children only). **This only applies to immediate children list items**, meaning you will need to add the class for any nested lists as well. + + +
    5. This is a list.
    6. +
    7. It appears completely unstyled.
    8. +
    9. Structurally, it’s still a list.
    10. +
    11. However, this style only applies to immediate child elements.
    12. +
    13. Nested lists: +
        +
      • are unaffected by this style
      • +
      • will still show a bullet
      • +
      • and have appropriate left margin
      • +
      +
    14. +
    15. This may still come in handy in some situations.
    16. + `} /> + +### Inline + +Remove a list’s bullets and apply some light `margin` with a combination of two classes, `.list-inline` and `.list-inline-item`. + + +
    17. This is a list item.
    18. +
    19. And another one.
    20. +
    21. But they’re displayed inline.
    22. + `} /> + +### Description list alignment + +Align terms and descriptions horizontally by using our grid system’s predefined classes (or semantic mixins). For longer terms, you can optionally add a `.text-truncate` class to truncate the text with an ellipsis. + + +
      Description lists
      +
      A description list is perfect for defining terms.
      + +
      Term
      +
      +

      Definition for the term.

      +

      And some more placeholder definition text.

      +
      + +
      Another term
      +
      This definition is short, so no extra paragraphs or anything.
      + +
      Truncated term is truncated
      +
      This can be useful when space is tight. Adds an ellipsis at the end.
      + +
      Nesting
      +
      +
      +
      Nested definition list
      +
      I heard you like definition lists. Let me put a definition list inside your definition list.
      +
      +
      + `} /> + +## Responsive font sizes + +In Bootstrap 5, we’ve enabled responsive font sizes by default, allowing text to scale more naturally across device and viewport sizes. Have a look at the [RFS page]([[docsref:/getting-started/rfs]]) to find out how this works. + +## CSS + +### Sass variables + +Headings have some dedicated variables for sizing and spacing. + + + +Miscellaneous typography elements covered here and in [Reboot]([[docsref:/content/reboot]]) also have dedicated variables. + + + +### Sass mixins + +There are no dedicated mixins for typography, but Bootstrap does use [Responsive Font Sizing (RFS)]([[docsref:/getting-started/rfs]]). diff --git a/site/src/content/docs/customize/color-modes.mdx b/site/src/content/docs/customize/color-modes.mdx new file mode 100644 index 000000000000..79dd7f6a437e --- /dev/null +++ b/site/src/content/docs/customize/color-modes.mdx @@ -0,0 +1,253 @@ +--- +title: Color modes +description: Bootstrap now supports color modes, or themes, as of v5.3.0. Explore our default light color mode and the new dark mode, or create your own using our styles as your template. +toc: true +added: + version: "5.3" +--- + +import { getDocsRelativePath } from '@libs/path' + + +**Try it yourself!** Download the source code and working demo for using Bootstrap with Stylelint, and the color modes from the [twbs/examples repository](https://github.com/twbs/examples/tree/main/color-modes). You can also [open the example in StackBlitz](https://stackblitz.com/github/twbs/examples/tree/main/color-modes?file=index.html). + + +## Dark mode + +**Bootstrap now supports color modes, starting with dark mode!** With v5.3.0 you can implement your own color mode toggler (see below for an example from Bootstrap’s docs) and apply the different color modes as you see fit. We support a light mode (default) and now dark mode. Color modes can be toggled globally on the `` element, or on specific components and elements, thanks to the `data-bs-theme` attribute. + +Alternatively, you can also switch to a media query implementation thanks to our color mode mixin—see [the usage section for details](#building-with-sass). Heads up though—this eliminates your ability to change themes on a per-component basis as shown below. + +## Example + +For example, to change the color mode of a dropdown menu, add `data-bs-theme="light"` or `data-bs-theme="dark"` to the parent `.dropdown`. Now, no matter the global color mode, these dropdowns will display with the specified theme value. + + + + + + + `} /> + +## How it works + +- As shown above, color mode styles are controlled by the `data-bs-theme` attribute. This attribute can be applied to the `` element, or to any other element or Bootstrap component. If applied to the `` element, it will apply to everything. If applied to a component or element, it will be scoped to that specific component or element. + +- For each color mode you wish to support, you’ll need to add new overrides for the shared global CSS variables. We do this already in our `_root.scss` stylesheet for dark mode, with light mode being the default values. In writing color mode specific styles, use the mixin: + + ```scss + // Color mode variables in _root.scss + @include color-mode(dark) { + // CSS variable overrides here... + } + ``` + +- We use a custom `_variables-dark.scss` to power those shared global CSS variable overrides for dark mode. This file isn’t required for your own custom color modes, but it’s required for our dark mode for two reasons. First, it’s better to have a single place to reset global colors. Second, some Sass variables had to be overridden for background images embedded in our CSS for accordions, form components, and more. + +## Usage + +### Enable dark mode + +Enable the built in dark color mode across your entire project by adding the `data-bs-theme="dark"` attribute to the `` element. This will apply the dark color mode to all components and elements, other than those with a specific `data-bs-theme` attribute applied. Building on the [quick start template]([[docsref:/getting-started/introduction#quick-start]]): + +```html + + + + + + Bootstrap demo + + + +

      Hello, world!

      + + + +``` + +Bootstrap does not yet ship with a built-in color mode picker, but you can use the one from our own documentation if you like. [Learn more in the JavaScript section.](#javascript) + +### Building with Sass + +Our new dark mode option is available to use for all users of Bootstrap, but it’s controlled via data attributes instead of media queries and does not automatically toggle your project’s color mode. You can disable our dark mode entirely via Sass by changing `$enable-dark-mode` to `false`. + +We use a custom Sass mixin, `color-mode()`, to help you control _how_ color modes are applied. By default, we use a `data` attribute approach, allowing you to create more user-friendly experiences where your visitors can choose to have an automatic dark mode or control their preference (like in our own docs here). This is also an easy and scalable way to add different themes and more custom color modes beyond light and dark. + +In case you want to use media queries and only make color modes automatic, you can change the mixin’s default type via Sass variable. Consider the following snippet and its compiled CSS output. + +```scss +$color-mode-type: data; + +@include color-mode(dark) { + .element { + color: var(--bs-primary-text-emphasis); + background-color: var(--bs-primary-bg-subtle); + } +} +``` + +Outputs to: + +```css +[data-bs-theme=dark] .element { + color: var(--bs-primary-text-emphasis); + background-color: var(--bs-primary-bg-subtle); +} +``` + +And when setting to `media-query`: + +```scss +$color-mode-type: media-query; + +@include color-mode(dark) { + .element { + color: var(--bs-primary-text-emphasis); + background-color: var(--bs-primary-bg-subtle); + } +} +``` + +Outputs to: + +```css +@media (prefers-color-scheme: dark) { + .element { + color: var(--bs-primary-text-emphasis); + background-color: var(--bs-primary-bg-subtle); + } +} +``` + +## Custom color modes + +While the primary use case for color modes is light and dark mode, custom color modes are also possible. Create your own `data-bs-theme` selector with a custom value as the name of your color mode, then modify our Sass and CSS variables as needed. We opted to create a separate `_variables-dark.scss` stylesheet to house Bootstrap’s dark mode specific Sass variables, but that’s not required for you. + +For example, you can create a “blue theme” with the selector `data-bs-theme="blue"`. In your custom Sass or CSS file, add the new selector and override any global or component CSS variables as needed. If you’re using Sass, you can also use Sass’s functions within your CSS variable overrides. + + + + +
      Example blue theme
      +

      Some paragraph text to show how the blue theme might look with written copy.

      + +
      + + +`} /> + +```html +
      + ... +
      +``` + +## JavaScript + +To allow visitors or users to toggle color modes, you’ll need to create a toggle element to control the `data-bs-theme` attribute on the root element, ``. We’ve built a toggler in our documentation that initially defers to a user’s current system color mode, but provides an option to override that and pick a specific color mode. + +Here’s a look at the JavaScript that powers it. Feel free to inspect our own documentation navbar to see how it’s implemented using HTML and CSS from our own components. It is suggested to include the JavaScript at the top of your page to reduce potential screen flickering during reloading of your site. Note that if you decide to use media queries for your color modes, your JavaScript may need to be modified or removed if you prefer an implicit control. + + + +## Adding theme colors + +Adding a new color in `$theme-colors` is not enough for some of our components like [alerts]([[docsref:/components/alerts]]) and [list groups]([[docsref:/components/list-group]]). New colors must also be defined in `$theme-colors-text`, `$theme-colors-bg-subtle`, and `$theme-colors-border-subtle` for light theme; but also in `$theme-colors-text-dark`, `$theme-colors-bg-subtle-dark`, and `$theme-colors-border-subtle-dark` for dark theme. + +This is a manual process because Sass cannot generate its own Sass variables from an existing variable or map. In future versions of Bootstrap, we'll revisit this setup to reduce the duplication. + +```scss +// Required +@import "functions"; +@import "variables"; +@import "variables-dark"; + +// Add a custom color to $theme-colors +$custom-colors: ( + "custom-color": #712cf9 +); +$theme-colors: map-merge($theme-colors, $custom-colors); + +@import "maps"; +@import "mixins"; +@import "utilities"; + +// Add a custom color to new theme maps + +// Light mode +$custom-colors-text: ("custom-color": #712cf9); +$custom-colors-bg-subtle: ("custom-color": #e1d2fe); +$custom-colors-border-subtle: ("custom-color": #bfa1fc); + +$theme-colors-text: map-merge($theme-colors-text, $custom-colors-text); +$theme-colors-bg-subtle: map-merge($theme-colors-bg-subtle, $custom-colors-bg-subtle); +$theme-colors-border-subtle: map-merge($theme-colors-border-subtle, $custom-colors-border-subtle); + +// Dark mode +$custom-colors-text-dark: ("custom-color": #e1d2f2); +$custom-colors-bg-subtle-dark: ("custom-color": #8951fa); +$custom-colors-border-subtle-dark: ("custom-color": #e1d2f2); + +$theme-colors-text-dark: map-merge($theme-colors-text-dark, $custom-colors-text-dark); +$theme-colors-bg-subtle-dark: map-merge($theme-colors-bg-subtle-dark, $custom-colors-bg-subtle-dark); +$theme-colors-border-subtle-dark: map-merge($theme-colors-border-subtle-dark, $custom-colors-border-subtle-dark); + +// Remainder of Bootstrap imports +@import "root"; +@import "reboot"; +// etc +``` + +## CSS + +### Variables + +Dozens of root level CSS variables are repeated as overrides for dark mode. These are scoped to the color mode selector, which defaults to `data-bs-theme` but [can be configured](#building-with-sass) to use a `prefers-color-scheme` media query. Use these variables as a guideline for generating your own new color modes. + + + +### Sass variables + +CSS variables for our dark color mode are partially generated from dark mode specific Sass variables in `_variables-dark.scss`. This also includes some custom overrides for changing the colors of embedded SVGs used throughout our components. + + + +### Sass mixins + +Styles for dark mode, and any custom color modes you create, can be scoped appropriately to the `data-bs-theme` attribute selector or media query with the customizable `color-mode()` mixin. See the [Sass usage section](#building-with-sass) for more details. + + diff --git a/site/src/content/docs/customize/color.mdx b/site/src/content/docs/customize/color.mdx new file mode 100644 index 000000000000..b24f14d6b0ea --- /dev/null +++ b/site/src/content/docs/customize/color.mdx @@ -0,0 +1,513 @@ +--- +title: Color +description: Bootstrap is supported by an extensive color system that themes our styles and components. This enables more comprehensive customization and extension for any project. +toc: true +--- + +import { getData } from '@libs/data' +import { getSequence } from '@libs/utils' + +## Colors + + + +Bootstrap’s color palette has continued to expand and become more nuanced in v5.3.0. We’ve added new variables for `secondary` and `tertiary` text and background colors, plus `{color}-bg-subtle`, `{color}-border-subtle`, and `{color}-text-emphasis` for our theme colors. These new colors are available through Sass and CSS variables (but not our color maps or utility classes) with the express goal of making it easier to customize across multiple colors modes like light and dark. These new variables are globally set on `:root` and are adapted for our new dark color mode while our original theme colors remain unchanged. + +Colors ending in `-rgb` provide the `red, green, blue` values for use in `rgb()` and `rgba()` color modes. For example, `rgba(var(--bs-secondary-bg-rgb), .5)`. + + +**Heads up!** There’s some potential confusion with our new secondary and tertiary colors, and our existing secondary theme color, as well as our light and dark theme colors. Expect this to be ironed out in v6. + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      DescriptionSwatchVariables
      + **Body —** Default foreground (color) and background, including components. + +
       
      +
      + `--bs-body-color`
      `--bs-body-color-rgb` +
      +
       
      +
      + `--bs-body-bg`
      `--bs-body-bg-rgb` +
      + **Secondary —** Use the `color` option for lighter text. Use the `bg` option for dividers and to indicate disabled component states. + +
       
      +
      + `--bs-secondary-color`
      `--bs-secondary-color-rgb` +
      +
       
      +
      + `--bs-secondary-bg`
      `--bs-secondary-bg-rgb` +
      + **Tertiary —** Use the `color` option for even lighter text. Use the `bg` option to style backgrounds for hover states, accents, and wells. + +
       
      +
      + `--bs-tertiary-color`
      `--bs-tertiary-color-rgb` +
      +
       
      +
      + `--bs-tertiary-bg`
      `--bs-tertiary-bg-rgb` +
      + **Emphasis —** For higher contrast text. Not applicable for backgrounds. + +
       
      +
      + `--bs-emphasis-color`
      `--bs-emphasis-color-rgb` +
      + **Border —** For component borders, dividers, and rules. Use `--bs-border-color-translucent` to blend with backgrounds with an `rgba()` value. + +
       
      +
      + `--bs-border-color`
      `--bs-border-color-rgb` +
      + **Primary —** Main theme color, used for hyperlinks, focus styles, and component and form active states. + +
       
      +
      + `--bs-primary`
      `--bs-primary-rgb` +
      +
       
      +
      + `--bs-primary-bg-subtle` +
      +
       
      +
      + `--bs-primary-border-subtle` +
      +
      Text
      +
      + `--bs-primary-text-emphasis` +
      + **Success —** Theme color used for positive or successful actions and information. + +
       
      +
      + `--bs-success`
      `--bs-success-rgb` +
      +
       
      +
      + `--bs-success-bg-subtle` +
      +
       
      +
      + `--bs-success-border-subtle` +
      +
      Text
      +
      + `--bs-success-text-emphasis` +
      + **Danger —** Theme color used for errors and dangerous actions. + +
       
      +
      + `--bs-danger`
      `--bs-danger-rgb` +
      +
       
      +
      + `--bs-danger-bg-subtle` +
      +
       
      +
      + `--bs-danger-border-subtle` +
      +
      Text
      +
      + `--bs-danger-text-emphasis` +
      + **Warning —** Theme color used for non-destructive warning messages. + +
       
      +
      + `--bs-warning`
      `--bs-warning-rgb` +
      +
       
      +
      + `--bs-warning-bg-subtle` +
      +
       
      +
      + `--bs-warning-border-subtle` +
      +
      Text
      +
      + `--bs-warning-text-emphasis` +
      + **Info —** Theme color used for neutral and informative content. + +
       
      +
      + `--bs-info`
      `--bs-info-rgb` +
      +
       
      +
      + `--bs-info-bg-subtle` +
      +
       
      +
      + `--bs-info-border-subtle` +
      +
      Text
      +
      + `--bs-info-text-emphasis` +
      + **Light —** Additional theme option for less contrasting colors. + +
       
      +
      + `--bs-light`
      `--bs-light-rgb` +
      +
       
      +
      + `--bs-light-bg-subtle` +
      +
       
      +
      + `--bs-light-border-subtle` +
      +
      Text
      +
      + `--bs-light-text-emphasis` +
      + **Dark —** Additional theme option for higher contrasting colors. + +
       
      +
      + `--bs-dark`
      `--bs-dark-rgb` +
      +
       
      +
      + `--bs-dark-bg-subtle` +
      +
       
      +
      + `--bs-dark-border-subtle` +
      +
      Text
      +
      + `--bs-dark-text-emphasis` +
      +
      + +### Using the new colors + +These new colors are accessible via CSS variables and utility classes—like `--bs-primary-bg-subtle` and `.bg-primary-subtle`—allowing you to compose your own CSS rules with the variables, or to quickly apply styles via classes. The utilities are built with the color’s associated CSS variables, and since we customize those CSS variables for dark mode, they are also adaptive to color mode by default. + + + Example element with utilities + `} /> + +### Theme colors + +We use a subset of all colors to create a smaller color palette for generating color schemes, also available as Sass variables and a Sass map in Bootstrap’s `scss/_variables.scss` file. + +
      + {getData('theme-colors').map((themeColor) => { + return ( +
      +
      {themeColor.title}
      +
      + ) + })} +
      + +All these colors are available as a Sass map, `$theme-colors`. + + + +Check out [our Sass maps and loops docs]([[docsref:/customize/sass#maps-and-loops]]) for how to modify these colors. + +### All colors + +All Bootstrap colors are available as Sass variables and a Sass map in `scss/_variables.scss` file. To avoid increased file sizes, we don’t create text or background color classes for each of these variables. Instead, we choose a subset of these colors for a [theme palette](#theme-colors). + +Be sure to monitor contrast ratios as you customize colors. As shown below, we’ve added three contrast ratios to each of the main colors—one for the swatch’s current colors, one for against white, and one for against black. + +
      + {getData('colors').map((color) => { + if ((color.name !== "white") && (color.name !== "gray") && (color.name !== "gray-dark")) { + return ( +
      +
      + ${color.name} + {color.hex} +
      + + {getSequence(100, 900, 100).map((value) => { + return ( +
      ${color.name}-{value}
      + ) + })} +
      + ) + } + })} + +
      +
      $gray-500#adb5bd
      + {getData('grays').map((gray) => { + return ( +
      $gray-{gray.name}
      + ) + })} +
      + +
      +
      + $black + #000 +
      +
      + $white + #fff +
      +
      +
      + +### Notes on Sass + +Sass cannot programmatically generate variables, so we manually created variables for every tint and shade ourselves. We specify the midpoint value (e.g., `$blue-500`) and use custom color functions to tint (lighten) or shade (darken) our colors via Sass’s `mix()` color function. + +Using `mix()` is not the same as `lighten()` and `darken()`—the former blends the specified color with white or black, while the latter only adjusts the lightness value of each color. The result is a much more complete suite of colors, as [shown in this CodePen demo](https://codepen.io/emdeoh/pen/zYOQOPB). + +Our `tint-color()` and `shade-color()` functions use `mix()` alongside our `$theme-color-interval` variable, which specifies a stepped percentage value for each mixed color we produce. See the `scss/_functions.scss` and `scss/_variables.scss` files for the full source code. + +## Color Sass maps + +Bootstrap’s source Sass files include three maps to help you quickly and easily loop over a list of colors and their hex values. + +- `$colors` lists all our available base (`500`) colors +- `$theme-colors` lists all semantically named theme colors (shown below) +- `$grays` lists all tints and shades of gray + +Within `scss/_variables.scss`, you’ll find Bootstrap’s color variables and Sass map. Here’s an example of the `$colors` Sass map: + + + +Add, remove, or modify values within the map to update how they’re used in many other components. Unfortunately at this time, not _every_ component utilizes this Sass map. Future updates will strive to improve upon this. Until then, plan on making use of the `${color}` variables and this Sass map. + +### Example + +Here’s how you can use these in your Sass: + +```scss +.alpha { color: $purple; } +.beta { + color: $yellow-300; + background-color: $indigo-900; +} +``` + +[Color]([[docsref:/utilities/colors]]) and [background]([[docsref:/utilities/background]]) utility classes are also available for setting `color` and `background-color` using the `500` color values. + +## Generating utilities + + + +Bootstrap doesn’t include `color` and `background-color` utilities for every color variable, but you can generate these yourself with our [utility API]([[docsref:/utilities/api]]) and our extended Sass maps added in v5.1.0. + +1. To start, make sure you’ve imported our functions, variables, mixins, and utilities. +2. Use our `map-merge-multiple()` function to quickly merge multiple Sass maps together in a new map. +3. Merge this new combined map to extend any utility with a `{color}-{level}` class name. + +Here’s an example that generates text color utilities (e.g., `.text-purple-500`) using the above steps. + +```scss +@import "bootstrap/scss/functions"; +@import "bootstrap/scss/variables"; +@import "bootstrap/scss/variables-dark"; +@import "bootstrap/scss/maps"; +@import "bootstrap/scss/mixins"; +@import "bootstrap/scss/utilities"; + +$all-colors: map-merge-multiple($blues, $indigos, $purples, $pinks, $reds, $oranges, $yellows, $greens, $teals, $cyans); + +$utilities: map-merge( + $utilities, + ( + "color": map-merge( + map-get($utilities, "color"), + ( + values: map-merge( + map-get(map-get($utilities, "color"), "values"), + ( + $all-colors + ), + ), + ), + ), + ) +); + +@import "bootstrap/scss/utilities/api"; +``` + +This will generate new `.text-{color}-{level}` utilities for every color and level. You can do the same for any other utility and property as well. diff --git a/site/src/content/docs/customize/components.mdx b/site/src/content/docs/customize/components.mdx new file mode 100644 index 000000000000..2aa7e8554f5b --- /dev/null +++ b/site/src/content/docs/customize/components.mdx @@ -0,0 +1,75 @@ +--- +title: Components +description: Learn how and why we build nearly all our components responsively and with base and modifier classes. +toc: true +--- + +## Base classes + +Bootstrap’s components are largely built with a base-modifier nomenclature. We group as many shared properties as possible into a base class, like `.btn`, and then group individual styles for each variant into modifier classes, like `.btn-primary` or `.btn-success`. + +To build our modifier classes, we use Sass’s `@each` loops to iterate over a Sass map. This is especially helpful for generating variants of a component by our `$theme-colors` and creating responsive variants for each breakpoint. As you customize these Sass maps and recompile, you’ll automatically see your changes reflected in these loops. + +Check out [our Sass maps and loops docs]([[docsref:/customize/sass#maps-and-loops]]) for how to customize these loops and extend Bootstrap’s base-modifier approach to your own code. + +## Modifiers + +Many of Bootstrap’s components are built with a base-modifier class approach. This means the bulk of the styling is contained to a base class (e.g., `.btn`) while style variations are confined to modifier classes (e.g., `.btn-danger`). These modifier classes are built from the `$theme-colors` map to make customizing the number and name of our modifier classes. + +Here are two examples of how we loop over the `$theme-colors` map to generate modifiers to the `.alert` and `.list-group` components. + + + + + +## Responsive + +These Sass loops aren’t limited to color maps, either. You can also generate responsive variations of your components. Take for example our responsive alignment of the dropdowns where we mix an `@each` loop for the `$grid-breakpoints` Sass map with a media query include. + + + +Should you modify your `$grid-breakpoints`, your changes will apply to all the loops iterating over that map. + + + +For more information and examples on how to modify our Sass maps and variables, please refer to [the CSS section of the Grid documentation]([[docsref:/layout/grid#css]]). + +## Creating your own + +We encourage you to adopt these guidelines when building with Bootstrap to create your own components. We’ve extended this approach ourselves to the custom components in our documentation and examples. Components like our callouts are built just like our provided components with base and modifier classes. + +
      +
      + This is a callout. We built it custom for our docs so our messages to you stand out. It has three variants via modifier classes. +
      +
      + +```html +
      ...
      +``` + +In your CSS, you’d have something like the following where the bulk of the styling is done via `.callout`. Then, the unique styles between each variant is controlled via modifier class. + +```scss +// Base class +.callout {} + +// Modifier classes +.callout-info {} +.callout-warning {} +.callout-danger {} +``` + +For the callouts, that unique styling is just a `border-left-color`. When you combine that base class with one of those modifier classes, you get your complete component family: + + +**This is an info callout.** Example text to show it in action. + + + +**This is a warning callout.** Example text to show it in action. + + + +**This is a danger callout.** Example text to show it in action. + diff --git a/site/src/content/docs/customize/css-variables.mdx b/site/src/content/docs/customize/css-variables.mdx new file mode 100644 index 000000000000..20a0b9d44fab --- /dev/null +++ b/site/src/content/docs/customize/css-variables.mdx @@ -0,0 +1,70 @@ +--- +title: CSS variables +description: Use Bootstrap’s CSS custom properties for fast and forward-looking design and development. +toc: true +--- + +Bootstrap includes many [CSS custom properties (variables)](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) in its compiled CSS for real-time customization without the need to recompile Sass. These provide easy access to commonly used values like our theme colors, breakpoints, and primary font stacks when working in your browser’s inspector, a code sandbox, or general prototyping. + +**All our custom properties are prefixed with `bs-`** to avoid conflicts with third party CSS. + +## Root variables + +Here are the variables we include (note that the `:root` is required) that can be accessed anywhere Bootstrap’s CSS is loaded. They’re located in our `_root.scss` file and included in our compiled dist files. + +### Default + +These CSS variables are available everywhere, regardless of color mode. + + + +### Dark mode + +These variables are scoped to our built-in dark mode. + + + +## Component variables + +Bootstrap 5 is increasingly making use of custom properties as local variables for various components. This way we reduce our compiled CSS, ensure styles aren’t inherited in places like nested tables, and allow some basic restyling and extending of Bootstrap components after Sass compilation. + +Have a look at our table documentation for some [insight into how we’re using CSS variables]([[docsref:/content/tables#how-do-the-variants-and-accented-tables-work]]). Our [navbars also use CSS variables]([[docsref:/components/navbar#css]]) as of v5.2.0. We’re also using CSS variables across our grids—primarily for gutters the [new opt-in CSS grid]([[docsref:/layout/css-grid]])—with more component usage coming in the future. + +Whenever possible, we'll assign CSS variables at the base component level (e.g., `.navbar` for navbar and its sub-components). This reduces guessing on where and how to customize, and allows for easy modifications by our team in future updates. + +## Prefix + +Most CSS variables use a prefix to avoid collisions with your own codebase. This prefix is in addition to the `--` that’s required on every CSS variable. + +Customize the prefix via the `$prefix` Sass variable. By default, it’s set to `bs-` (note the trailing dash). + +## Examples + +CSS variables offer similar flexibility to Sass’s variables, but without the need for compilation before being served to the browser. For example, here we’re resetting our page’s font and link styles with CSS variables. + +```css +body { + font: 1rem/1.5 var(--bs-font-sans-serif); +} +a { + color: var(--bs-blue); +} +``` + +## Focus variables + + + +Bootstrap provides custom `:focus` styles using a combination of Sass and CSS variables that can be optionally added to specific components and elements. We do not yet globally override all `:focus` styles. + +In our Sass, we set default values that can be customized before compiling. + + + +Those variables are then reassigned to `:root` level CSS variables that can be customized in real-time, including with options for `x` and `y` offsets (which default to their fallback value of `0`). + + + +## Grid breakpoints + +While we include our grid breakpoints as CSS variables (except for `xs`), be aware that **CSS variables do not work in media queries**. This is by design in the CSS spec for variables, but may change in coming years with support for `env()` variables. Check out [this Stack Overflow answer](https://stackoverflow.com/a/47212942) for some helpful links. In the meantime, you can use these variables in other CSS situations, as well as in your JavaScript. diff --git a/site/src/content/docs/customize/optimize.mdx b/site/src/content/docs/customize/optimize.mdx new file mode 100644 index 000000000000..0384ca0509ac --- /dev/null +++ b/site/src/content/docs/customize/optimize.mdx @@ -0,0 +1,88 @@ +--- +title: Optimize +description: Keep your projects lean, responsive, and maintainable so you can deliver the best experience and focus on more important jobs. +toc: true +--- + +## Lean Sass imports + +When using Sass in your asset pipeline, make sure you optimize Bootstrap by only `@import`ing the components you need. Your largest optimizations will likely come from the `Layout & Components` section of our `bootstrap.scss`. + + + + +If you’re not using a component, comment it out or delete it entirely. For example, if you’re not using the carousel, remove that import to save some file size in your compiled CSS. Keep in mind there are some dependencies across Sass imports that may make it more difficult to omit a file. + +## Lean JavaScript + +Bootstrap’s JavaScript includes every component in our primary dist files (`bootstrap.js` and `bootstrap.min.js`), and even our primary dependency (Popper) with our bundle files (`bootstrap.bundle.js` and `bootstrap.bundle.min.js`). While you’re customizing via Sass, be sure to remove related JavaScript. + +For instance, assuming you’re using your own JavaScript bundler like Webpack, Parcel, or Vite, you’d only import the JavaScript you plan on using. In the example below, we show how to just include our modal JavaScript: + +```js +// Import just what we need + +// import 'bootstrap/js/dist/alert'; +// import 'bootstrap/js/dist/button'; +// import 'bootstrap/js/dist/carousel'; +// import 'bootstrap/js/dist/collapse'; +// import 'bootstrap/js/dist/dropdown'; +import 'bootstrap/js/dist/modal'; +// import 'bootstrap/js/dist/offcanvas'; +// import 'bootstrap/js/dist/popover'; +// import 'bootstrap/js/dist/scrollspy'; +// import 'bootstrap/js/dist/tab'; +// import 'bootstrap/js/dist/toast'; +// import 'bootstrap/js/dist/tooltip'; +``` + +This way, you’re not including any JavaScript you don’t intend to use for components like buttons, carousels, and tooltips. If you’re importing dropdowns, tooltips or popovers, be sure to list the Popper dependency in your `package.json` file. + + +**Heads up!** Files in `bootstrap/js/dist` use the **default export**. To use them, do the following: + +```js +import Modal from 'bootstrap/js/dist/modal' +const modal = new Modal(document.getElementById('myModal')) +``` + + +## Autoprefixer .browserslistrc + +Bootstrap depends on Autoprefixer to automatically add browser prefixes to certain CSS properties. Prefixes are dictated by our `.browserslistrc` file, found in the root of the Bootstrap repo. Customizing this list of browsers and recompiling the Sass will automatically remove some CSS from your compiled CSS, if there are vendor prefixes unique to that browser or version. + +## Unused CSS + +_Help wanted with this section, please consider opening a PR. Thanks!_ + +While we don’t have a prebuilt example for using [PurgeCSS](https://github.com/FullHuman/purgecss) with Bootstrap, there are some helpful articles and walkthroughs that the community has written. Here are some options: + +- https://medium.com/dwarves-foundation/remove-unused-css-styles-from-bootstrap-using-purgecss-88395a2c5772 +- https://lukelowrey.com/automatically-removeunused-css-from-bootstrap-or-other-frameworks/ + +Lastly, this [CSS Tricks article on unused CSS](https://css-tricks.com/how-do-you-remove-unused-css-from-a-site/) shows how to use PurgeCSS and other similar tools. + +## Minify and gzip + +Whenever possible, be sure to compress all the code you serve to your visitors. If you’re using Bootstrap dist files, try to stick to the minified versions (indicated by the `.min.css` and `.min.js` extensions). If you’re building Bootstrap from the source with your own build system, be sure to implement your own minifiers for HTML, CSS, and JS. + +## Non-blocking files + +While minifying and using compression might seem like enough, making your files non-blocking ones is also a big step in making your site well-optimized and fast enough. + +If you are using a [Lighthouse](https://developer.chrome.com/docs/lighthouse/overview/) plugin in Google Chrome, you may have stumbled over FCP. [The First Contentful Paint](https://web.dev/articles/fcp) metric measures the time from when the page starts loading to when any part of the page’s content is rendered on the screen. + +You can improve FCP by deferring non-critical JavaScript or CSS. What does that mean? Simply, JavaScript or stylesheets that don’t need to be present on the first paint of your page should be marked with `async` or `defer` attributes. + +This ensures that the less important resources are loaded later and not blocking the first paint. On the other hand, critical resources can be included as inline scripts or styles. + +If you want to learn more about this, there are already a lot of great articles about it: + +- https://developer.chrome.com/docs/lighthouse/performance/render-blocking-resources/ +- https://web.dev/articles/defer-non-critical-css + +## Always use HTTPS + +Your website should only be available over HTTPS connections in production. HTTPS improves the security, privacy, and availability of all sites, and [there is no such thing as non-sensitive web traffic](https://https.cio.gov/everything/). The steps to configure your website to be served exclusively over HTTPS vary widely depending on your architecture and web hosting provider, and thus are beyond the scope of these docs. + +Sites served over HTTPS should also access all stylesheets, scripts, and other assets over HTTPS connections. Otherwise, you’ll be sending users [mixed active content](https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content), leading to potential vulnerabilities where a site can be compromised by altering a dependency. This can lead to security issues and in-browser warnings displayed to users. Whether you’re getting Bootstrap from a CDN or serving it yourself, ensure that you only access it over HTTPS connections. diff --git a/site/src/content/docs/customize/options.mdx b/site/src/content/docs/customize/options.mdx new file mode 100644 index 000000000000..926ae03122d9 --- /dev/null +++ b/site/src/content/docs/customize/options.mdx @@ -0,0 +1,31 @@ +--- +title: Options +description: Quickly customize Bootstrap with built-in variables to easily toggle global CSS preferences for controlling style and behavior. +--- + +Customize Bootstrap with our built-in custom variables file and easily toggle global CSS preferences with new `$enable-*` Sass variables. Override a variable’s value and recompile with `npm run test` as needed. + +You can find and customize these variables for key global options in Bootstrap’s `scss/_variables.scss` file. + + +| Variable | Values | Description | +| ------------------------------ | ---------------------------------- | -------------------------------------------------------------------------------------- | +| `$spacer` | `1rem` (default), or any value > 0 | Specifies the default spacer value to programmatically generate our [spacer utilities]([[docsref:/utilities/spacing]]). | +| `$enable-dark-mode` | `true` (default) or `false` | Enables built-in [dark mode support]([[docsref:/customize/color-modes#dark-mode]]) across the project and its components. | +| `$enable-rounded` | `true` (default) or `false` | Enables predefined `border-radius` styles on various components. | +| `$enable-shadows` | `true` or `false` (default) | Enables predefined decorative `box-shadow` styles on various components. Does not affect `box-shadow`s used for focus states. | +| `$enable-gradients` | `true` or `false` (default) | Enables predefined gradients via `background-image` styles on various components. | +| `$enable-transitions` | `true` (default) or `false` | Enables predefined `transition`s on various components. | +| `$enable-reduced-motion` | `true` (default) or `false` | Enables the [`prefers-reduced-motion` media query]([[docsref:/getting-started/accessibility#reduced-motion]]), which suppresses certain animations/transitions based on the users’ browser/operating system preferences. | +| `$enable-grid-classes` | `true` (default) or `false` | Enables the generation of CSS classes for the grid system (e.g. `.row`, `.col-md-1`, etc.). | +| `$enable-cssgrid` | `true` or `false` (default) | Enables the experimental CSS Grid system (e.g. `.grid`, `.g-col-md-1`, etc.). | +| `$enable-container-classes` | `true` (default) or `false` | Enables the generation of CSS classes for layout containers. (New in v5.2.0) | +| `$enable-caret` | `true` (default) or `false` | Enables pseudo element caret on `.dropdown-toggle`. | +| `$enable-button-pointers` | `true` (default) or `false` | Add “hand” cursor to non-disabled button elements. | +| `$enable-rfs` | `true` (default) or `false` | Globally enables [RFS]([[docsref:/getting-started/rfs]]). | +| `$enable-validation-icons` | `true` (default) or `false` | Enables `background-image` icons within textual inputs and some custom forms for validation states. | +| `$enable-negative-margins` | `true` or `false` (default) | Enables the generation of [negative margin utilities]([[docsref:/utilities/spacing#negative-margin]]). | +| `$enable-deprecation-messages` | `true` (default) or `false` | Set to `false` to hide warnings when using any of the deprecated mixins and functions that are planned to be removed in `v6`. | +| `$enable-important-utilities` | `true` (default) or `false` | Enables the `!important` suffix in utility classes. | +| `$enable-smooth-scroll` | `true` (default) or `false` | Applies `scroll-behavior: smooth` globally, except for users asking for reduced motion through [`prefers-reduced-motion` media query]([[docsref:/getting-started/accessibility#reduced-motion]]) | + diff --git a/site/src/content/docs/customize/overview.mdx b/site/src/content/docs/customize/overview.mdx new file mode 100644 index 000000000000..7acb624ea606 --- /dev/null +++ b/site/src/content/docs/customize/overview.mdx @@ -0,0 +1,51 @@ +--- +title: Customize +description: Learn how to theme, customize, and extend Bootstrap with Sass, a boatload of global options, an expansive color system, and more. +toc: false +aliases: "/docs/[[config:docs_version]]/customize/" +sections: + - title: Sass + description: Utilize our source Sass files to take advantage of variables, maps, mixins, and functions. + - title: Options + description: Customize Bootstrap with built-in variables to easily toggle global CSS preferences. + - title: Color + description: Learn about and customize the color systems that support the entire toolkit. + - title: Color modes + description: Explore our default light mode and the new dark mode, or create custom color modes yourself. + - title: Components + description: Learn how we build nearly all our components responsively and with base and modifier classes. + - title: CSS variables + description: Use Bootstrap’s CSS custom properties for fast and forward-looking design and development. + - title: Optimize + description: Keep your projects lean, responsive, and maintainable so you can deliver the best experience. +--- + +## Overview + +There are multiple ways to customize Bootstrap. Your best path can depend on your project, the complexity of your build tools, the version of Bootstrap you’re using, browser support, and more. + +Our two preferred methods are: + +1. Using Bootstrap [via package manager]([[docsref:/getting-started/download#package-managers]]) so you can use and extend our source files. +2. Using Bootstrap’s compiled distribution files or [jsDelivr]([[docsref:/getting-started/download#cdn-via-jsdelivr]]) so you can add onto or override Bootstrap’s styles. + +While we cannot go into details here on how to use every package manager, we can give some guidance on [using Bootstrap with your own Sass compiler]([[docsref:/customize/sass]]). + +For those who want to use the distribution files, review the [getting started page]([[docsref:/getting-started/introduction]]) for how to include those files and an example HTML page. From there, consult the docs for the layout, components, and behaviors you’d like to use. + +As you familiarize yourself with Bootstrap, continue exploring this section for more details on how to utilize our global options, making use of and changing our color system, how we build our components, how to use our growing list of CSS custom properties, and how to optimize your code when building with Bootstrap. + +## CSPs and embedded SVGs + +Several Bootstrap components include embedded SVGs in our CSS to style components consistently and easily across browsers and devices. **For organizations with more strict CSP configurations**, we’ve documented all instances of our embedded SVGs (all of which are applied via `background-image`) so you can more thoroughly review your options. + +- [Accordion]([[docsref:/components/accordion]]) +- [Carousel controls]([[docsref:/components/carousel#with-controls]]) +- [Close button]([[docsref:/components/close-button]]) (used in alerts and modals) +- [Form checkboxes and radio buttons]([[docsref:/forms/checks-radios]]) +- [Form switches]([[docsref:/forms/checks-radios#switches]]) +- [Form validation icons]([[docsref:/forms/validation#server-side]]) +- [Navbar toggle buttons]([[docsref:/components/navbar#responsive-behaviors]]) +- [Select menus]([[docsref:/forms/select]]) + +Based on [community conversation](https://github.com/twbs/bootstrap/issues/25394), some options for addressing this in your own codebase include [replacing the URLs with locally hosted assets]([[docsref:/getting-started/webpack#extracting-svg-files]]), removing the images and using inline images (not possible in all components), and modifying your CSP. Our recommendation is to carefully review your own security policies and decide on the best path forward, if necessary. diff --git a/site/src/content/docs/customize/sass.mdx b/site/src/content/docs/customize/sass.mdx new file mode 100644 index 000000000000..6352de40250b --- /dev/null +++ b/site/src/content/docs/customize/sass.mdx @@ -0,0 +1,363 @@ +--- +title: Sass +description: Utilize our source Sass files to take advantage of variables, maps, mixins, and functions to help you build faster and customize your project. +toc: true +--- + +Utilize our source Sass files to take advantage of variables, maps, mixins, and more. + + +Sass deprecation warnings are shown when compiling source Sass files with the latest versions of Dart Sass. This does not prevent compilation or usage of Bootstrap. We’re [working on a long-term fix]([[config:repo]]/issues/40962), but in the meantime these deprecation notices can be ignored. + + +## File structure + +Whenever possible, avoid modifying Bootstrap’s core files. For Sass, that means creating your own stylesheet that imports Bootstrap so you can modify and extend it. Assuming you’re using a package manager like npm, you’ll have a file structure that looks like this: + +```text +your-project/ +├── scss/ +│ └── custom.scss +└── node_modules/ +│ └── bootstrap/ +│ ├── js/ +│ └── scss/ +└── index.html +``` + +If you’ve downloaded our source files and aren’t using a package manager, you’ll want to manually create something similar to that structure, keeping Bootstrap’s source files separate from your own. + +```text +your-project/ +├── scss/ +│ └── custom.scss +├── bootstrap/ +│ ├── js/ +│ └── scss/ +└── index.html +``` + +## Importing + +In your `custom.scss`, you’ll import Bootstrap’s source Sass files. You have two options: include all of Bootstrap, or pick the parts you need. We encourage the latter, though be aware there are some requirements and dependencies across our components. You also will need to include some JavaScript for our plugins. + +```scss +// Custom.scss +// Option A: Include all of Bootstrap + +// Include any default variable overrides here (though functions won’t be available) + +@import "../node_modules/bootstrap/scss/bootstrap"; + +// Then add additional custom code here +``` + +```scss +// Custom.scss +// Option B: Include parts of Bootstrap + +// 1. Include functions first (so you can manipulate colors, SVGs, calc, etc) +@import "../node_modules/bootstrap/scss/functions"; + +// 2. Include any default variable overrides here + +// 3. Include remainder of required Bootstrap stylesheets (including any separate color mode stylesheets) +@import "../node_modules/bootstrap/scss/variables"; +@import "../node_modules/bootstrap/scss/variables-dark"; + +// 4. Include any default map overrides here + +// 5. Include remainder of required parts +@import "../node_modules/bootstrap/scss/maps"; +@import "../node_modules/bootstrap/scss/mixins"; +@import "../node_modules/bootstrap/scss/root"; + +// 6. Include any other optional stylesheet partials as desired; list below is not inclusive of all available stylesheets +@import "../node_modules/bootstrap/scss/utilities"; +@import "../node_modules/bootstrap/scss/reboot"; +@import "../node_modules/bootstrap/scss/type"; +@import "../node_modules/bootstrap/scss/images"; +@import "../node_modules/bootstrap/scss/containers"; +@import "../node_modules/bootstrap/scss/grid"; +@import "../node_modules/bootstrap/scss/helpers"; +// ... + +// 7. Optionally include utilities API last to generate classes based on the Sass map in `_utilities.scss` +@import "../node_modules/bootstrap/scss/utilities/api"; + +// 8. Add additional custom code here +``` + +With that setup in place, you can begin to modify any of the Sass variables and maps in your `custom.scss`. You can also start to add parts of Bootstrap under the `// Optional` section as needed. We suggest using the full import stack from our `bootstrap.scss` file as your starting point. + +## Compiling + +In order to use your custom Sass code as CSS in the browser, you need a Sass compiler. Sass ships as a CLI package, but you can also compile it with other build tools like [Gulp](https://gulpjs.com/) or [Webpack](https://webpack.js.org/), or with GUI applications. Some IDEs also have Sass compilers built in or as downloadable extensions. + +We like to use the CLI to compile our Sass, but you can use whichever method you prefer. From the command line, run the following: + +```sh +# Install Sass globally +npm install -g sass + +# Watch your custom Sass for changes and compile it to CSS +sass --watch ./scss/custom.scss ./css/custom.css +``` + +Learn more about your options at [sass-lang.com/install](https://sass-lang.com/install/) and [compiling with VS Code](https://code.visualstudio.com/docs/languages/css#_transpiling-sass-and-less-into-css). + + +**Using Bootstrap with another build tool?** Consider reading our guides for compiling with [Webpack]([[docsref:/getting-started/webpack]]), [Parcel]([[docsref:/getting-started/parcel]]), or [Vite]([[docsref:/getting-started/vite]]). We also have production-ready demos in [our examples repository on GitHub](https://github.com/twbs/examples). + + +## Including + +Once your CSS is compiled, you can include it in your HTML files. Inside your `index.html` you’ll want to include your compiled CSS file. Be sure to update the path to your compiled CSS file if you’ve changed it. + +```html + + + + + + Custom Bootstrap + + + +

      Hello, world!

      + + +``` + +## Variable defaults + +Every Sass variable in Bootstrap includes the `!default` flag allowing you to override the variable’s default value in your own Sass without modifying Bootstrap’s source code. Copy and paste variables as needed, modify their values, and remove the `!default` flag. If a variable has already been assigned, then it won’t be re-assigned by the default values in Bootstrap. + +You will find the complete list of Bootstrap’s variables in `scss/_variables.scss`. Some variables are set to `null`, these variables don’t output the property unless they are overridden in your configuration. + +Variable overrides must come after our functions are imported, but before the rest of the imports. + +Here’s an example that changes the `background-color` and `color` for the `` when importing and compiling Bootstrap via npm: + +```scss +// Required +@import "../node_modules/bootstrap/scss/functions"; + +// Default variable overrides +$body-bg: #000; +$body-color: #111; + +// Required +@import "../node_modules/bootstrap/scss/variables"; +@import "../node_modules/bootstrap/scss/variables-dark"; +@import "../node_modules/bootstrap/scss/maps"; +@import "../node_modules/bootstrap/scss/mixins"; +@import "../node_modules/bootstrap/scss/root"; + +// Optional Bootstrap components here +@import "../node_modules/bootstrap/scss/reboot"; +@import "../node_modules/bootstrap/scss/type"; +// etc +``` + +Repeat as necessary for any variable in Bootstrap, including the global options below. + + + +## Maps and loops + +Bootstrap includes a handful of Sass maps, key value pairs that make it easier to generate families of related CSS. We use Sass maps for our colors, grid breakpoints, and more. Just like Sass variables, all Sass maps include the `!default` flag and can be overridden and extended. + +Some of our Sass maps are merged into empty ones by default. This is done to allow easy expansion of a given Sass map, but comes at the cost of making _removing_ items from a map slightly more difficult. + +### Modify map + +All variables in the `$theme-colors` map are defined as standalone variables. To modify an existing color in our `$theme-colors` map, add the following to your custom Sass file: + +```scss +$primary: #0074d9; +$danger: #ff4136; +``` + +Later on, these variables are set in Bootstrap’s `$theme-colors` map: + +```scss +$theme-colors: ( + "primary": $primary, + "danger": $danger +); +``` + +### Add to map + +Add new colors to `$theme-colors`, or any other map, by creating a new Sass map with your custom values and merging it with the original map. In this case, we'll create a new `$custom-colors` map and merge it with `$theme-colors`. + +```scss +// Create your own map +$custom-colors: ( + "custom-color": #900 +); + +// Merge the maps +$theme-colors: map-merge($theme-colors, $custom-colors); +``` + +### Remove from map + +To remove colors from `$theme-colors`, or any other map, use `map-remove`. Be aware you must insert `$theme-colors` between our requirements just after its definition in `variables` and before its usage in `maps`: + +```scss +// Required +@import "../node_modules/bootstrap/scss/functions"; +@import "../node_modules/bootstrap/scss/variables"; +@import "../node_modules/bootstrap/scss/variables-dark"; + +$theme-colors: map-remove($theme-colors, "info", "light", "dark"); + +@import "../node_modules/bootstrap/scss/maps"; +@import "../node_modules/bootstrap/scss/mixins"; +@import "../node_modules/bootstrap/scss/root"; + +// Optional +@import "../node_modules/bootstrap/scss/reboot"; +@import "../node_modules/bootstrap/scss/type"; +// etc +``` + +## Required keys + +Bootstrap assumes the presence of some specific keys within Sass maps as we used and extend these ourselves. As you customize the included maps, you may encounter errors where a specific Sass map’s key is being used. + +For example, we use the `primary`, `success`, and `danger` keys from `$theme-colors` for links, buttons, and form states. Replacing the values of these keys should present no issues, but removing them may cause Sass compilation issues. In these instances, you’ll need to modify the Sass code that makes use of those values. + +## Functions + +### Colors + +Next to the [Sass maps]([[docsref:/customize/color#color-sass-maps]]) we have, theme colors can also be used as standalone variables, like `$primary`. + +```scss +.custom-element { + color: $gray-100; + background-color: $dark; +} +``` + +You can lighten or darken colors with Bootstrap’s `tint-color()` and `shade-color()` functions. These functions will mix colors with black or white, unlike Sass’ native `lighten()` and `darken()` functions which will change the lightness by a fixed amount, which often doesn’t lead to the desired effect. + +`shift-color()` combines these two functions by shading the color if the weight is positive and tinting the color if the weight is negative. + + + +In practice, you’d call the function and pass in the color and weight parameters. + +```scss +.custom-element { + color: tint-color($primary, 10%); +} + +.custom-element-2 { + color: shade-color($danger, 30%); +} + +.custom-element-3 { + color: shift-color($success, 40%); + background-color: shift-color($success, -60%); +} +``` + +### Color contrast + +In order to meet the [Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/TR/WCAG/) contrast requirements, authors **must** provide a minimum [text color contrast of 4.5:1](https://www.w3.org/TR/WCAG/#contrast-minimum) and a minimum [non-text color contrast of 3:1](https://www.w3.org/TR/WCAG/#non-text-contrast), with very few exceptions. + +To help with this, we included the `color-contrast` function in Bootstrap. It uses the [WCAG contrast ratio algorithm](https://www.w3.org/TR/WCAG/#dfn-contrast-ratio) for calculating contrast thresholds based on [relative luminance](https://www.w3.org/TR/WCAG/#dfn-relative-luminance) in an `sRGB` color space to automatically return a light (`#fff`), dark (`#212529`) or black (`#000`) contrast color based on the specified base color. This function is especially useful for mixins or loops where you’re generating multiple classes. + +For example, to generate color swatches from our `$theme-colors` map: + +```scss +@each $color, $value in $theme-colors { + .swatch-#{$color} { + color: color-contrast($value); + } +} +``` + +It can also be used for one-off contrast needs: + +```scss +.custom-element { + color: color-contrast(#000); // returns `color: #fff` +} +``` + +You can also specify a base color with our color map functions: + +```scss +.custom-element { + color: color-contrast($dark); // returns `color: #fff` +} +``` + +### Escape SVG + +We use the `escape-svg` function to escape the `<`, `>` and `#` characters for SVG background images. When using the `escape-svg` function, data URIs must be quoted. + +### Add and Subtract functions + +We use the `add` and `subtract` functions to wrap the CSS `calc` function. The primary purpose of these functions is to avoid errors when a “unitless” `0` value is passed into a `calc` expression. Expressions like `calc(10px - 0)` will return an error in all browsers, despite being mathematically correct. + +Example where the calc is valid: + +```scss +$border-radius: .25rem; +$border-width: 1px; + +.element { + // Output calc(.25rem - 1px) is valid + border-radius: calc($border-radius - $border-width); +} + +.element { + // Output the same calc(.25rem - 1px) as above + border-radius: subtract($border-radius, $border-width); +} +``` + +Example where the calc is invalid: + +```scss +$border-radius: .25rem; +$border-width: 0; + +.element { + // Output calc(.25rem - 0) is invalid + border-radius: calc($border-radius - $border-width); +} + +.element { + // Output .25rem + border-radius: subtract($border-radius, $border-width); +} +``` + +## Mixins + +Our `scss/mixins/` directory has a ton of mixins that power parts of Bootstrap and can also be used across your own project. + +### Color schemes + +A shorthand mixin for the `prefers-color-scheme` media query is available with support for `light` and `dark` color schemes. See [the color modes documentation]([[docsref:/customize/color-modes]]) for information on our color mode mixin. + + + +```scss +.custom-element { + @include color-scheme(light) { + // Insert light mode styles here + } + + @include color-scheme(dark) { + // Insert dark mode styles here + } +} +``` diff --git a/site/src/content/docs/docsref.mdx b/site/src/content/docs/docsref.mdx new file mode 100644 index 000000000000..f6b303e87cc8 --- /dev/null +++ b/site/src/content/docs/docsref.mdx @@ -0,0 +1,45 @@ +--- +title: Docs reference +description: Examples of Bootstrap’s documentation-specific components and styles. +aliases: "/docsref/" +toc: true +robots: noindex,follow +--- + +## Buttons + + + + + +## Callouts + + + Default callout + + + + Warning callout + + + + Danger callout + + +## Code example + +```scss +.test { + --color: blue; +} +``` + +
      + The HTML abbreviation element. +
      + +This is a test.`} /> + + + + diff --git a/site/src/content/docs/extend/approach.mdx b/site/src/content/docs/extend/approach.mdx new file mode 100644 index 000000000000..1be156e648cd --- /dev/null +++ b/site/src/content/docs/extend/approach.mdx @@ -0,0 +1,84 @@ +--- +title: Approach +description: Learn about the guiding principles, strategies, and techniques used to build and maintain Bootstrap so you can more easily customize and extend it yourself. +aliases: + - "/docs/[[config:docs_version]]/extend/" +--- + +While the getting started pages provide an introductory tour of the project and what it offers, this document focuses on _why_ we do the things we do in Bootstrap. It explains our philosophy to building on the web so that others can learn from us, contribute with us, and help us improve. + +See something that doesn’t sound right, or perhaps could be done better? [Open an issue]([[config:repo]]/issues/new/choose)—we’d love to discuss it with you. + +## Summary + +We'll dive into each of these more throughout, but at a high level, here’s what guides our approach. + +- Components should be responsive and mobile-first +- Components should be built with a base class and extended via modifier classes +- Component states should obey a common z-index scale +- Whenever possible, prefer an HTML and CSS implementation over JavaScript +- Whenever possible, use utilities over custom styles +- Whenever possible, avoid enforcing strict HTML requirements (children selectors) + +## Responsive + +Bootstrap’s responsive styles are built to be responsive, an approach that’s often referred to as _mobile-first_. We use this term in our docs and largely agree with it, but at times it can be too broad. While not every component _must_ be entirely responsive in Bootstrap, this responsive approach is about reducing CSS overrides by pushing you to add styles as the viewport becomes larger. + +Across Bootstrap, you’ll see this most clearly in our media queries. In most cases, we use `min-width` queries that begin to apply at a specific breakpoint and carry up through the higher breakpoints. For example, a `.d-none` applies from `min-width: 0` to infinity. On the other hand, a `.d-md-none` applies from the medium breakpoint and up. + +At times we'll use `max-width` when a component’s inherent complexity requires it. At times, these overrides are functionally and mentally clearer to implement and support than rewriting core functionality from our components. We strive to limit this approach, but will use it from time to time. + +## Classes + +Aside from our Reboot, a cross-browser normalization stylesheet, all our styles aim to use classes as selectors. This means steering clear of type selectors (e.g., `input[type="text"]`) and extraneous parent classes (e.g., `.parent .child`) that make styles too specific to easily override. + +As such, components should be built with a base class that houses common, not-to-be overridden property-value pairs. For example, `.btn` and `.btn-primary`. We use `.btn` for all the common styles like `display`, `padding`, and `border-width`. We then use modifiers like `.btn-primary` to add the color, background-color, border-color, etc. + +Modifier classes should only be used when there are multiple properties or values to be changed across multiple variants. Modifiers are not always necessary, so be sure you’re actually saving lines of code and preventing unnecessary overrides when creating them. Good examples of modifiers are our theme color classes and size variants. + +## z-index scales + +There are two `z-index` scales in Bootstrap—elements within a component and overlay components. + +### Component elements + +- Some components in Bootstrap are built with overlapping elements to prevent double borders without modifying the `border` property. For example, button groups, input groups, and pagination. +- These components share a standard `z-index` scale of `0` through `3`. +- `0` is default (initial), `1` is `:hover`, `2` is `:active`/`.active`, and `3` is `:focus`. +- This approach matches our expectations of highest user priority. If an element is focused, it’s in view and at the user’s attention. Active elements are second highest because they indicate state. Hover is third highest because it indicates user intent, but nearly _anything_ can be hovered. + +### Overlay components + +Bootstrap includes several components that function as an overlay of some kind. This includes, in order of highest `z-index`, dropdowns, fixed and sticky navbars, modals, tooltips, and popovers. These components have their own `z-index` scale that begins at `1000`. This starting number was chosen arbitrarily and serves as a small buffer between our styles and your project’s custom styles. + +Each overlay component increases its `z-index` value slightly in such a way that common UI principles allow user focused or hovered elements to remain in view at all times. For example, a modal is document blocking (e.g., you cannot take any other action save for the modal’s action), so we put that above our navbars. + +Learn more about this in our [`z-index` layout page]([[docsref:/layout/z-index]]). + +## HTML and CSS over JS + +Whenever possible, we prefer to write HTML and CSS over JavaScript. In general, HTML and CSS are more prolific and accessible to more people of all different experience levels. HTML and CSS are also faster in your browser than JavaScript, and your browser generally provides a great deal of functionality for you. + +This principle is our first-class JavaScript API using `data` attributes. You don’t need to write nearly any JavaScript to use our JavaScript plugins; instead, write HTML. Read more about this in [our JavaScript overview page]([[docsref:/getting-started/javascript#data-attributes]]). + +Lastly, our styles build on the fundamental behaviors of common web elements. Whenever possible, we prefer to use what the browser provides. For example, you can put a `.btn` class on nearly any element, but most elements don’t provide any semantic value or browser functionality. So instead, we use ` + + `} /> + +## File input + + + + + +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      `} /> + +## Color + +Set the `type="color"` and add `.form-control-color` to the ``. We use the modifier class to set fixed `height`s and override some inconsistencies between browsers. + +Color picker +`} /> + +## Datalists + +Datalists allow you to create a group of `