Coder Social home page Coder Social logo

imklau / html-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 129 KB

🦾 Static HTML, CSS, JS boilerplate built with Parcel.

Home Page: https://imklau-html-boilerplate.netlify.app/

License: Do What The F*ck You Want To Public License

HTML 9.83% JavaScript 1.28% SCSS 88.28% Shell 0.61%
html html-boilerplate html-template scss parcel boilerplate frontend-boilerplate

html-boilerplate's Introduction

🦾 HTML boilerplate

Static HTML, CSS, JS boilerplate built with Parcel.

License: WTFPL Netlify Status

✨ Features

  • Dev server & hot reloading
  • Minifiers for JavaScript, CSS, HTML, and SVG
  • Image optimization
  • Linters for JS and SCSS
  • ITCSS architecture
  • normalize.css included

πŸš€ Quick start

Clone the repo:

git clone [email protected]:Noeemi/html-boilerplate.git <project-name>

and then run:

cd <project-name>
yarn
yarn start

πŸ‘©πŸ»β€πŸ’» Available commands:

  • yarn start - runs the app in the development mode. (localhost:1234 by default)
  • yarn build - builds the app for production, files are saved to the public folder
  • yarn lint - runs eslint to check all your files in the src directory
  • yarn format - runs prettier to format all your files in the src directory

🌳 Folder structure

β”œβ”€β”€ src
β”‚   β”œβ”€β”€ assets
β”‚   β”œβ”€β”€ js
β”‚   β”œβ”€β”€ styles
β”‚   β”‚  β”œβ”€β”€ components
β”‚   β”‚  β”œβ”€β”€ elements
β”‚   β”‚  β”œβ”€β”€ generic
β”‚   β”‚  β”œβ”€β”€ objects
β”‚   β”‚  β”œβ”€β”€ settings
β”‚   β”‚  β”œβ”€β”€ tools
β”‚   β”‚  β”œβ”€β”€ utilities
β”‚   β”‚  └── main.scss
β”‚   β”œβ”€β”€ index.html
β”‚   └── about.html
β”œβ”€β”€ package.json
β”œβ”€β”€ .eslintrc
└── .prettierrc

Production

The production mode automatically bundles and optimizes your application for production. It can be run using the build command: yarn build.

Minification

Minifiers for JavaScript, CSS, HTML, and SVG are included out of the box. By default, minification is enabled when using the build command.

Image optimization

Parcel supports resizing, converting, and optimizing images. You can use query parameters when referencing an image in HTML, CSS, or JavaScript to specify which format and size the image should be converted to.

<picture>
  <source
    type="image/webp"
    srcset="image.jpg?as=webp&width=400, image.jpg?as=webp&width=800 2x"
  />
  <source
    type="image/jpeg"
    srcset="image.jpg?width=400, image.jpg?width=800 2x"
  />
  <img src="image.jpg?width=400" width="400" />
</picture>

ITCSS

The SCSS file structure follows the ITCSS architecture.

ITCSS stands for Inverted Triangle CSS. It helps you organize your project CSS files in such a way that you can better deal with CSS specifics like global namespace, cascade and selectors specificity.

The main idea of ITCSS is that it separates your CSS codebase into several sections (called layers).

Those layers are:

  • Settings – used with preprocessors and contain font, colors definitions, etc.
  • Tools – globally used mixins and functions. It’s important not to output any CSS in the first 2 layers.
  • Generic – reset and/or normalize styles, box-sizing definition, etc. This is the first layer which generates actual CSS.
  • Elements – styling for bare HTML elements (like H1, A, etc.). These come with default styling from the browser so we can redefine them here.
  • Objects – class-based selectors which define undecorated design patterns, for example the media object known from OOCSS
  • Components – specific UI components. This is where most of our work takes place. We often compose UI components of Objects and Components
  • Utilities – utilities and helper classes with ability to override anything which goes before in the triangle, e.g. hide helper class

More information here

πŸ“ƒ License

This project is available under the WTFPL license.

html-boilerplate's People

Contributors

imklau avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.