├── .gitignore ├── LICENSE.md ├── README.md ├── app.vue ├── assets └── scss │ └── main.scss ├── nuxt.config.ts ├── package-lock.json ├── package.json ├── pages └── index.vue ├── plugins └── useBootstrap.client.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | .nuxt 4 | nuxt.d.ts 5 | .output 6 | .env -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nuxt 3 Bootstrap 5 starter with customizable variables configured 2 | 3 | A optimized and barebones starterkit that removes a lot of the early setup of a new bootstrap project. 4 | 5 | Included: 6 | - Nuxt 3 7 | - Bootstrap 5 optimized installation and example variables overwritten + colors added to the scss theme (see main.scss) 8 | - Autoprefixer 9 | - Fiber 10 | - PostCSS 11 | - Sass 12 | 13 | ## Setup 14 | 15 | Make sure to install the dependencies 16 | 17 | ```bash 18 | npm install 19 | ``` 20 | 21 | ## Development 22 | 23 | Start the development server on http://localhost:3000 24 | 25 | ```bash 26 | npm dev 27 | ``` 28 | 29 | ## Production 30 | 31 | Build the application for production: 32 | 33 | ```bash 34 | npm build 35 | ``` 36 | 37 | Checkout the [deployment documentation](https://v3.nuxtjs.org/docs/deployment). 38 | 39 | ## License 40 | 41 | The code in this starter project is licensed under the MIT license. However, please note that any code that you add to this project will not be subject to this license and you are free to choose an appropriate open source license for your own code. Please make sure to update the license file accordingly and include a copy of the license in your project's repository. 42 | 43 | -------------------------------------------------------------------------------- /app.vue: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /assets/scss/main.scss: -------------------------------------------------------------------------------- 1 | // set theme colors 2 | $primary: #ce2127; 3 | $dark: #212121; 4 | $theme1: #33a8d1; 5 | 6 | @import "node_modules/bootstrap/scss/_functions"; 7 | @import "node_modules/bootstrap/scss/_variables"; 8 | @import "node_modules/bootstrap/scss/_mixins"; 9 | 10 | // add custom colors to the bootstrap theme 11 | $custom-theme-colors: ( 12 | "theme1": $theme1, 13 | "white": $white 14 | ); 15 | 16 | // fix for bootstrap 5.1 transposing colors 17 | $theme-colors: map-merge($theme-colors, $custom-theme-colors); 18 | $theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value"); 19 | 20 | // Overwrite bootstrap sass variables (check _variables for all options) 21 | $enable-negative-margins: true; 22 | $navbar-light-color: $dark; 23 | $font-family-base: 'Poppins', sans-serif; 24 | $font-size-base: .85rem; 25 | $input-btn-padding-x: 1rem; 26 | $border-radius: 2px; 27 | $link-color: $theme1; 28 | 29 | // Finally load bootstrap 30 | @import "node_modules/bootstrap/scss/bootstrap"; 31 | 32 | // Load a custom font 33 | @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,600;1,400;1,600&display=swap'); 34 | 35 | -------------------------------------------------------------------------------- /nuxt.config.ts: -------------------------------------------------------------------------------- 1 | import {defineNuxtConfig} from 'nuxt3' 2 | 3 | // https://v3.nuxtjs.org/docs/directory-structure/nuxt.config 4 | export default defineNuxtConfig({ 5 | css: [ 6 | '~/assets/scss/main.scss' 7 | ] 8 | }) 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nuxt-3-bootstrap-5-starter", 3 | "license": "MIT", 4 | "private": true, 5 | "scripts": { 6 | "dev": "nuxi dev", 7 | "build": "nuxi build", 8 | "start": "node .output/server/index.mjs" 9 | }, 10 | "devDependencies": { 11 | "autoprefixer": "^10.4.2", 12 | "fibers": "^5.0.0", 13 | "nuxt3": "latest", 14 | "postcss": "^8.4.5", 15 | "postcss-loader": "^6.2.1", 16 | "sass": "^1.48.0", 17 | "sass-loader": "^12.4.0" 18 | }, 19 | "dependencies": { 20 | "@popperjs/core": "^2.11.7", 21 | "bootstrap": "^5.2.3" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pages/index.vue: -------------------------------------------------------------------------------- 1 | 38 | 39 | 43 | -------------------------------------------------------------------------------- /plugins/useBootstrap.client.ts: -------------------------------------------------------------------------------- 1 | import * as bootstrap from 'bootstrap' 2 | 3 | export default defineNuxtPlugin(() => { 4 | return { 5 | provide: { 6 | bootstrap: bootstrap 7 | } 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // https://v3.nuxtjs.org/concepts/typescript 3 | "extends": "./.nuxt/tsconfig.json" 4 | } 5 | --------------------------------------------------------------------------------