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:
Navigate to the root directory of Vodka.
Run npm install NPM will install all dev dependencies as listed in package.json.
When completed, run npm run build to compile SCSS to CSS and minify files.
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
# About
Vodka CSS follows the BEM naming convention when authoring CSS and ITCSS architecture made by Harry Roberts. This two combination principle is also known as BEMIT.
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.