├── .env ├── .github └── workflows │ ├── add-depr-ticket-to-depr-board.yml │ ├── add-remove-label-on-comment.yml │ ├── ci.yml │ ├── commitlint.yml │ ├── lockfileversion-check.yml │ ├── npm-publish.yml │ └── self-assign-issue.yml ├── .gitignore ├── .npmignore ├── .npmrc ├── .nvmrc ├── LICENSE ├── README.rst ├── catalog-info.yaml ├── package-lock.json ├── package.json ├── public ├── 404.html ├── favicon.ico ├── index.html └── manifest.json ├── renovate.json ├── scss ├── core │ ├── _extensions.scss │ ├── core.scss │ └── extensions │ │ ├── _buttons.scss │ │ └── _utilities.scss ├── edx │ ├── _fonts.scss │ ├── _functions.scss │ ├── _overrides.scss │ ├── _variables.scss │ ├── custom │ │ └── _edx-custom-card.scss │ ├── overrides │ │ ├── _alerts.scss │ │ ├── _badges.scss │ │ ├── _buttons.scss │ │ ├── _dropdowns.scss │ │ ├── _grid.scss │ │ ├── _modals.scss │ │ ├── _navs.scss │ │ └── _typography.scss │ └── theme.scss └── open-edx │ ├── _fonts.scss │ ├── _overrides.scss │ ├── _variables.scss │ ├── custom │ └── _edx-custom-card.scss │ ├── overrides │ ├── _alerts.scss │ ├── _badges.scss │ ├── _buttons.scss │ ├── _dropdowns.scss │ ├── _grid.scss │ ├── _modals.scss │ ├── _navs.scss │ ├── _tables.scss │ └── _typography.scss │ └── theme.scss ├── src ├── App.js ├── App.test.js ├── DocSection.js ├── Header.js ├── ScrollToTop.js ├── common │ └── MeasuredItem.js ├── index.js ├── index.scss ├── logo.svg ├── pages │ ├── Basics.ButtonsAndLinks.js │ ├── Basics.Colors.js │ ├── Basics.MiscBasics.js │ ├── Basics.Themes.js │ ├── Basics.Typography.js │ ├── Basics.js │ ├── Examples.js │ ├── Forms.js │ ├── GettingStarted.js │ ├── Miscellaneous.js │ ├── Navigation.js │ ├── Overview.js │ └── bootstrap │ │ ├── Alerts.js │ │ ├── Badge.js │ │ ├── Breadcrumb.js │ │ ├── Cards.js │ │ ├── Collapse.js │ │ ├── Dropdowns.js │ │ ├── Grid.js │ │ ├── InputGroup.js │ │ ├── Jumbotron.js │ │ ├── LayoutUtils.js │ │ ├── ListGroup.js │ │ ├── MediaObject.js │ │ ├── Modal.js │ │ ├── Navs.js │ │ ├── Pagination.js │ │ ├── Popovers.js │ │ ├── Progress.js │ │ ├── Spinners.js │ │ └── Tables.js └── scss │ └── bootstrap-docs-4-2 │ ├── _ads.scss │ ├── _algolia.scss │ ├── _anchor.scss │ ├── _brand.scss │ ├── _browser-bugs.scss │ ├── _buttons.scss │ ├── _callouts.scss │ ├── _clipboard-js.scss │ ├── _colors.scss │ ├── _component-examples.scss │ ├── _content.scss │ ├── _footer.scss │ ├── _masthead.scss │ ├── _nav.scss │ ├── _placeholder-img.scss │ ├── _sidebar.scss │ ├── _skippy.scss │ ├── _syntax.scss │ ├── _variables.scss │ └── docs.scss ├── stylelint.config.js └── utils └── sass-importer.js /.env: -------------------------------------------------------------------------------- 1 | PUBLIC_URL=/edx-bootstrap 2 | -------------------------------------------------------------------------------- /.github/workflows/add-depr-ticket-to-depr-board.yml: -------------------------------------------------------------------------------- 1 | # Run the workflow that adds new tickets that are either: 2 | # - labelled "DEPR" 3 | # - title starts with "[DEPR]" 4 | # - body starts with "Proposal Date" (this is the first template field) 5 | # to the org-wide DEPR project board 6 | 7 | name: Add newly created DEPR issues to the DEPR project board 8 | 9 | on: 10 | issues: 11 | types: [opened] 12 | 13 | jobs: 14 | routeissue: 15 | uses: openedx/.github/.github/workflows/add-depr-ticket-to-depr-board.yml@master 16 | secrets: 17 | GITHUB_APP_ID: ${{ secrets.GRAPHQL_AUTH_APP_ID }} 18 | GITHUB_APP_PRIVATE_KEY: ${{ secrets.GRAPHQL_AUTH_APP_PEM }} 19 | SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }} 20 | -------------------------------------------------------------------------------- /.github/workflows/add-remove-label-on-comment.yml: -------------------------------------------------------------------------------- 1 | # This workflow runs when a comment is made on the ticket 2 | # If the comment starts with "label: " it tries to apply 3 | # the label indicated in rest of comment. 4 | # If the comment starts with "remove label: ", it tries 5 | # to remove the indicated label. 6 | # Note: Labels are allowed to have spaces and this script does 7 | # not parse spaces (as often a space is legitimate), so the command 8 | # "label: really long lots of words label" will apply the 9 | # label "really long lots of words label" 10 | 11 | name: Allows for the adding and removing of labels via comment 12 | 13 | on: 14 | issue_comment: 15 | types: [created] 16 | 17 | jobs: 18 | add_remove_labels: 19 | uses: openedx/.github/.github/workflows/add-remove-label-on-comment.yml@master 20 | 21 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Node CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - "**" 10 | 11 | jobs: 12 | tests: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v4 17 | - name: Setup Nodejs 18 | uses: actions/setup-node@v4 19 | with: 20 | node-version-file: '.nvmrc' 21 | 22 | - name: Install Dependencies 23 | run: npm ci 24 | 25 | - name: Lint 26 | run: npm run lint 27 | 28 | - name: Build 29 | run: npm run build 30 | 31 | - name: Send failure notification 32 | if: ${{ failure() }} 33 | uses: dawidd6/action-send-mail@v3 34 | with: 35 | server_address: email-smtp.us-east-1.amazonaws.com 36 | server_port: 465 37 | username: ${{secrets.EDX_SMTP_USERNAME}} 38 | password: ${{secrets.EDX_SMTP_PASSWORD}} 39 | subject: CI workflow failed in ${{github.repository}} 40 | to: frontend-working-group@edx.org 41 | from: github-actions 42 | body: CI workflow in ${{github.repository}} failed! For details see "github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" 43 | -------------------------------------------------------------------------------- /.github/workflows/commitlint.yml: -------------------------------------------------------------------------------- 1 | # Run commitlint on the commit messages in a pull request. 2 | 3 | name: Lint Commit Messages 4 | 5 | on: 6 | - pull_request 7 | 8 | jobs: 9 | commitlint: 10 | uses: openedx/.github/.github/workflows/commitlint.yml@master 11 | -------------------------------------------------------------------------------- /.github/workflows/lockfileversion-check.yml: -------------------------------------------------------------------------------- 1 | #check package-lock file version 2 | 3 | name: Lockfile Version check 4 | 5 | on: 6 | push: 7 | branches: 8 | - master 9 | pull_request: 10 | 11 | jobs: 12 | version-check: 13 | uses: openedx/.github/.github/workflows/lockfileversion-check-v3.yml@master 14 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | 2 | on: 3 | push: 4 | branches: 5 | - master 6 | 7 | jobs: 8 | release: 9 | name: Release 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v4 14 | with: 15 | fetch-depth: 0 16 | - name: Setup Nodejs Env 17 | run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV 18 | - name: Setup Node.js 19 | uses: actions/setup-node@v4 20 | with: 21 | node-version: ${{ env.NODE_VER }} 22 | 23 | - name: Install dependencies 24 | run: npm ci 25 | 26 | - name: Create Build 27 | run: npm run build 28 | 29 | - name: Release Package 30 | env: 31 | GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }} 32 | NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} 33 | run: npm run semantic-release 34 | -------------------------------------------------------------------------------- /.github/workflows/self-assign-issue.yml: -------------------------------------------------------------------------------- 1 | # This workflow runs when a comment is made on the ticket 2 | # If the comment starts with "assign me" it assigns the author to the 3 | # ticket (case insensitive) 4 | 5 | name: Assign comment author to ticket if they say "assign me" 6 | on: 7 | issue_comment: 8 | types: [created] 9 | 10 | jobs: 11 | self_assign_by_comment: 12 | uses: openedx/.github/.github/workflows/self-assign-issue.yml@master 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | build 3 | css 4 | samples/edx-bootstrap 5 | node_modules 6 | sass/.DS_Store 7 | .DS_Store 8 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .edx-bootstrap 2 | .gitignore 3 | .npmignore 4 | _config.yml 5 | doc 6 | node_modules 7 | package.json 8 | test 9 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | # Workaround for https://github.com/npm/npm/issues/17722 2 | 3 | optional=false 4 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ############## 2 | edX Bootstrap 3 | ############## 4 | 5 | .. image:: https://badge.fury.io/js/%40edx%2Fedx-bootstrap.svg 6 | :target: https://badge.fury.io/js/%40edx%2Fedx-bootstrap 7 | .. highlight:: css 8 | 9 | ******** 10 | Purpose 11 | ******** 12 | 13 | This library is an extension of `Bootstrap 4 `_ 14 | for use with edX and openEdX. 15 | 16 | Installation 17 | ============= 18 | 19 | Using npm:: 20 | 21 | npm install --save @edx/edx-bootstrap 22 | 23 | Cloning and Startup 24 | =================== 25 | 26 | .. code-block:: 27 | 28 | 29 | 1. Clone your new repo: 30 | 31 | ``git clone https://github.com/openedx/edx-bootstrap.git`` 32 | 33 | 2. Use node v18.x. 34 | 35 | The current version of the micro-frontend build scripts support node 18. 36 | Using other major versions of node *may* work, but this is unsupported. For 37 | convenience, this repository includes an .nvmrc file to help in setting the 38 | correct node version via `nvm `_. 39 | 40 | 3. Install npm dependencies: 41 | 42 | ``cd edx-bootstrap && npm ci`` 43 | 44 | Usage 45 | ===== 46 | 47 | Add the following import in your project's base scss file:: 48 | 49 | @import "~@edx/edx-bootstrap/scss/edx/theme.scss"; 50 | 51 | Or for Open edX users:: 52 | 53 | @import "~@edx/edx-bootstrap/scss/open-edx/theme.scss"; 54 | 55 | This includes everything you need. Bootstrap is included so you don't 56 | need to add it in your project. If you need more control, see the 57 | theming section. 58 | 59 | Alternatively, you can download this repo and use one of the compiled outputs: 60 | 61 | - ``dist/open-edx/theme.css`` (Open edX bootstrap, extensions, & theme) 62 | - ``dist/edx/theme.css`` (edX bootstrap, extensions, & theme) 63 | - ``dist/core/core.css`` (edX bootstrap & extensions only) 64 | 65 | Theming 66 | ======= 67 | 68 | The content of a `theme.scss` file:: 69 | 70 | // Optional 71 | @import "my-fonts"; 72 | @import "my-variables"; 73 | 74 | // Required core (includes bootstrap and extensions) 75 | @import "@edx/edx-boostrap/scss/core/core.scss"; 76 | 77 | // The rest of your scss 78 | // ... 79 | 80 | To create a theme, make a copy of the ``scss/open-edx`` folder in your own project 81 | and make changes. Then include it before you include edx-bootstrap:: 82 | 83 | @import "fonts"; 84 | @import "variables"; 85 | 86 | // If you are creating your own theme remove 87 | // the "../core/core" import with the line below. 88 | @import "../core/core"; 89 | // @import "@edx/edx-boostrap/scss/core/core.scss"; 90 | 91 | @import "overrides"; 92 | 93 | Getting Help 94 | ============ 95 | 96 | If you’re having trouble, you can ask in the front-end channel on Slack or contact the Frontend Working Group: 97 | 98 | - `#front-end `_ 99 | - `#frontend-working-group `_ 100 | 101 | License 102 | ======= 103 | 104 | The code in this repository uses the Apache 2.0 license unless otherwise noted. 105 | Please see the `LICENSE file `_ 106 | for details. 107 | 108 | Documentation 109 | ============= 110 | 111 | Documentation details can be found in the `docs index.rst`_. 112 | 113 | .. _docs index.rst: docs/index.rst 114 | 115 | 116 | How to Contribute 117 | ================= 118 | 119 | Contributions are very welcome, but for legal reasons, you must submit a 120 | signed `individual contributor agreement`_ before we can accept your 121 | contribution. See our `CONTRIBUTING`_ file for more information – it 122 | also contains guidelines for how to maintain high code quality, which 123 | will make your contribution more likely to be accepted. 124 | 125 | 126 | Reporting Security Issues 127 | ========================= 128 | 129 | Please do not report security issues in public. Please email 130 | security@openedx.org. 131 | 132 | .. _individual contributor agreement: https://open.edx.org/wp-content/uploads/2019/01/individual-contributor-agreement.pdf 133 | .. _CONTRIBUTING: https://github.com/openedx/.github/blob/master/CONTRIBUTING.md 134 | -------------------------------------------------------------------------------- /catalog-info.yaml: -------------------------------------------------------------------------------- 1 | # This file records information about this repo. Its use is described in OEP-55: 2 | # https://open-edx-proposals.readthedocs.io/en/latest/processes/oep-0055-proc-project-maintainers.html 3 | 4 | apiVersion: backstage.io/v1alpha1 5 | kind: Component 6 | metadata: 7 | name: 'edx-bootstrap' 8 | description: "This library is an extension of Bootstrap 4, provides a set of tools to bootstrap a new Open edX project." 9 | spec: 10 | type: 'library' 11 | owner: group:openedx-unmaintained -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@edx/edx-bootstrap", 3 | "description": "The Bootstrap theme for Open edX", 4 | "license": "Apache-2.0", 5 | "repository": "git@github.com:edx/edx-bootstrap.git", 6 | "version": "1.0.4", 7 | "homepage": "http://edx.github.io/edx-bootstrap", 8 | "scripts": { 9 | "start": "react-scripts start", 10 | "build-docs": "react-scripts build", 11 | "build": "node-sass --importer=utils/sass-importer --output-style expanded scss/ -o dist/", 12 | "lint": "stylelint ./scss/**/*.scss", 13 | "lint-fix": "stylelint ./scss/**/*.scss --fix", 14 | "test": "react-scripts test", 15 | "eject": "react-scripts eject", 16 | "semantic-release": "semantic-release", 17 | "predeploy": "npm run build-docs", 18 | "deploy": "gh-pages -d build" 19 | }, 20 | "husky": { 21 | "hooks": { 22 | "pre-commit": "npm run lint" 23 | } 24 | }, 25 | "browserslist": [ 26 | "extends @edx/browserslist-config" 27 | ], 28 | "dependencies": { 29 | "bootstrap": "4.6.2" 30 | }, 31 | "devDependencies": { 32 | "@edx/browserslist-config": "^1.1.1", 33 | "@edx/stylelint-config-edx": "2.3.0", 34 | "@fortawesome/fontawesome-svg-core": "1.2.36", 35 | "@fortawesome/free-solid-svg-icons": "5.15.4", 36 | "@fortawesome/react-fontawesome": "0.2.2", 37 | "chroma-js": "2.6.0", 38 | "classnames": "2.5.1", 39 | "gh-pages": "6.3.0", 40 | "husky": "8.0.3", 41 | "jquery": "3.7.1", 42 | "lodash": "4.17.21", 43 | "node-sass": "9.0.0", 44 | "popper.js": "1.16.1", 45 | "prop-types": "15.8.1", 46 | "react": "17.0.2", 47 | "react-dom": "17.0.2", 48 | "react-router-dom": "6.30.1", 49 | "react-router-hash-link": "1.2.2", 50 | "react-scripts": "5.0.1", 51 | "semantic-release": "^21.0.7" 52 | }, 53 | "release": { 54 | "branch": "master", 55 | "tagFormat": "v${version}", 56 | "verifyConditions": [ 57 | "@semantic-release/npm", 58 | { 59 | "path": "@semantic-release/github", 60 | "assets": { 61 | "path": "dist/*" 62 | } 63 | } 64 | ], 65 | "analyzeCommits": "@semantic-release/commit-analyzer", 66 | "generateNotes": "@semantic-release/release-notes-generator", 67 | "prepare": "@semantic-release/npm", 68 | "publish": [ 69 | "@semantic-release/npm", 70 | { 71 | "path": "@semantic-release/github", 72 | "assets": { 73 | "path": "dist/*" 74 | } 75 | } 76 | ], 77 | "success": [], 78 | "fail": [] 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Single Page Apps for GitHub Pages 6 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openedx/edx-bootstrap/85f9a221d409428aa7d00fcecdeb6dbafe0f204b/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 15 | 16 | 25 | edX Bootstrap Docs 26 | 27 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
64 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base", 4 | "schedule:weekly", 5 | ":automergeLinters", 6 | ":automergeMinor", 7 | ":automergeTesters", 8 | ":enableVulnerabilityAlerts", 9 | ":rebaseStalePrs", 10 | ":semanticCommits", 11 | ":updateNotScheduled" 12 | ], 13 | "packageRules": [ 14 | { 15 | "matchDepTypes": [ 16 | "devDependencies" 17 | ], 18 | "matchUpdateTypes": [ 19 | "lockFileMaintenance", 20 | "minor", 21 | "patch", 22 | "pin" 23 | ], 24 | "automerge": true 25 | } 26 | ], 27 | "timezone": "America/New_York" 28 | } 29 | -------------------------------------------------------------------------------- /scss/core/_extensions.scss: -------------------------------------------------------------------------------- 1 | @import "./extensions/buttons"; 2 | @import "./extensions/utilities"; 3 | -------------------------------------------------------------------------------- /scss/core/core.scss: -------------------------------------------------------------------------------- 1 | @import "~bootstrap/scss/functions"; 2 | @import "~bootstrap/scss/variables"; 3 | @import "~bootstrap/scss/mixins"; 4 | 5 | @import "~bootstrap/scss/root"; 6 | @import "~bootstrap/scss/reboot"; 7 | @import "~bootstrap/scss/type"; 8 | @import "~bootstrap/scss/images"; 9 | @import "~bootstrap/scss/code"; 10 | @import "~bootstrap/scss/grid"; 11 | @import "~bootstrap/scss/tables"; 12 | @import "~bootstrap/scss/forms"; 13 | @import "~bootstrap/scss/buttons"; 14 | @import "~bootstrap/scss/transitions"; 15 | @import "~bootstrap/scss/dropdown"; 16 | @import "~bootstrap/scss/button-group"; 17 | @import "~bootstrap/scss/input-group"; 18 | @import "~bootstrap/scss/custom-forms"; 19 | @import "~bootstrap/scss/nav"; 20 | @import "~bootstrap/scss/navbar"; 21 | @import "~bootstrap/scss/card"; 22 | @import "~bootstrap/scss/breadcrumb"; 23 | @import "~bootstrap/scss/pagination"; 24 | @import "~bootstrap/scss/badge"; 25 | @import "~bootstrap/scss/jumbotron"; 26 | @import "~bootstrap/scss/alert"; 27 | @import "~bootstrap/scss/progress"; 28 | @import "~bootstrap/scss/media"; 29 | @import "~bootstrap/scss/list-group"; 30 | @import "~bootstrap/scss/close"; 31 | @import "~bootstrap/scss/toasts"; 32 | @import "~bootstrap/scss/modal"; 33 | @import "~bootstrap/scss/tooltip"; 34 | @import "~bootstrap/scss/popover"; 35 | @import "~bootstrap/scss/carousel"; 36 | @import "~bootstrap/scss/spinners"; 37 | @import "~bootstrap/scss/utilities"; 38 | @import "~bootstrap/scss/print"; 39 | 40 | @import "extensions"; 41 | -------------------------------------------------------------------------------- /scss/core/extensions/_buttons.scss: -------------------------------------------------------------------------------- 1 | // 2 | // This field defines a new variant of button (inverse) 3 | // and adds a focus outline to all buttons on :focus 4 | // 5 | 6 | @mixin button-inverse-variant($color, $background: color-yiq($color), $active-background: $color, $active-border: $color) { 7 | color: $color; 8 | border-color: transparent; 9 | background-color: $background; 10 | 11 | @include hover { 12 | color: darken($color, 7.5%); 13 | background-color: darken($background, 7.5%); 14 | border-color: transparent; 15 | } 16 | 17 | &:focus, 18 | &.focus { 19 | border-color: rgba($color, 0.5); 20 | } 21 | 22 | &.disabled, 23 | &:disabled { 24 | color: $color; 25 | background-color: transparent; 26 | } 27 | 28 | &:not(:disabled):not(.disabled):active, 29 | &:not(:disabled):not(.disabled).active, 30 | .show > &.dropdown-toggle { 31 | color: darken($color, 10%); 32 | background: #eee; 33 | } 34 | } 35 | 36 | 37 | // Create inverse variants 38 | 39 | @each $color, $value in $theme-colors { 40 | .btn-inverse-#{$color} { 41 | @include button-inverse-variant($value); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /scss/core/extensions/_utilities.scss: -------------------------------------------------------------------------------- 1 | @each $color, $value in $colors { 2 | @include bg-variant(".bg-#{$color}", $value); 3 | } 4 | 5 | @each $color, $value in $colors { 6 | @include text-emphasis-variant(".text-#{$color}", $value); 7 | } 8 | 9 | @each $color, $value in $colors { 10 | .border-#{$color} { 11 | border-color: $value !important; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /scss/edx/_fonts.scss: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css?family=Roboto:400,500,700"); 2 | -------------------------------------------------------------------------------- /scss/edx/_functions.scss: -------------------------------------------------------------------------------- 1 | @function blend-transparent($foreground, $background, $fg-opacity, $bg-opacity: 1) { 2 | // https://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending 3 | // Adapted from: https://gist.github.com/jdudek/54c80e27510b9b13d4447f803869118f 4 | 5 | $opacity: $fg-opacity + $bg-opacity * (1 - $fg-opacity); 6 | $factor: $bg-opacity * (1 - $fg-opacity); 7 | 8 | $red: (red($foreground) * $fg-opacity + red($background) * $factor) / $opacity; 9 | $green: (green($foreground) * $fg-opacity + green($background) * $factor) / $opacity; 10 | $blue: (blue($foreground) * $fg-opacity + blue($background) * $factor) / $opacity; 11 | 12 | @return rgba($red, $green, $blue, $opacity); 13 | } 14 | -------------------------------------------------------------------------------- /scss/edx/_overrides.scss: -------------------------------------------------------------------------------- 1 | @import "./overrides/alerts"; 2 | @import "./overrides/badges"; 3 | @import "./overrides/buttons"; 4 | @import "./overrides/dropdowns"; 5 | @import "./overrides/grid"; 6 | @import "./overrides/modals"; 7 | @import "./overrides/typography"; 8 | @import "./overrides/navs"; 9 | 10 | @import "./custom/edx-custom-card"; 11 | -------------------------------------------------------------------------------- /scss/edx/custom/_edx-custom-card.scss: -------------------------------------------------------------------------------- 1 | $charcoal-grey: #393f43 !default; 2 | $dark-slate-blue: #17285d !default; 3 | $ice-blue: #f5f8ff !default; 4 | $sapphire: #23419f !default; 5 | $silver: #d6dbe0 !default; 6 | $slate-grey: #636c72 !default; 7 | $light-border: 1px solid $silver !default; 8 | $edx-shadow-color: rgba(0, 0, 0, 0.3) !default; 9 | 10 | @mixin edx-shadow { 11 | box-shadow: 0 2px 2px 0 $edx-shadow-color; 12 | } 13 | 14 | .edx-custom { 15 | &.card { 16 | border: { 17 | top: $light-border; 18 | bottom: 0; 19 | left: 0; 20 | right: 0; 21 | radius: unset; 22 | } 23 | 24 | .card-content { 25 | display: flex; 26 | flex-direction: column; 27 | font-family: $font-family-sans-serif; 28 | } 29 | 30 | .card-title { 31 | text-decoration: underline; 32 | } 33 | 34 | .card-body { 35 | padding: 15px 20px; 36 | 37 | .card-title { 38 | text-decoration: underline; 39 | margin: 0 0 5px; 40 | font: { 41 | size: 1.25rem; 42 | weight: $font-weight-normal; 43 | } 44 | 45 | padding-bottom: 10px; 46 | line-height: 1.5; 47 | } 48 | 49 | .card-partner { 50 | font-size: 1rem; 51 | 52 | @include media-breakpoint-up(lg) { 53 | font-size: 0.875rem; 54 | } 55 | 56 | @include media-breakpoint-up(xl) { 57 | font-size: 1rem; 58 | } 59 | } 60 | } 61 | 62 | .card-footer, 63 | .out-of, 64 | .type, 65 | .card-overlay { 66 | display: none; 67 | } 68 | 69 | .card-stats { 70 | width: 100%; 71 | display: flex; 72 | justify-content: space-between; 73 | 74 | align: { 75 | items: flex-end; 76 | self: flex-end; 77 | } 78 | 79 | padding: { 80 | left: 20px; 81 | right: 20px; 82 | } 83 | 84 | color: $charcoal-grey; 85 | font-size: 1rem; 86 | 87 | .course-count { 88 | margin-right: 20px; 89 | } 90 | } 91 | 92 | @include media-breakpoint-up(sm) { 93 | @include edx-shadow(); 94 | 95 | border: $light-border; 96 | border-radius: 4px; 97 | 98 | .card-content { 99 | height: 190px; 100 | 101 | &:hover, 102 | &:focus-within, 103 | &:active { 104 | background-color: $ice-blue; 105 | } 106 | } 107 | 108 | .card-overlay { 109 | display: block; 110 | top: 100%; 111 | bottom: 0; 112 | left: 0; 113 | right: 0; 114 | width: 100%; 115 | z-index: 1; 116 | border-color: $silver; 117 | 118 | &::after { 119 | content: ""; 120 | width: 28px; 121 | height: 28px; 122 | background: $ice-blue; 123 | position: absolute; 124 | top: -14px; 125 | right: calc(50% - 14px); 126 | transform: rotate(45deg); 127 | 128 | border: { 129 | left: 2px solid $silver; 130 | top: 2px solid $silver; 131 | } 132 | } 133 | 134 | .card-overlay-link { 135 | text-decoration: underline; 136 | color: $sapphire; 137 | } 138 | 139 | .card-overlay-body { 140 | background: $ice-blue; 141 | font-size: 1rem; 142 | color: $slate-grey; 143 | padding: 20px; 144 | border: $light-border; 145 | border-radius: 4px; 146 | 147 | .h5 { 148 | font: { 149 | size: 1rem; 150 | weight: $font-weight-bold; 151 | } 152 | } 153 | } 154 | 155 | .card-overlay-close { 156 | right: 0%; 157 | top: 0%; 158 | background: none; 159 | } 160 | } 161 | 162 | .card-body { 163 | height: 125px; 164 | padding: 20px; 165 | 166 | .card-title { 167 | padding-bottom: 0; 168 | } 169 | 170 | .h6 { 171 | font-size: 1rem; 172 | } 173 | 174 | .out-of { 175 | display: block; 176 | color: $white; 177 | position: relative; 178 | z-index: 0; 179 | border-radius: 0 4px 0 0; 180 | overflow: hidden; 181 | 182 | &::before { 183 | content: ''; 184 | position: absolute; 185 | top: 0; 186 | right: 0; 187 | z-index: -1; 188 | border: 32px solid $dark-slate-blue; 189 | 190 | border: { 191 | bottom-color: transparent; 192 | left-color: transparent; 193 | } 194 | } 195 | 196 | min: { 197 | height: 65px; 198 | width: 65px; 199 | } 200 | 201 | margin: { 202 | top: -20px; 203 | right: -20px; 204 | } 205 | 206 | padding: { 207 | top: 12px; 208 | left: 34px; 209 | } 210 | 211 | font-size: 0.875rem; 212 | } 213 | 214 | &.program { 215 | background-color: $dark-slate-blue; 216 | border-top: { 217 | right-radius: 3px; 218 | left-radius: 3px; 219 | } 220 | 221 | color: $white; 222 | box-sizing: border-box; 223 | 224 | .card-partner, 225 | .card-title { 226 | color: $white; 227 | } 228 | 229 | .card-link:focus { 230 | outline: none; 231 | 232 | .card-title { 233 | outline: 1px dotted $white; 234 | } 235 | } 236 | 237 | .type { 238 | display: block; 239 | font: { 240 | size: 0.875rem; 241 | weight: $font-weight-bold; 242 | } 243 | 244 | margin: { 245 | top: -12px; 246 | right: -12px; 247 | } 248 | } 249 | } 250 | } 251 | 252 | .card-footer { 253 | display: block; 254 | color: $sapphire; 255 | width: 100%; 256 | border-top: $light-border; 257 | box-sizing: border-box; 258 | background-color: $white; 259 | height: 41px; 260 | 261 | &.btn { 262 | padding: 10px 20px; 263 | background-color: $white; 264 | color: $sapphire; 265 | justify-content: space-between; 266 | box-sizing: border-box; 267 | } 268 | 269 | &:hover, 270 | &.focus-within, 271 | &.active { 272 | background-color: $ice-blue; 273 | } 274 | 275 | &.expanded-true { 276 | background-color: $ice-blue; 277 | font-weight: $font-weight-bold; 278 | } 279 | 280 | .label-wrapper { 281 | display: flex; 282 | justify-content: space-between; 283 | } 284 | } 285 | 286 | .card-stats { 287 | padding: 10px 20px; 288 | height: 60px; 289 | } 290 | } 291 | } 292 | } 293 | -------------------------------------------------------------------------------- /scss/edx/overrides/_alerts.scss: -------------------------------------------------------------------------------- 1 | .alert { 2 | padding: 0.75rem 0.75rem; 3 | } 4 | 5 | .alert-success, 6 | .alert-danger, 7 | .alert-warning, 8 | .alert-info { 9 | border: none; 10 | color: $body-color; 11 | 12 | .alert-link { 13 | color: $body-color; 14 | } 15 | } 16 | 17 | .alert-success { 18 | background: $fill-success; 19 | } 20 | 21 | .alert-danger { 22 | background: $fill-danger; 23 | } 24 | 25 | .alert-warning { 26 | background: $fill-warning; 27 | } 28 | 29 | .alert-info { 30 | background: $fill-info; 31 | } 32 | 33 | 34 | .alert-dismissible .close { 35 | color: $link-color; 36 | opacity: 1; 37 | padding: 0.65rem 1rem; 38 | 39 | @include hover { 40 | color: $link-hover-color; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /scss/edx/overrides/_badges.scss: -------------------------------------------------------------------------------- 1 | .badge { 2 | @badge-pill; 3 | } 4 | -------------------------------------------------------------------------------- /scss/edx/overrides/_buttons.scss: -------------------------------------------------------------------------------- 1 | .btn { 2 | text-decoration: none; 3 | } 4 | 5 | .btn-link { 6 | text-decoration: $link-decoration; 7 | 8 | &.hover, 9 | &:hover, { 10 | text-decoration: $link-hover-decoration; 11 | } 12 | 13 | &.focus, 14 | &:focus { 15 | outline: 1px dotted; 16 | outline: 5px auto -webkit-focus-ring-color; 17 | text-decoration: $link-hover-decoration; 18 | } 19 | } 20 | 21 | // Add focus outlines to all of them. Box shadow focus is turned off in variables. 22 | 23 | @each $color, $value in $theme-colors { 24 | .btn-#{$color}, 25 | .btn-outline-#{$color}, 26 | .btn-inverse-#{$color} { 27 | &:not(:disabled):not(.disabled), 28 | &:not(:disabled):not(.disabled):active, 29 | &:not(:disabled):not(.disabled).active, 30 | &:active, 31 | &.active { 32 | &.focus, 33 | &:focus { 34 | position: relative; 35 | &:before { 36 | content: ''; 37 | position: absolute; 38 | top: -6px; 39 | left: -6px; 40 | bottom: -6px; 41 | right: -6px; 42 | border:solid 2px saturate(blend-transparent($value, white, 0.65), 10%); 43 | border-radius: 40rem; 44 | } 45 | box-shadow: none; 46 | } 47 | } 48 | } 49 | 50 | .btn-#{$color} { 51 | &:hover { 52 | background: darken($value, 10%); 53 | } 54 | } 55 | 56 | .btn-outline-#{$color} { 57 | &:hover { 58 | color: darken($value, 10%); 59 | border-color: darken($value, 10%); 60 | background: desaturate(blend-transparent($value, white, 0.065), 5%); 61 | } 62 | &:not(:disabled):not(.disabled) { 63 | &:active, 64 | &.active { 65 | color: darken($value, 10%); 66 | border-color: darken($value, 10%); 67 | background: desaturate(blend-transparent($value, white, 0.065), 5%); 68 | } 69 | } 70 | } 71 | 72 | .btn-inverse-#{$color} { 73 | &:hover { 74 | color: darken($value, 10%); 75 | background: desaturate(blend-transparent($value, white, 0.065), 5%); 76 | } 77 | &:not(:disabled):not(.disabled), 78 | &:not(:disabled):not(.disabled):active, 79 | &:not(:disabled):not(.disabled).active, 80 | &:active, 81 | &.active { 82 | &:focus, 83 | &.focus { 84 | border-color: transparent; 85 | &:before { 86 | border:solid 2px rgba(white, .75); 87 | } 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /scss/edx/overrides/_dropdowns.scss: -------------------------------------------------------------------------------- 1 | .dropdown-menu { 2 | box-shadow: $box-shadow; 3 | } 4 | .dropdown-item { 5 | text-decoration: none; 6 | } -------------------------------------------------------------------------------- /scss/edx/overrides/_grid.scss: -------------------------------------------------------------------------------- 1 | .container, 2 | .container-fluid { 3 | max-width: 1440px; 4 | padding-left: $grid-gutter-width; 5 | padding-right: $grid-gutter-width; 6 | } 7 | -------------------------------------------------------------------------------- /scss/edx/overrides/_modals.scss: -------------------------------------------------------------------------------- 1 | .modal-content { 2 | box-shadow: $box-shadow; 3 | border: solid 1px #d6dbe0; 4 | } 5 | 6 | .modal-footer { 7 | justify-content: flex-start; 8 | padding-bottom: 1.75rem; 9 | padding-top: 0.75rem; 10 | } 11 | -------------------------------------------------------------------------------- /scss/edx/overrides/_navs.scss: -------------------------------------------------------------------------------- 1 | .nav-link { 2 | &.active { 3 | color: $gray-900; 4 | text-decoration: none; 5 | font-weight: $font-weight-semi-bold; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /scss/edx/overrides/_typography.scss: -------------------------------------------------------------------------------- 1 | body { 2 | -webkit-font-smoothing: antialiased; 3 | -moz-osx-font-smoothing: grayscale; 4 | } 5 | 6 | .display-1, 7 | .display-2, 8 | .display-3, 9 | .display-4 { 10 | font-family: $font-family-serif; 11 | font-weight: $font-weight-bold; 12 | line-height: 1.111111111111111; // 80px 13 | } 14 | 15 | h1, 16 | .h1 { 17 | font-family: $font-family-serif; 18 | font-weight: $font-weight-bold; 19 | } 20 | 21 | h2, 22 | h3, 23 | h4, 24 | .h2, 25 | .h3, 26 | .h4, { 27 | font-weight: $font-weight-semi-bold; 28 | } 29 | 30 | h5, 31 | h6, 32 | .h5, 33 | .h6 { 34 | font-weight: $font-weight-bold; 35 | } 36 | 37 | label { 38 | line-height: $headings-line-height; 39 | font-weight: $headings-font-weight; 40 | } 41 | 42 | small, 43 | .small { 44 | line-height: 1.428571428571429; // 20px 45 | } 46 | 47 | @mixin mobile-type { 48 | .display-1, 49 | .display-2, 50 | .display-3, 51 | .display-4, 52 | h1, .h1 { 53 | font-size: 2rem; 54 | line-height: $headings-line-height; 55 | } 56 | h2, .h2 { 57 | font-size: 1.75rem; 58 | } 59 | h3, .h3 { 60 | font-size: 1.5rem; 61 | } 62 | h4, .h4 { 63 | font-size: 1.375rem; 64 | } 65 | } 66 | 67 | @media (max-width: map-get($grid-breakpoints, "sm")) { 68 | @include mobile-type; 69 | } 70 | -------------------------------------------------------------------------------- /scss/edx/theme.scss: -------------------------------------------------------------------------------- 1 | @import "fonts"; 2 | @import "~bootstrap/scss/functions"; 3 | @import "functions"; 4 | @import "variables"; 5 | @import "../core/core"; 6 | @import "overrides"; 7 | -------------------------------------------------------------------------------- /scss/open-edx/_fonts.scss: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css?family=Roboto:300,400,500,700"); 2 | -------------------------------------------------------------------------------- /scss/open-edx/_overrides.scss: -------------------------------------------------------------------------------- 1 | @import "./overrides/alerts"; 2 | @import "./overrides/badges"; 3 | @import "./overrides/buttons"; 4 | @import "./overrides/dropdowns"; 5 | @import "./overrides/grid"; 6 | @import "./overrides/modals"; 7 | @import "./overrides/typography"; 8 | @import "./overrides/tables"; 9 | @import "./overrides/navs"; 10 | 11 | @import "./custom/edx-custom-card"; 12 | -------------------------------------------------------------------------------- /scss/open-edx/custom/_edx-custom-card.scss: -------------------------------------------------------------------------------- 1 | $charcoal-grey: #393f43 !default; 2 | $dark-slate-blue: #17285d !default; 3 | $ice-blue: #f5f8ff !default; 4 | $sapphire: #23419f !default; 5 | $silver: #d6dbe0 !default; 6 | $slate-grey: #636c72 !default; 7 | $light-border: 1px solid $silver !default; 8 | $edx-shadow-color: rgba(0, 0, 0, 0.3) !default; 9 | 10 | @mixin edx-shadow { 11 | box-shadow: 0 2px 2px 0 $edx-shadow-color; 12 | } 13 | 14 | .edx-custom { 15 | &.card { 16 | border: { 17 | top: $light-border; 18 | bottom: 0; 19 | left: 0; 20 | right: 0; 21 | radius: unset; 22 | } 23 | 24 | .card-content { 25 | display: flex; 26 | flex-direction: column; 27 | font-family: $font-family-sans-serif; 28 | } 29 | 30 | .card-title { 31 | text-decoration: underline; 32 | } 33 | 34 | .card-body { 35 | padding: 15px 20px; 36 | 37 | .card-title { 38 | text-decoration: underline; 39 | margin: 0 0 5px; 40 | font: { 41 | size: 1.25rem; 42 | weight: $font-weight-normal; 43 | } 44 | 45 | padding-bottom: 10px; 46 | line-height: 1.5; 47 | } 48 | 49 | .card-partner { 50 | font-size: 1rem; 51 | 52 | @include media-breakpoint-up(lg) { 53 | font-size: 0.875rem; 54 | } 55 | 56 | @include media-breakpoint-up(xl) { 57 | font-size: 1rem; 58 | } 59 | } 60 | } 61 | 62 | .card-footer, 63 | .out-of, 64 | .type, 65 | .card-overlay { 66 | display: none; 67 | } 68 | 69 | .card-stats { 70 | width: 100%; 71 | display: flex; 72 | justify-content: space-between; 73 | 74 | align: { 75 | items: flex-end; 76 | self: flex-end; 77 | } 78 | 79 | padding: { 80 | left: 20px; 81 | right: 20px; 82 | } 83 | 84 | color: $charcoal-grey; 85 | font-size: 1rem; 86 | 87 | .course-count { 88 | margin-right: 20px; 89 | } 90 | } 91 | 92 | @include media-breakpoint-up(sm) { 93 | @include edx-shadow(); 94 | 95 | border: $light-border; 96 | border-radius: 4px; 97 | 98 | .card-content { 99 | height: 190px; 100 | 101 | &:hover, 102 | &:focus-within, 103 | &:active { 104 | background-color: $ice-blue; 105 | } 106 | } 107 | 108 | .card-overlay { 109 | display: block; 110 | top: 100%; 111 | bottom: 0; 112 | left: 0; 113 | right: 0; 114 | width: 100%; 115 | z-index: 1; 116 | border-color: $silver; 117 | 118 | &::after { 119 | content: ""; 120 | width: 28px; 121 | height: 28px; 122 | background: $ice-blue; 123 | position: absolute; 124 | top: -14px; 125 | right: calc(50% - 14px); 126 | transform: rotate(45deg); 127 | 128 | border: { 129 | left: 2px solid $silver; 130 | top: 2px solid $silver; 131 | } 132 | } 133 | 134 | .card-overlay-link { 135 | text-decoration: underline; 136 | color: $sapphire; 137 | } 138 | 139 | .card-overlay-body { 140 | background: $ice-blue; 141 | font-size: 1rem; 142 | color: $slate-grey; 143 | padding: 20px; 144 | border: $light-border; 145 | border-radius: 4px; 146 | 147 | .h5 { 148 | font: { 149 | size: 1rem; 150 | weight: $font-weight-bold; 151 | } 152 | } 153 | } 154 | 155 | .card-overlay-close { 156 | right: 0%; 157 | top: 0%; 158 | background: none; 159 | } 160 | } 161 | 162 | .card-body { 163 | height: 125px; 164 | padding: 20px; 165 | 166 | .card-title { 167 | padding-bottom: 0; 168 | } 169 | 170 | .h6 { 171 | font-size: 1rem; 172 | } 173 | 174 | .out-of { 175 | display: block; 176 | color: $white; 177 | position: relative; 178 | z-index: 0; 179 | border-radius: 0 4px 0 0; 180 | overflow: hidden; 181 | 182 | &::before { 183 | content: ''; 184 | position: absolute; 185 | top: 0; 186 | right: 0; 187 | z-index: -1; 188 | border: 32px solid $dark-slate-blue; 189 | 190 | border: { 191 | bottom-color: transparent; 192 | left-color: transparent; 193 | } 194 | } 195 | 196 | min: { 197 | height: 65px; 198 | width: 65px; 199 | } 200 | 201 | margin: { 202 | top: -20px; 203 | right: -20px; 204 | } 205 | 206 | padding: { 207 | top: 12px; 208 | left: 34px; 209 | } 210 | 211 | font-size: 0.875rem; 212 | } 213 | 214 | &.program { 215 | background-color: $dark-slate-blue; 216 | border-top: { 217 | right-radius: 3px; 218 | left-radius: 3px; 219 | } 220 | 221 | color: $white; 222 | box-sizing: border-box; 223 | 224 | .card-partner, 225 | .card-title { 226 | color: $white; 227 | } 228 | 229 | .card-link:focus { 230 | outline: none; 231 | 232 | .card-title { 233 | outline: 1px dotted $white; 234 | } 235 | } 236 | 237 | .type { 238 | display: block; 239 | font: { 240 | size: 0.875rem; 241 | weight: $font-weight-bold; 242 | } 243 | 244 | margin: { 245 | top: -12px; 246 | right: -12px; 247 | } 248 | } 249 | } 250 | } 251 | 252 | .card-footer { 253 | display: block; 254 | color: $sapphire; 255 | width: 100%; 256 | border-top: $light-border; 257 | box-sizing: border-box; 258 | background-color: $white; 259 | height: 41px; 260 | 261 | &.btn { 262 | padding: 10px 20px; 263 | background-color: $white; 264 | color: $sapphire; 265 | justify-content: space-between; 266 | box-sizing: border-box; 267 | } 268 | 269 | &:hover, 270 | &.focus-within, 271 | &.active { 272 | background-color: $ice-blue; 273 | } 274 | 275 | &.expanded-true { 276 | background-color: $ice-blue; 277 | font-weight: $font-weight-bold; 278 | } 279 | 280 | .label-wrapper { 281 | display: flex; 282 | justify-content: space-between; 283 | } 284 | } 285 | 286 | .card-stats { 287 | padding: 10px 20px; 288 | height: 60px; 289 | } 290 | } 291 | } 292 | } 293 | -------------------------------------------------------------------------------- /scss/open-edx/overrides/_alerts.scss: -------------------------------------------------------------------------------- 1 | .alert { 2 | padding: 0.75rem 0.75rem; 3 | } 4 | 5 | .alert-success, 6 | .alert-danger, 7 | .alert-warning, 8 | .alert-info { 9 | border: none; 10 | color: $body-color; 11 | 12 | .alert-link { 13 | color: $body-color; 14 | } 15 | } 16 | 17 | .alert-success { 18 | background: $fill-success; 19 | } 20 | 21 | .alert-danger { 22 | background: $fill-danger; 23 | } 24 | 25 | .alert-warning { 26 | background: $fill-warning; 27 | } 28 | 29 | .alert-info { 30 | background: $fill-info; 31 | } 32 | 33 | 34 | .alert-dismissible .close { 35 | color: $link-color; 36 | opacity: 1; 37 | padding: 0.65rem 1rem; 38 | 39 | @include hover { 40 | color: $link-hover-color; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /scss/open-edx/overrides/_badges.scss: -------------------------------------------------------------------------------- 1 | .badge { 2 | @badge-pill; 3 | } 4 | -------------------------------------------------------------------------------- /scss/open-edx/overrides/_buttons.scss: -------------------------------------------------------------------------------- 1 | .btn { 2 | text-decoration: none; 3 | } 4 | 5 | .btn-link { 6 | text-decoration: $link-decoration; 7 | 8 | &.hover, 9 | &:hover, { 10 | text-decoration: $link-hover-decoration; 11 | } 12 | 13 | &.focus, 14 | &:focus { 15 | outline: 1px dotted; 16 | outline: 5px auto -webkit-focus-ring-color; 17 | text-decoration: $link-hover-decoration; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /scss/open-edx/overrides/_dropdowns.scss: -------------------------------------------------------------------------------- 1 | .dropdown-menu { 2 | box-shadow: $box-shadow; 3 | } 4 | .dropdown-item { 5 | text-decoration: none; 6 | } -------------------------------------------------------------------------------- /scss/open-edx/overrides/_grid.scss: -------------------------------------------------------------------------------- 1 | .container, 2 | .container-fluid { 3 | max-width: 1440px; 4 | padding-left: $grid-gutter-width; 5 | padding-right: $grid-gutter-width; 6 | } 7 | -------------------------------------------------------------------------------- /scss/open-edx/overrides/_modals.scss: -------------------------------------------------------------------------------- 1 | .modal-content { 2 | box-shadow: $box-shadow; 3 | border: solid 1px #d6dbe0; 4 | } 5 | 6 | .modal-footer { 7 | justify-content: flex-start; 8 | padding-bottom: 1.75rem; 9 | padding-top: 0.75rem; 10 | } 11 | -------------------------------------------------------------------------------- /scss/open-edx/overrides/_navs.scss: -------------------------------------------------------------------------------- 1 | .nav-link { 2 | &.active { 3 | color: $gray-900; 4 | text-decoration: none; 5 | font-weight: $font-weight-semi-bold; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /scss/open-edx/overrides/_tables.scss: -------------------------------------------------------------------------------- 1 | @mixin table-border-top() { 2 | border-top: 1px solid $gray-300; 3 | } 4 | 5 | @mixin table-border-right() { 6 | border-right: 1px solid $gray-300; 7 | } 8 | 9 | .table { 10 | border: 1px solid $gray-300; 11 | 12 | th { 13 | @include table-border-top; 14 | @include table-border-right; 15 | } 16 | 17 | td { 18 | @include table-border-top; 19 | @include table-border-right; 20 | } 21 | 22 | thead th { 23 | @include table-border-right; 24 | 25 | border-bottom: 1px solid $gray-300; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scss/open-edx/overrides/_typography.scss: -------------------------------------------------------------------------------- 1 | body { 2 | -webkit-font-smoothing: antialiased; 3 | -moz-osx-font-smoothing: grayscale; 4 | } 5 | 6 | .display-1, 7 | .display-2, 8 | .display-3, 9 | .display-4, 10 | h1, 11 | .h1 { 12 | letter-spacing: -0.025em; 13 | } 14 | 15 | h2, 16 | .h2 { 17 | font-weight: $font-weight-normal; 18 | letter-spacing: -0.0125em; 19 | } 20 | 21 | h3, 22 | h4, 23 | h5, 24 | h6, 25 | .h3, 26 | .h4, 27 | .h5, 28 | .h6 { 29 | font-family: $font-family-sans-serif; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /scss/open-edx/theme.scss: -------------------------------------------------------------------------------- 1 | @import "fonts"; 2 | @import "~bootstrap/scss/functions"; 3 | @import "variables"; 4 | @import "../core/core"; 5 | @import "overrides"; 6 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { BrowserRouter, Route, NavLink, Routes } from 'react-router-dom'; 3 | import { HashLink } from 'react-router-hash-link'; 4 | 5 | import Basics from './pages/Basics'; 6 | import Navigation from './pages/Navigation'; 7 | import Forms from './pages/Forms'; 8 | import Miscellaneous from './pages/Miscellaneous'; 9 | import Overview from './pages/Overview'; 10 | import Examples from './pages/Examples'; 11 | import GettingStarted from './pages/GettingStarted'; 12 | 13 | import Alerts from './pages/bootstrap/Alerts'; 14 | import Badge from './pages/bootstrap/Badge'; 15 | import Cards from './pages/bootstrap/Cards'; 16 | import Collapse from './pages/bootstrap/Collapse'; 17 | import Dropdowns from './pages/bootstrap/Dropdowns'; 18 | import Grid from './pages/bootstrap/Grid'; 19 | import Modal from './pages/bootstrap/Modal'; 20 | import Pagination from './pages/bootstrap/Pagination'; 21 | import Popovers from './pages/bootstrap/Popovers'; 22 | import Progress from './pages/bootstrap/Progress'; 23 | import Tables from './pages/bootstrap/Tables'; 24 | 25 | class App extends Component { 26 | render() { 27 | return ( 28 | 29 |
30 |
31 |
32 |
33 |
34 | edX Bootstrap 35 |
36 |
    37 |
  • 38 | Overview 39 |
  • 40 |
  • 41 | Getting Started 42 |
  • 43 |
44 | 45 |
46 | Basics 47 |
48 |
    49 |
  • 50 | Colors 51 |
  • 52 |
  • 53 | Typography 54 |
  • 55 |
  • 56 | Buttons 57 |
  • 58 |
  • 59 | Links 60 |
  • 61 |
  • 62 | Icons 63 |
  • 64 |
65 |
66 | Navigation 67 |
68 |
    69 |
  • 70 | Breadcrumbs 71 |
  • 72 |
  • 73 | Navs 74 |
  • 75 |
  • 76 | Tabs 77 |
  • 78 |
  • 79 | Search 80 |
  • 81 |
82 |
Content
83 |
    84 |
  • 85 | Forms 86 |
  • 87 |
  • 88 | Cards 89 |
  • 90 |
  • 91 | Alerts 92 |
  • 93 |
  • 94 | Badge 95 |
  • 96 |
  • 97 | Dropdowns 98 |
  • 99 |
  • 100 | Modal 101 |
  • 102 |
  • 103 | Pagination 104 |
  • 105 |
  • 106 | Tables 107 |
  • 108 |
109 |
110 | Miscellaneous 111 |
112 |
    113 |
  • 114 | Spinners / Loaders 115 |
  • 116 |
117 |
118 | Examples 119 |
120 |
    121 |
  • 122 | Example 1 123 |
  • 124 |
125 | 126 |
In Progress Components
127 |
    128 |
  • 129 | Grid 130 |
  • 131 |
  • 132 | Popovers 133 |
  • 134 |
  • 135 | Collapse 136 |
  • 137 |
  • 138 | Progress 139 |
  • 140 |
141 | 142 |
External Links
143 | 156 |
157 | 158 | } /> 159 | } /> 160 | } /> 161 | 162 | {/* Basics */} 163 | } /> 164 | } /> 165 | } /> 166 | } /> 167 | } /> 168 | 169 | {/* Navigation */} 170 | } /> 171 | } /> 172 | } /> 173 | } /> 174 | } /> 175 | 176 | {/* Content */} 177 | } /> 178 | } /> 179 | } /> 180 | } /> 181 | } /> 182 | } /> 183 | } /> 184 | } /> 185 | 186 | {/* Miscellaneous */} 187 | } /> 188 | } /> 189 | 190 | {/* Examples */} 191 | } /> 192 | 193 | {/* Bootstrap documentation pages */} 194 | } /> 195 | } /> 196 | } /> 197 | } /> 198 | 199 |
200 |
201 |
202 |
203 | ); 204 | } 205 | } 206 | 207 | export default App; 208 | -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /src/DocSection.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | export default function DocSection(props) { 5 | return ( 6 | 7 | Section 8 |
9 |

{props.title}

10 | {props.children} 11 |
12 |
13 | ); 14 | } 15 | 16 | DocSection.propTypes = { 17 | id: PropTypes.string.isRequired, 18 | title: PropTypes.string.isRequired 19 | }; 20 | -------------------------------------------------------------------------------- /src/Header.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default class Header extends React.Component { 4 | constructor(props) { 5 | super(props); 6 | } 7 | 8 | render() { 9 | return ( 10 |
11 | edX Bootstrap 12 | 13 |
14 | 19 |
20 | 21 | 29 |
30 | 31 | ); 32 | } 33 | } -------------------------------------------------------------------------------- /src/ScrollToTop.js: -------------------------------------------------------------------------------- 1 | import { useEffect } from 'react'; 2 | import { useLocation } from 'react-router-dom'; 3 | 4 | const ScrollToTop = ({ children }) => { 5 | const location = useLocation(); 6 | 7 | useEffect(() => { 8 | window.scrollTo(0, 0); 9 | }, [location.pathname]); 10 | 11 | return children; 12 | } 13 | 14 | export default ScrollToTop; 15 | -------------------------------------------------------------------------------- /src/common/MeasuredItem.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import _ from 'lodash'; 3 | 4 | export default class MeasuredItem extends React.Component { 5 | constructor(props) { 6 | super(props); 7 | 8 | this.state = { 9 | ..._.zipObject(Object.keys(this.props.styles)) 10 | } 11 | this.item = React.createRef(); 12 | } 13 | 14 | componentDidMount() { 15 | const computedStyle = getComputedStyle(this.item.current); 16 | const styleNames = Object.keys(this.props.styles); 17 | 18 | this.setState({ 19 | ..._.zipObject(styleNames, _.map(styleNames, (styleName) => computedStyle.getPropertyValue(styleName) )), 20 | }); 21 | } 22 | 23 | render() { 24 | const child = React.cloneElement(this.props.renderItem(this.props, this.state), { ref: this.item }); 25 | return ( 26 | 27 | {this.props.before ? this.props.renderValues(this.state) : null} 28 | {child} 29 | {this.props.after ? this.props.renderValues(this.state) : null} 30 | 31 | ); 32 | } 33 | } -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | 4 | import './index.scss'; 5 | import App from './App'; 6 | 7 | ReactDOM.render(, document.getElementById('root')); 8 | -------------------------------------------------------------------------------- /src/index.scss: -------------------------------------------------------------------------------- 1 | @import "../scss/edx/theme"; 2 | @import "./scss/bootstrap-docs-4-2/docs"; 3 | 4 | 5 | .btn-clipboard { 6 | display: none; 7 | } 8 | 9 | .bd-sidebar { 10 | overflow-y: auto; 11 | .nav > li > a { 12 | &.active { 13 | font-weight: bold; 14 | color: $primary; 15 | } 16 | text-decoration: none; 17 | &:hover { 18 | text-decoration: underline; 19 | } 20 | } 21 | a { 22 | text-decoration: none; 23 | &:hover { 24 | text-decoration: underline; 25 | } 26 | } 27 | } 28 | 29 | .color-card { 30 | box-shadow: inset 0 0 1px rgba(0,0,0,.2); 31 | } 32 | 33 | .color-label { 34 | margin-bottom: .25rem; 35 | } 36 | .text-swatch-sample { 37 | font-size: 2em; 38 | line-height: 1; 39 | margin-left: .5rem; 40 | } 41 | 42 | .bd-content { 43 | h5.section { 44 | margin: 1.5rem 0 1rem; 45 | @extend .h6; 46 | } 47 | } -------------------------------------------------------------------------------- /src/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/pages/Basics.ButtonsAndLinks.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; 3 | import { faCheckCircle } from '@fortawesome/free-solid-svg-icons'; 4 | 5 | 6 | export default function ButtonsAndLinks() { 7 | return ( 8 |
9 |
10 |
Buttons
11 |

Buttons are used as triggers for actions. There should only be one primary button per page.

12 | 13 |
14 |
15 | 16 |
17 |
18 | 19 |
20 |
26 | 27 |
28 |
29 |
30 | 31 |
32 |
Color Variants (Use sparingly)
33 | 34 |
35 | 36 | 37 | 38 | 39 |
40 | 41 |
42 | 43 | 44 | 45 | 46 |
47 |
48 | 49 |
50 |
Sizes
51 | 52 |
53 | 54 | 55 |
56 |
57 | 58 |
59 |
With Icons
60 | 61 |
62 | 66 | 70 |
71 |
72 | 73 | 74 | 75 |
76 | ); 77 | } -------------------------------------------------------------------------------- /src/pages/Basics.Colors.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import chroma from 'chroma-js'; 3 | 4 | const colors = { 5 | 'gray-900': { 6 | value: '#111', 7 | name: 'Gray 900', 8 | utilityClassName: 'gray-900', 9 | forBG: false, 10 | forText: true, 11 | }, 12 | 'gray-700': { 13 | value: '#414141', 14 | name: 'Gray 700', 15 | utilityClassName: 'gray-700', 16 | forBG: false, 17 | forText: true, 18 | }, 19 | 'gray-600': { 20 | value: 'rgba(65,65,65,.7)', 21 | name: 'Gray 600', 22 | utilityClassName: 'gray-600', 23 | forBG: false, 24 | forText: true, 25 | }, 26 | 'primary': { 27 | value: '#23419F', 28 | name: 'UI Blue (Primary)', 29 | utilityClassName: 'primary', 30 | forBG: true, 31 | forText: true, 32 | }, 33 | 'secondary': { 34 | value: '#45096B', 35 | name: 'UI Indigo (Secondary)', 36 | utilityClassName: 'secondary', 37 | forBG: true, 38 | forText: true, 39 | }, 40 | 'success': { 41 | value: '#008100', 42 | name: 'UI Success', 43 | utilityClassName: 'success', 44 | forBG: true, 45 | forText: true, 46 | }, 47 | 'info': { 48 | value: '#065784', 49 | name: 'Text Info', 50 | utilityClassName: 'info', 51 | forBG: false, 52 | forText: true, 53 | }, 54 | 'danger': { 55 | value: '#A2221D', 56 | name: 'UI Danger', 57 | utilityClassName: 'danger', 58 | forBG: true, 59 | forText: true, 60 | }, 61 | 'fill-success': { 62 | value: '#DFF0D8', 63 | name: 'Success Fill', 64 | utilityClassName: 'fill-success', 65 | forBG: true, 66 | forText: false, 67 | }, 68 | 'fill-info': { 69 | value: '#D8EDF8', 70 | name: 'Info Fill', 71 | utilityClassName: 'fill-info', 72 | forBG: true, 73 | forText: false, 74 | }, 75 | 'fill-danger': { 76 | value: '#F2DEDE', 77 | name: 'Danger Fill', 78 | utilityClassName: 'fill-danger', 79 | forBG: true, 80 | forText: false, 81 | }, 82 | 'fill-warning': { 83 | value: '#FCF8E2', 84 | name: 'Warning Fill', 85 | utilityClassName: 'fill-warning', 86 | forBG: true, 87 | forText: false, 88 | }, 89 | 'program-masters': { 90 | value: '#414141', 91 | name: 'Masters', 92 | utilityClassName: 'program-masters', 93 | forBG: true, 94 | forText: false, 95 | }, 96 | 'program-micro-masters': { 97 | value: '#065784', 98 | name: 'MicroMasters', 99 | utilityClassName: 'program-micro-masters', 100 | forBG: true, 101 | forText: false, 102 | }, 103 | 'program-prof-cert': { 104 | value: '#9A1F60', 105 | name: 'Professional Certificate', 106 | utilityClassName: 'program-prof-cert', 107 | forBG: true, 108 | forText: false, 109 | }, 110 | 'white': { 111 | value: '#fff', 112 | name: 'White', 113 | utilityClassName: 'white', 114 | forBG: true, 115 | forText: true, 116 | }, 117 | 'pale-gray': { 118 | value: '#FCFCFC', 119 | name: 'Pale Gray', 120 | utilityClassName: 'pale-gray', 121 | forBG: true, 122 | forText: false, 123 | }, 124 | 'pale-blue': { 125 | value: '#F5F8FF', 126 | name: 'Pale. Blue', 127 | utilityClassName: 'pale-blue', 128 | forBG: true, 129 | forText: false, 130 | }, 131 | 'pale-yellow': { 132 | value: '#FFFDF3', 133 | name: 'Pale Yellow', 134 | utilityClassName: 'pale-yellow', 135 | forBG: true, 136 | forText: false, 137 | }, 138 | 'yellow': { 139 | value: '#FFBF18', 140 | name: 'Accent Yellow', 141 | utilityClassName: 'yellow', 142 | forBG: true, 143 | forText: false, 144 | }, 145 | }; 146 | 147 | const textAndInteractiveColors = [ 148 | 'gray-900', 149 | 'gray-700', 150 | 'gray-600', 151 | 'primary', 152 | 'secondary', 153 | ]; 154 | 155 | const programColors = [ 156 | 'program-masters', 157 | 'program-micro-masters', 158 | 'program-prof-cert', 159 | ]; 160 | 161 | const accentColors = [ 162 | 'yellow', 163 | ]; 164 | 165 | const systemColorsBG = [ 166 | 'fill-success', 167 | 'fill-info', 168 | 'fill-danger', 169 | 'fill-warning', 170 | ]; 171 | 172 | const systemColorsUI = [ 173 | 'success', 174 | 'info', 175 | 'danger', 176 | ]; 177 | 178 | const bgColors = [ 179 | 'white', 180 | 'pale-gray', 181 | 'pale-blue', 182 | 'pale-yellow', 183 | ]; 184 | 185 | 186 | function Tile({children}) { 187 | return ( 188 |
189 | {children} 190 |
191 | ); 192 | } 193 | 194 | function Swatch({color, textColor, className, children, style}) { 195 | return
{children || color}
205 | } 206 | 207 | function TextSwatch({color, bgColor, className, children, style}) { 208 | return
{children || color}
219 | } 220 | 221 | export default function Colors() { 222 | const renderColor = (colorKey) => { 223 | const {name, value, forBG, forText } = colors[colorKey]; 224 | const contrastColor = chroma(value).luminance() > .5 ? '#111' : '#fff'; 225 | return ( 226 |
227 | 228 | 229 | {forBG ? : null} 230 | {forText ? {value} Aa : null} 231 | 232 |
233 | ); 234 | } 235 | 236 | return ( 237 |
238 |
Text & Interactive
239 |
{textAndInteractiveColors.map(renderColor)}
240 | 241 |
Program Specific
242 |
{programColors.map(renderColor)}
243 | 244 |
Accent
245 |
{accentColors.map(renderColor)}
246 | 247 |
System Colors
248 |
{systemColorsBG.map(renderColor)}
249 |
{systemColorsUI.map(renderColor)}
250 | 251 |
Backgrounds
252 |
{bgColors.map(renderColor)}
253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | {Object.keys(colors).map(colorKey => { 264 | const { 265 | name, 266 | value, 267 | utilityClassName, 268 | forText, 269 | forBG, 270 | } = colors[colorKey]; 271 | 272 | const contrastColor = chroma(value).luminance() > .5 ? '#000' : '#fff'; 273 | 274 | return ( 275 | 276 | 280 | 290 | 300 | 305 | 306 | ); 307 | })} 308 | 309 |
Name/ValueUtility Classes
277 | {name}
278 | {value} 279 |
281 | {forText ? ( 282 | 286 | .text-{utilityClassName} 287 | 288 | ) : null} 289 | 291 | {forBG ? ( 292 | 296 | .bg-{utilityClassName} 297 | 298 | ) : null} 299 | 301 | 302 | .border-{utilityClassName} 303 | 304 |
310 |
311 | ); 312 | } 313 | -------------------------------------------------------------------------------- /src/pages/Basics.MiscBasics.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | 4 | export default function MiscBasics() { 5 | return ( 6 |
7 |

Badges

8 |

9 | Primary 10 | Secondary 11 | Success 12 | Danger 13 | Warning 14 | Info 15 | Light 16 | Dark 17 |

18 | 19 | 20 |

Inline Text Decorations

21 |

OK Use the text-muted class to mute text.

22 |

OK Use the mark tag to highlight text.

23 |

OK Use strikethroughs for content that is no longer accurate or has been deleted.

24 |

Avoid Avoid using underlines for static elements

25 |

Use Sparingly Fine print text that is 80% smaller than normal.

26 |

OK This line is rendered as bold text.

27 |

AvoidItalicized text is difficult to read and hard to localize.

28 |
29 | ); 30 | } -------------------------------------------------------------------------------- /src/pages/Basics.Themes.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | 4 | export default function Themes() { 5 | return ( 6 |
7 | 8 |
9 | ); 10 | } -------------------------------------------------------------------------------- /src/pages/Basics.Typography.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import MeasuredItem from '../common/MeasuredItem'; 3 | 4 | export default function Typography() { 5 | const typeMeasurements = { 6 | 'font-family': null, 7 | 'font-weight': null, 8 | 'font-size': null, 9 | 'line-height': null, 10 | 'letter-spacing': null, 11 | }; 12 | 13 | const renderTypeItem = ({ name, tagClass, tag }) => { 14 | return ( 15 | { 20 | return React.createElement(tag, { className: tagClass + ' mb-0 type-scale-item-example' }, ( 21 | {name} 22 | )); 23 | }} 24 | renderValues={styleValues => { 25 | if (!styleValues['font-family']) return; 26 | 27 | const fontFamily = styleValues['font-family'].split(',')[0]; 28 | const fontSize = Math.round(parseFloat(styleValues['font-size'])); 29 | const lineHeight = Math.round(parseFloat(styleValues['line-height'])); 30 | let letterSpacing = styleValues['letter-spacing']; 31 | const fontWeight = styleValues['font-weight']; 32 | 33 | const getWeightName = (weight) => { 34 | if (weight < 400) return 'Light'; 35 | if (weight < 500) return 'Regular'; 36 | if (weight < 600) return 'Semi-bold'; 37 | return 'Bold'; 38 | } 39 | 40 | if (letterSpacing !== 'normal') { 41 | letterSpacing = (parseFloat(letterSpacing)/fontSize) + 'em'; 42 | } 43 | 44 | return ( 45 |
46 | {fontFamily} {getWeightName(fontWeight)} 47 |   • {fontSize}px / {lineHeight}px 48 | {letterSpacing !== 'normal' ? ` • ${letterSpacing}` : null} 49 |
50 | ); 51 | }} 52 | /> 53 | ); 54 | } 55 | 56 | return ( 57 |
58 |
{renderTypeItem({name: 'Display', tag: 'h1', tagClass: 'display-3'})}
59 |
{renderTypeItem({name: 'Heading 1', tag: 'h1', tagClass: ''})}
60 |
{renderTypeItem({name: 'Heading 2', tag: 'h2', tagClass: ''})}
61 |
{renderTypeItem({name: 'Heading 3', tag: 'h3', tagClass: ''})}
62 |
{renderTypeItem({name: 'Heading 4', tag: 'h4', tagClass: ''})}
63 |
{renderTypeItem({name: 'Heading 5', tag: 'h5', tagClass: ''})}
64 |
{renderTypeItem({name: 'Heading 6', tag: 'h6', tagClass: ''})}
65 |
66 |
{renderTypeItem({name: 'Large Paragraph', tag: 'p', tagClass: 'lead'})}
67 |
{renderTypeItem({name: 'Paragraph', tag: 'p', tagClass: ''})}
68 |
{renderTypeItem({name: 'Small ', tag: 'p', tagClass: 'small'})}
69 |
70 |
{renderTypeItem({name: 'Label ', tag: 'label'})}
71 |
72 | ); 73 | } -------------------------------------------------------------------------------- /src/pages/Basics.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Colors from './Basics.Colors'; 3 | import Typography from './Basics.Typography'; 4 | import ButtonsAndLinks from './Basics.ButtonsAndLinks'; 5 | import Themes from './Basics.Themes'; 6 | import MiscBasics from './Basics.MiscBasics'; 7 | import DocSection from '../DocSection'; 8 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; 9 | import { faCheckCircle, faInfoCircle } from '@fortawesome/free-solid-svg-icons'; 10 | 11 | export default class Basics extends React.Component { 12 | render() { 13 | return ( 14 |
15 |

Basics

16 |

Basic style elements.

17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Links
32 |

To navigate to a new page use a link instead. By default all links are primary blue and have underlines. Removing the underline is fine, but color must not be used as the only visual means of indicating interactivity.

33 | 39 |
40 |
41 | 42 |
43 |
44 |
To do:
45 |
    46 |
  • Add documentation on how buttons should be laid out: left aligned. primary first, others second.
  • 47 |
  • Flippable for RTL.
  • 48 |
49 |
50 |
51 |
52 | 53 | 54 |

Examples and usage guidelines for icon styles.

55 |

See Font Awesome (Free)

56 |
57 | 58 | 59 |

Examples and usage guidelines for miscellaneous elements.

60 | 61 |
62 | 63 | 64 |

Examples and usage guidelines for theming.

65 | 66 |
67 | 68 |
69 | ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/pages/Examples.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import DocSection from '../DocSection'; 3 | 4 | export default class Examples extends React.Component { 5 | render() { 6 | return ( 7 |
8 |

Examples

9 | 10 | 11 | 12 |

On the events
in question

13 | 20 |

On glancing over my notes of the seventy odd cases in which I have during the last eight years studied the methods of my friend Sherlock Holmes, I find many tragic, some comic, a large number merely strange, but none commonplace; for, working as he did rather for the love of his art than for the acquirement of wealth, he refused to associate himself with any investigation which did not tend towards the unusual, and even the fantastic.

21 |

What we know:

22 |

The events in question occurred in the early days of my association with Holmes:

23 |
    24 |
  • We were sharing rooms as bachelors in Baker Street.
  • 25 |
  • It is possible that I might have placed them upon record before.
  • 26 |
  • A promise of secrecy was made at the time.
  • 27 |
  • It was early in April in the year '83.
  • 28 |
29 |

30 | Solve the case 31 | Ask Watson 32 |

33 | 34 |
35 |
36 |
37 | 38 |
39 |

Not sure where to look?

40 |
41 | 42 |
43 |
44 |
45 | 48 |
49 |
50 |
51 |
52 |
53 | 54 | 60 |
61 |
62 |
63 |
64 | 65 |
66 |
67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/pages/Forms.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import DocSection from '../DocSection'; 4 | 5 | const defaultState = { 6 | email: '', 7 | password: '', 8 | mittens: false, 9 | boots: false, 10 | notMittensOrBoots: false, 11 | floofiness: null, 12 | catCount: 3, 13 | catName: '', 14 | birthday: '', 15 | nappingSpot: '', 16 | catPicture: '', 17 | }; 18 | 19 | export default class Forms extends React.Component { 20 | constructor(props) { 21 | super(props); 22 | 23 | this.state = { 24 | email: '', 25 | password: '', 26 | mittens: false, 27 | boots: false, 28 | notMittensOrBoots: false, 29 | floofiness: null, 30 | catCount: 3, 31 | catName: '', 32 | birthday: '', 33 | nappingSpot: '', 34 | catPicture: '', 35 | }; 36 | 37 | this.handleSubmit = this.handleSubmit.bind(this); 38 | this.handleChange = this.handleChange.bind(this); 39 | this.handleCancel = this.handleCancel.bind(this); 40 | } 41 | 42 | handleChange(event) { 43 | const { name } = event.target; 44 | const value = event.target.type === 'checkbox' ? event.target.checked : event.target.value; 45 | 46 | this.setState({ 47 | [name]: value, 48 | }); 49 | } 50 | 51 | handleSubmit(e) { 52 | this.validate(); 53 | 54 | e.preventDefault(); 55 | return false; 56 | } 57 | 58 | handleCancel(e) { 59 | this.setState(defaultState); 60 | e.preventDefault(); 61 | return false; 62 | } 63 | 64 | validate() {} 65 | 66 | render() { 67 | return ( 68 |
69 | 70 |

Notes

71 |
    72 |
  • 73 | Form groups should be stacked. Label first, then input, then help text below that. 74 |
  • 75 |
  • 76 | If there is an error state for the input, it should go below the input, above the help 77 | text. 78 |
  • 79 |
  • 80 | Error states should be included at the top of the form with anchor links down to the 81 | actual errored fields. 82 |
  • 83 |
84 |
85 |
86 |
87 | 99 |
100 |
101 | 113 |
Looks good!
114 | 115 | Your password must be 8-32 characters long, contain letters and numbers, and must 116 | not contain spaces, special characters, or emoji. 117 | 118 |
119 |
120 | 121 |
122 | 133 |
134 |
135 | 146 |
147 |
148 | 160 |
161 |
162 | 163 |
164 | 165 |
166 | 178 |
179 |
180 | 192 |
193 |
194 | 207 |
208 |
209 | 210 |
211 | 227 |
228 |
229 | 246 |
247 |
248 | 258 |
259 |
260 |