All Projects → FernE97 → html5-blank-slate

FernE97 / html5-blank-slate

Licence: other
A blank starter theme that incorporates Bootstrap 5 with WordPress and Vite for frontend tooling.

Programming Languages

PHP
23972 projects - #3 most used programming language
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
CSS
56736 projects

Projects that are alternatives of or similar to html5-blank-slate

bootscore
Flexible Bootstrap 5 WordPress starter theme with full WooCommerce support
Stars: ✭ 160 (+661.9%)
Mutual labels:  wordpress-starter-theme, bootstrap5
react-boilerplate
React 18, React-Router, Typescript, Vite, Babel 7, React-Testing-Library, Vitest
Stars: ✭ 27 (+28.57%)
Mutual labels:  vitejs
insta-share
Instant File Sharing powered by IPFS Networks. Build with Vue 3 and ViteJS
Stars: ✭ 53 (+152.38%)
Mutual labels:  vitejs
vite-plugin-theme-preprocessor
css theme preprocessor plugin for vite
Stars: ✭ 144 (+585.71%)
Mutual labels:  vitejs
ui bibz
Ui Framework based on Bootstrap and Ruby on Rails
Stars: ✭ 13 (-38.1%)
Mutual labels:  bootstrap5
tofino
WordPress boilerplate theme on a modern stack. NPM and Composer.
Stars: ✭ 26 (+23.81%)
Mutual labels:  wordpress-starter-theme
vue-next-admin
🎉🎉🔥基于vue3.x 、Typescript、vite、Element plus等,适配手机、平板、pc 的后台开源免费模板库(vue2.x请切换vue-prev-admin分支)
Stars: ✭ 1,002 (+4671.43%)
Mutual labels:  vitejs
bootstrap-5-autocomplete
autocomplete/typeahead js plugin for bootstrap v5
Stars: ✭ 79 (+276.19%)
Mutual labels:  bootstrap5
bootstrap5-boilerplate
This is the ultimate Bootstrap 5 starter for developers. A boilerplate with Gulp4, cross-env, Sass, sourcemaps, concat, CSS & HTML minification, uglify, image optimization, template partials, BrowserSync.
Stars: ✭ 34 (+61.9%)
Mutual labels:  bootstrap5
branch
Branch Starter Theme - A WordPress starter theme based on Timber library and Bootstrap
Stars: ✭ 87 (+314.29%)
Mutual labels:  wordpress-starter-theme
jplayer-skin-audiocheck
A responsive HTML5 jPlayer skin with playlist.
Stars: ✭ 16 (-23.81%)
Mutual labels:  vitejs
startbootstrap-small-business
A Bootstrap HTML template for creating marketing websites for small businesses - created by Start Bootstrap
Stars: ✭ 186 (+785.71%)
Mutual labels:  bootstrap5
angular-httpclient
Angular 15 Example HttpClient
Stars: ✭ 21 (+0%)
Mutual labels:  bootstrap5
loopple
Drag & drop dashboard builder
Stars: ✭ 180 (+757.14%)
Mutual labels:  bootstrap5
luxe
Luxe is a WordPress starter theme using a modern workflow and best practices.
Stars: ✭ 22 (+4.76%)
Mutual labels:  wordpress-starter-theme
js from routes
🛣️ Generate path helpers and API methods from your Rails routes
Stars: ✭ 75 (+257.14%)
Mutual labels:  vitejs
avatar
Simple online tool for cropping images from an URL, your clipboard, or your disk.
Stars: ✭ 63 (+200%)
Mutual labels:  vitejs
Adminmart-lite
Free Bootstrap 5 Based Admin Dashboard Template to Build your dashboard in no time.
Stars: ✭ 41 (+95.24%)
Mutual labels:  bootstrap5
preview-pro
Use pro-layout in vitejs. preview https://sendya.github.io/preview-pro/index.html
Stars: ✭ 71 (+238.1%)
Mutual labels:  vitejs
dragonfly-dag
完全支持Vue3和Vitejs的DAG流程图组件
Stars: ✭ 54 (+157.14%)
Mutual labels:  vitejs

h5bs Theme

Requirements

NVM (Node Version Manager)

NVM is not required but is recommended for installing different node versions for various projects.

# install / update nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

# install latest LTS node version
nvm install --lts

# install latest LTS node version and migrate existing installed packages
nvm install 'lts/*' --reinstall-packages-from=current

# use latest LTS version
nvm use --lts

Setup

From the console, change directories into the WordPress theme.

cd {path}/wp-content/themes/{theme_name}

Run npm install to install the dependencies from package.json

npm install

Local development

Vite is used as a build tool to handle the frontend tooling. When working locally you will run npm run dev to start the dev server and it will handle compiling the JavaScript and SCSS and will inject those changes automatically. It is also set up to auto-reload when any changes are made to the php files. If you need to add any extra php paths to watch, you can edit the vite.config.js file under plugins and liveReload.

# start dev server
npm run dev

The src/main.js is set up as the main entry point. This file will be used to import SCSS as well as JavaScript. This is pulled into the theme by the vite('main.js') function in the header.php file. If you need to add multiple entry points, you can edit the vite.config.js file under build: rollupOptions:. Once that is added you will then need to add an additional vite('secondary.js') function to the header.php file to pull in the new file.

// single entry point
// ...
build: {
  rollupOptions: {
    input: '/main.js',
  },
}
// ...

// multiple entry points
// ...
build: {
  rollupOptions: {
    input: {
      main: '/main.js',
      secondary: '/secondary/js',
    }
  },
}
// ...

npm run build will compile all of the assets into the dist folder at the root. The dist folder will then need to be uploaded to the production server when ready. The is_development() function under lib/assets.php is used to determine if the app is running in a development environment or production environment. If you need to test the production assets in the dist folder you can temporarily update the is_development() function to return false.

# build for production
npm run build

Images

There is an @images alias set up for the /src/assets/images path. This can be used in both SCSS and JS files. You can add additional path aliases in the vite.config.js file such as @fonts if needed.

body {
  background-image: url('@images/bg-image.jpg');
}
import bgImage from '@images/bg-image.jpg'

document.body.style.backgroundImage = `url(${bgImage})`

External packages

Use npm to manage packages. For example if you wanted to add axios to a project you would run npm i axios which would add axios as a dependency to the package.json file and to your node_modules folder.

npm i axios

To include it in the project, at the top of your JavaScript file add an import.

import axios from 'axios'

Then use as intended.

axios
  .get('https://jsonplaceholder.typicode.com/users/1')
  .then((response) => {
    // handle success
    console.log(response)
  })
  .catch((error) => {
    // handle error
    console.log(error)
  })

Linters

You can use the recommended VS Code extensions to have real-time linting errors and fixes in your editor. Search for @recommended in the extensions tab. Or you can run the following commands to lint the JavaScript or SCSS files.

# run eslint on JS files
npx eslint "src/**/*.js" --fix

# run stylelint on SCSS files
npx stylelint "src/**/*.scss" --fix
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].