A tiny, modular, and scalable CSS framework base on BEMIT architecture

Lightweight

Core ~7kb only (min + gzip)

🗂️ Modular & Scalable

Build for modularity and scalability

🔻 BEM & ITCSS

Structure your CSS with BEMIT

# Installation

There are 3 ways to get started with Vodka CSS. You can either install manually, from CDN or use package managers.

Manuall Install

Download the compiled and minified Vodka CSS file (core ~7KB min + gzip).

Download Vodka

Include vodka.min.css located in /dist folder in your website or web app.

Install from CDN

Alternatively, you can use the unpkg CDN to load compiled Vodka CSS.

Install with NPM

Install with Yarn

# Custom Build

You can customize your version of Vodka CSS by editing sass files in /src/scss directory or removing unneeded components from .scss source files.

Compiling CSS

Vodka uses Parcel for compiling CSS.

First, you need to install NPM, which is used to manage scripts and other dependencies.

Then, you can build the CSS file from the command line:

  1. Navigate to the root directory of Vodka.
  2. Run npm install NPM will install all dev dependencies as listed in package.json.
  3. When completed, run npm run build to compile SCSS to CSS and minify files.
  4. You can find compiled CSS files in /dist directory.

Other available NPM scripts:

  • npm run develop — Watch files for changes and re-compile CSS files.
  • npm run build — Compile SCSS to CSS and minify files.

Importing SASS

It is recommended to customize Vodka by importing sass source files to your projects. In this way, you can keep Vodka up to date without conflicts, since Vodka code and your custom code are separate.

  • First, create your own project and install Vodka via NPM.
  • Then create your project-name.scss file in the root folder. You can use project-name.scss to define your variables.

Alternatively, you can create custom _variables.scss and import it to project-name.scss.

Folder Structure

# Browser Support

Vodka uses Autoprefixer to make most styles compatible with earlier browsers and Normalize.css for CSS resets.

Vodka is designed for modern browsers. For best compatibility, these browsers are recommended:

  • Chrome — Last 1 Version
  • Microsoft Edge — Last 1 Version
  • Firefox — Last 1 Version
  • Safari — Last 1 Version
  • Opera — Last 1 Version

# Normalize

Vodka is layer on top of Normalize.css to render all elements consistenly in different browsers.

Normalize.css is already added by default in generic.normalize.scss.

# Box Sizing

Box-sizing prevents unexpected layout issue. For more info about box-sizing read this article from CSS Tricks.

# Reboot

Reboot is a small style rule to reset margins and paddings to most common elements such as headings, paragraphs, etc.

# Base

Base is a style rule to scaffold document body by setting up the font-family, font-size, color, etc.

# Blockquote

Your time is limited, so don't waste it living someone else's life.

- Steve Jobs

# Code

Hello World!
.some-class {
  font-size: 1rem;
}

For multi-lines of code, wrap the code element inside with a pre tag.

# Kbd

Esc

# Mark

Highlighted Text

# Container

Containers provide media query screen widths. By default, container is 100% width with a margin auto.

100%

Container Sizes

Containers comes with different sizes base on the given screen breakpoints.

640px
768px
1024px
1280px

Container Responsiveness

Containers can be instructed at different sizes base on the given breakpoint. Go resize your browser to test it yourself.

Resize Me!

# Form

When creating forms make use of .o-form-element class to create consistent spacings to form elements.

# Grid

The grid is the easiest way to produce a fluid responsive layout based on flexbox.
1
2
3

Grid Columns

The grid can also be based on 12-column grid much like on other frameworks such as Bootsrap.

col--2
col--4
col--6

Grid Offset

To push a column horizontally across the grid use the .o-grid__col--offset-{xx} class modifier. Use in-conjunction with the remaining columns to perfectly align your grid.

col--2
col--offset-8 col--2

Grid Wrapping

A grid is essentially a row of columns. However columns can wrap onto the next line within the grid.

Here we have 2 columns, col--6 and col--8 but the grid can only accomodate 12 columns in total.

col--6
col--8

To solve this we can wrap the columns within the grid by adding the .o-grid--wrap modifier class.

col--6
col--8

Grid Nesting

You can nest grids inside columns with relative ease.

1
2

Grid Vertical Alignment

Per Grid

If one of your columns is tall you can apply a vertical alignment class modifier to the grid.

.o-grid--top , .o-grid--center , .o-grid--bottom are supported.

1
2
3
1
2
3
1
2
3

Per Column

You can override the vertical alignment of all the columns in the grid by specifying per column.

.o-grid__col--top , .o-grid__col--center , .o-grid__col--bottom are supported.
col--top
col--center
col--bottom

Grid Gutters

Vodka's grid comes with a gutter around each grid column with some padding on either side.

Sometimes you want your columns to be coupled with each other. To turn off all gutters use .o-grid--no-gutter class modifier.

1
2
3

or column specific instead .o-grid__col--no-gutter .
1
2
3

Grid Responsiveness

Grid columns can be instructed in different columns base on the given screen breakpoints with a mobile first approach. Go resize your browser to test it yourself.

1
2
3

Column Visible & Hidden

It works also for hiding or showing columns base on the given breakpoints.

1
2
3

# Image

Image is 100% width and responsive.

# Buttons

To make a button add the .c-button class to buttons, inputs or links.

Link

Button Colors

Buttons comes with different color states.

Button Sizes

Adding a size utility class u-size-{xx} will change the size of the button.

Button Block

Adding a .c-button--block class modifier will make the button full width.

Button Outline

Adding a .c-button--outline class modifier will make the button outline.

Button Link

Adding a .c-button--link class modifier will make the button mimic like a link.

Button Disabled

Add the disabled attribute to a button to make the button disabled.

# Inputs

From single input controls like text boxes to full form patterns.

Input Colors

Inputs comes with different color states.

Input Sizes

Adding a size utility class u-size-{xx} will change the size of the input.

Input Disabled

Add the disabled attribute to an input to make the input disabled.

Checkbox and Radiobutton

Adding a class of .c-option and .c-option--checkbox class modifier will make a custom checkbox

and .c-option--radio class modifier will also make a custom radiobutton

Labels & Form Elements

# Lists

Un-ordered, Ordered, Unstyled, or Inline. Vodka got you covered when it comes to making lists.

Un-ordered

Un-ordered list comes with a custom icon instead of a boring bullet point.

  • List Item 1
  • List Item 2
  • List Item 3

Ordered

The .c-list--ordered modifier will apply correct numbering to ordered lists and nested lists.

  • List Item 1
  • List Item 2
  • List Item 3
    • Nested List Item 1
    • Nested List Item 2
    • Nested List Item 3

Unstyled

Applying .c-list--unstyled to a list will remove the list icons with no styling.

  • List Item 1
  • List Item 2
  • List Item 3

Inline

To make your list items inline apply the .c-list--inline class modifier.

  • List Item 1
  • List Item 2
  • List Item 3

# Table

Tables are great for displaying tabular data.

First NameLast NameSex
JohnDoeMale
JaneDoeFemale

Table Striped

Applying .c-table--striped class modifier will make a striped rows in your table.

First NameLast NameSex
JohnDoeMale
JaneDoeFemale
MikeDoeMale

# Colors

A set of text-colors and background-colors utility classes.

Text Colors

Text White

Text Black

Text Gray-100

Text Gray-200

Text Gray-300

Text Gray-400

Text Gray-500

Text Gray-600

Text Gray-700

Text Gray-900

Text Gray-900

Text Red-100

Text Red-200

Text Red-300

Text Red-400

Text Red-500

Text Red-600

Text Red-700

Text Red-900

Text Red-900

Text Green-100

Text Green-200

Text Green-300

Text Green-400

Text Green-500

Text Green-600

Text Green-700

Text Green-900

Text Green-900

Text Blue-100

Text Blue-200

Text Blue-300

Text Blue-400

Text Blue-500

Text Blue-600

Text Blue-700

Text Blue-900

Text Blue-900

Text Orange-100

Text Orange-200

Text Orange-300

Text Orange-400

Text Orange-500

Text Orange-600

Text Orange-700

Text Orange-900

Text Orange-900

Background Colors

BG White
BG Black
BG Gray-100
BG Gray-200
BG Gray-300
BG Gray-400
BG Gray-500
BG Gray-600
BG Gray-700
BG Gray-900
BG Gray-900
BG Red-100
BG Red-200
BG Red-300
BG Red-400
BG Red-500
BG Red-600
BG Red-700
BG Red-900
BG Red-900
BG Green-100
BG Green-200
BG Green-300
BG Green-400
BG Green-500
BG Green-600
BG Green-700
BG Green-900
BG Green-900
BG Blue-100
BG Blue-200
BG Blue-300
BG Blue-400
BG Blue-500
BG Blue-600
BG Blue-700
BG Blue-900
BG Blue-900
BG Orange-100
BG Orange-200
BG Orange-300
BG Orange-400
BG Orange-500
BG Orange-600
BG Orange-700
BG Orange-900
BG Orange-900

# Sizing

A set of sizing utility classes that can be applied to any component with u-size-{xx}.

# Spacing

A set of spacing utility classes for margins and paddings supported in all sides.