• Stars
    star
    271
  • Rank 146,242 (Top 3 %)
  • Language
    HTML
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

📎 Just another CSS framework

Papier Logo

Papier -> Demo

a minimal, pretty semantic, responsive CSS library

Design Decisions

  • Responsiveness Everything is responsive: alerts, panels, grids - everything!
  • Lightweight: ~ 2.5kb minified and gzipped last time I checked
  • Intrusiveness: While other frameworks force you to be very explicit about the intended styling of your elements by adding lots of classes (<button class="btn">Click</button>), Papier is very semantic and simply styles e.g. all buttons as Papier-buttons (no need to add additional classes, <button>Click</button> works just fine). This is especially handy for rapid prototyping.
  • normalize.css makes browsers render all elements more consistently and in line with modern standards. It's the foundation of papier.
  • Readability over semantic: Papier sacrifices readability and expressiveness over semantic. In Bootstrap you would create a blue button by adding the btn-primary and btn classes. Papier takes a different approach: Instead of expecting you to know that every primary button is blue, it allows you to simply add a background to it, by adding the bg-blue class. While this is obviously less semantic, it is much easier to understand, since who knows that btn-primary means "make this button blue".
  • Prototyping: Papier is perfect for rapid prototyping. This is also an area where it sacrifices readability over everything else. This means you have access to a ton of utility classes that aren't necessarily very semantic, but very handy and expressive - in short, perfect for hackathons.
  • Smart defaults: When setting the background of an element via .bg-red, the color of links and text within it will automatically set to #fff.
  • No custom styles for checkboxes, radio-buttons etc. - Users have a certain expectation how a radio button or checkbox needs to look like. Applying custom styles would ruin the assumption. Further, it's nearly impossible to make them look good on all browsers.
  • Maximum possible browser support: Everything above IE7 should work fine - nice CSS3 animations excluded.
  • CSS preprocessor: Stylus - CSS still looks like CSS, but should also be mostly valid in SCSS and Less

Utility classes

Material design-like depth classes

.depth-0
.depth-1
.depth-2
.depth-3
.depth-4
.depth-5

Rounded corners

.round-1
.round-2
.round-3
.round-4
.round-5
.round-10
.round

Selectively setting margin and padding (responsive)

.inner-seamless
.outer-seamless

.s-padding
.m-padding
.l-padding

.s-margin
.m-margin
.l-margin

Setting text-align

.left
.center
.right

They do exactly what you expect them to do

.subtle
.full-width
.uppercase
.inline-block
.hidden
.window-height

Vertically centering elements

For some reason 2014 2015 and vertically centering elements is still a pain.

.vertical-center-container
.vertical-center
<div class="full-height vertical-center-container">
    <div class="vertical-center">
        BOOM
    </div>
</div>

Background colors

.bg-no
.bg-subtle
.bg-white
.bg-red
.bg-pink
.bg-purple
.bg-deep-purple
.bg-indigo
.bg-blue
.bg-light-blue
.bg-cyan
.bg-teal
.bg-green
.bg-light-green
.bg-lime
.bg-yellow
.bg-amber
.bg-orange
.bg-deep-orange
.bg-brown
.bg-grey
.bg-blue-grey
.bg-black
.bg-almost-black

When applying a background color (e.g. .bg-brown) to an element, the color of links and other text within it will automatically be set to #fff to maintain the contrast.

If you prefer a more semantic approach, the utility classes are still useful, since you can use them in order to extend your own custom classes if needed.

Example

@require 'util.styl';

.danger {
  @extend .bg-red;
}

Getting started

  • npm: npm i papier --save
  • bower: bower i papier --save
  • CDN (preferred): <link rel="stylesheet" href="https://cdn.rawgit.com/alexanderGugel/papier/master/dist/papier-1.0.0.min.css"> or <link rel="stylesheet" href="https://cdn.rawgit.com/alexanderGugel/papier/master/dist/papier.min.css"> for the latest version
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Papier CSS</title>

<!-- FONT -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600">

<!-- ICONS -->
<link rel="stylesheet" href="http://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css">

<!-- MAGIC -->
<link rel="stylesheet" href="{{PATH TO PAPIER}}/dist/papier.min.css">

</head>
<body class="bg-subtle">

<button class="bg-indigo"><i class="icon ion-ios-cart"></i> Icon button</button>

<div class="row">
<div class="col-2 bg-lime"><strong>col-2</strong><br> bg-lime</div>
<div class="col-3 bg-yellow"><strong>col-3</strong><br> bg-yellow</div>
<div class="col-4 bg-amber"><strong>col-4</strong><br> bg-amber</div>
<div class="col-3 bg-orange"><strong>col-3</strong><br> bg-orange</div>
</div>
</body>
</html>

Customizing

Papier is built with Stylus. Customizing it is therefore very easy:

  • Install Stylus: npm i stylus -g
  • Create your stylesheet using stylus:

styles.styl

@require 'node_modules/papier/src/panel.styl';

.my-panel {
  @extend .panel;
}

.introduction {
  @extend .my-panel;
  width: 500px;
}

Important Make sure to to require instead of import to avoid duplicate classes in the compiled CSS.

You can also customize colors and other variables by overriding config.styl. E.g. Papier features a 12-column grid layout by default, but you can also set the $columns variable to 36 or whatever you prefer.

Help, Bugs, Issues

File an issue if you find a bug or have a question. Feel free to send PRs! I'm also hanging out on Freenode all the time (alexandergugel). You can also find me on Twitter: @alexanderGugel.

The easiest way to support this project is to star it. Thanks.

Credits

More Repositories

1

ied

📦 Like npm, but faster - an alternative package manager for Node
JavaScript
1,988
star
2

wsd

👊 cURL for WebSocket Servers
Go
410
star
3

arc

🙈 An Adaptive Replacement Cache (ARC) written in Go.
Go
219
star
4

jdi

📘 A documentation generator for literate JavaScript
JavaScript
98
star
5

follow-me

💀 [UNMAINTAINED] A quick utility script that follows all members of a GitHub organization.
JavaScript
58
star
6

validate-asm

💀 [MERGED UPSTREAM] Like JSLint, but for asm.js
JavaScript
36
star
7

taker

👷 simple, modular functions for working with asynchronous Golang code
Go
31
star
8

bubble

Documenting The 2016 Tech Bubble
29
star
9

pragmatic-testing

📖 A Pragmatic Guide on How to Test JavaScript Modules and Applications
29
star
10

github-insights

An interactive graph of all the people you (or anyone else) is following.
JavaScript
26
star
11

nerva

📦 an alternative npm registry written in Go
Go
21
star
12

micro-events

A very, very simple event emitter implementation.
JavaScript
21
star
13

spin

Elegant, emoji-based loading spinners to make your Haskell CLI applications more beautiful.
Haskell
19
star
14

generator-webgl

Getting started with WebGL
JavaScript
16
star
15

refreshify

watch mode on steroids for browserify builds (live-reload and desktop notifications)
JavaScript
13
star
16

tailcall

💥 Eliminate tail recursive function calls
JavaScript
13
star
17

arc-js

🙉 An Adaptive Replacement Cache (ARC) written in JavaScript.
JavaScript
11
star
18

pretty-lazy

Don't feel guilty for using custom tag names!
JavaScript
8
star
19

level-accounts

Opinionated, simple and pretty secure token-based authentication solution using LevelDB
JavaScript
8
star
20

mockmock

🐥 Mocking library for minimalists
JavaScript
6
star
21

productivity

A /etc/hosts file that magically increases your productivity.
5
star
22

MoreMagnets

[DEPRECATED] = The Pirate Bay + Digg - piracy
JavaScript
4
star
23

cas

A file system based content-addressable storage written in Go.
Go
4
star
24

react-boilerplate

A simple boilerplate for prototyping web apps in React.
JavaScript
4
star
25

api-stuff

Simple REST APIs for Twitter, Vine and Instagram
JavaScript
4
star
26

bane

Making the development of concurrent UDP based daemons less painful.
Go
3
star
27

object-pool-2

A constructor specific object pool implementation for asynchronous recycling of object allocations.
JavaScript
3
star
28

resolve

Node's `require.resolve` algorithm implemented in Go.
Go
3
star
29

nate

📝 nate makes generating HTML fun.
Python
3
star
30

micro-hackathon-starter

A boilerplate for Node.JS web applications fine-tuned for Micro Hackathons.
CoffeeScript
3
star
31

Odin

Odin is a foolproof multi-room chat application written in Node.js.
CSS
3
star
32

neovim-config

My neovim config.
Vim Script
2
star
33

json-ml

A simple JSON Markup Language (JsonML) implementation.
JavaScript
2
star
34

honigtopf

A honeypot for the BitTorrent Mainline DHT network.
JavaScript
2
star
35

inlineify

Inline code from external (source) files.
JavaScript
2
star
36

data-structures

JavaScript
1
star
37

gr-a-ph

Graph-based programming for JavaScript [deprecated - was kind of a strange idea]
JavaScript
1
star
38

famous-experiments

JavaScript
1
star
39

hmrc-exchange-rates

💷 💶 💵 Download monthly exchange rates from HMRC and generate corresponding CSV files.
Go
1
star
40

underbar

JavaScript
1
star
41

alexanderGugel.github.io

JavaScript
1
star
42

webhooks-test

1
star
43

Interactive-Venue-Map

CSS
1
star
44

famous-flow-menu

JavaScript
1
star
45

acc

A more generic version of the after function that accumulates arguments (including errors) from previous invocations.
JavaScript
1
star
46

webgl-seed

WebGL seed as generated by https://github.com/alexanderGugel/generator-webgl
JavaScript
1
star
47

anti-social

JavaScript
1
star
48

kiss-angular-seed

promoting bad practices in software engineering
JavaScript
1
star
49

raf-core

Request Animation Frame as a beating heart.
JavaScript
1
star