All Projects → the-teacher → Protozaur

the-teacher / Protozaur

Licence: mit
Protozaur. Minimalistic CSS framework

Labels


Primal rage of css primitives


Protozaur is semantic, mnemonic, declarative CSS framework, created to avoid wasting time and increase productivity

Why?

  1. Rapid prototyping
  2. Dramatically Reduce the amount and size of CSS/BEM style modificators in CSS files
  3. Declarative approach to add context-dependent style properties to existed CSS classes or BEM blocks

Protozaur's cheat sheet

CSS class CSS style
ma margin: auto
Margin  
m0 ... m100 — (step 5) margin: Xpx !important;
ml0 ... ml100 margin-left: Xpx !important;
mr0 ... mr100 margin-right: Xpx !important;
mt0 ... mt100 margin-top: Xpx !important;
mb0 ... mb100 margin-bottom: Xpx !important;
Padding  
p0 ... p100 padding: Xpx !important;
pl0 ... pl100 padding-left: Xpx !important;
pr0 ... pr100 padding-right: Xpx !important;
pt0 ... pt100 padding-top: Xpx !important;
pb0 ... pb100 padding-bottom: Xpx !important;
Width  
w10 ... w1200 width: Xpx !important;
w5p ... w100p width: X% !important;
Display  
inline display: inline !important
block display: block !important
iblock display: inline-block !important
Table  
ptz_table display: table
ptz_row, ptz_tr display: table-row
ptz_cell, ptz_th, ptz_td display: table-cell; vertical-align: top
   
vat vertical-align: top !important
vam vertical-align: middle !important
vab vertical-align: bottom !important
Position  
posrel position: relative !important
posabs position: absolute !important
Common style  
fs0, fs10 ... fs30 — (step 1) font-size: Xpx !important;
lh100 ... lh200 line-height: X% !important;
   
tac text-align: center !important
tar text-align: right !important
tal text-align: left !important
taj text-align: justify !important
   
b font-weight: bold !important
i font-style: italic !important
n font-style: normal !important
u text-decoration: underline !important
fwn font-weight: normal !important
   
upcase text-transform: uppercase
downcase text-transform: lowercase
   
ffa font-family: Arial
fft font-family: Tahoma
ffv font-family: Verdana
ffg font-family: Georgia
ffm font-family: Monospace
fftnr font-family: Times New Roman
   
br-off white-space: nowrap
br-on white-space: normal
   
ls0 letter-spacing: 0
lsn letter-spacing: normal
Buttons  
ptz_btn button style
ptz_size-10 ... ptz_size-25 button's size. 10px ... 25px
Inputs  
ptz_input, ptz_textarea Input style
ptz_size-10 ... ptz_size-25 inputs's size. 10px ... 25px
Floating  
clearfix no comments
pull-left float: left
pull-right float: right
ofh overflow: hidden !important

How Protozaur works?

Example 1

<h1 class='fs18 lh130 mt20 mb20'>
  Hello World!
</h1>

Will add to your H1 following css properties:

font-size: 18px;
line-height: 130%;
margin-top: 20px;
margin-bottom: 20px;

Example 2

<a href='http://github.com' class='ptz_btn ptz_size-16'>Button to Github</a>

Will show button based on font-size: 16px;

Example 3

<form action='/action.php'>
  <div class='m20'>

    <div class='mb20'>
      <input name='login' type='text' class='ptz_input ptz_size-16 w300'>
    </div>

    <div class='mb20'>
      <input name='email' type='text' class='ptz_input ptz_size-16 w300'>
    </div>

    <div class='clearfix'>
      <div class='pull-right'>
        <input type='submit' class='ptz_submit ptz_size-16'>
      </div>
    </div>

  </div>
</form>

Protozaur's concept

All CSS properties can be split in 2 groups:

  1. decorative properties (background, color, border etc.)
  2. context-dependent properties (margin, padding, font-size etc.)

Protozaur say:

  • It is pointless to write the most part of context-dependent properties in CSS files. It's reason to create tons of additional css declarations for context-dependent modificators

Protozaur advice:

  • We can create some set of global simple CSS modificators. We can use it for context-dependent customization of existed CSS styles or BEM blocks

Protozaur components

  1. reset.css — just the reset file
  2. framework.css — the heart of framework
  3. base.css — some most common css definitions

also will be better to include inputs-buttons componetns:

  1. inputs-buttons/base.css — for using styles for inputs and buttons
  2. inputs-buttons/sizes.css — for set sizes to buttons and inputs

Features

Protozaur:

  1. based on box-sizing: border-box property
  2. based on px and %

Protozaur [vs] or [with] Bootstrap / Foundation / Any CSS framework

Protozaur it's not a competitor to your CSS framework. Protozaur is assistant. It helps to reduce size of your CSS files and makes your HTML much easer to read and understand.

Fell free to use Protozaur (or it's idea) with any CSS framework.

Customization

As you see Protozaur based on very simple idea and implemented with really simple code.

If you need something special you can copy/paste a part of Protozaur's code and modify it.

Installation

Direct download

Download Protozaur.css

Ruby on Rails

Gemfile

gem 'protozaur'
bundle

app/assets/stylesheets/applicaition.css

/*
  #= require ptz/reset
  #= require ptz/base
  #= require ptz/framework

  #= require ptz/inputs_buttons/all
*/

Bower

bower install protozaur

in HTML

<link rel="stylesheet" type="text/css" href="./bower_components/ptz/protozaur.min.css">

NPM

npm install protozaur

you can use following path

node_modules/protozaur/ptz/protozaur.min.css

The MIT License (MIT)

See LICENSE.txt

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].