• Stars
    star
    4,750
  • Rank 8,462 (Top 0.2 %)
  • Language SCSS
  • License
    MIT License
  • Created over 8 years ago
  • Updated 3 months ago

Reviews

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

Repository Details

Modern framework to print the web correctly.                                               

Gutenberg

Modern framework to print web pages correctly

npm (scoped) Build Status Maintainability license download

How to use

Simply include the right stylesheet(s) in your html and load it only for a printer. Gutenberg.css is the base stylesheet but there are themes available in the themes folder.

Example with Gutenberg and "old style" theme :

<link rel="stylesheet" href="dist/gutenberg.css" media="print">
<link rel="stylesheet" href="dist/themes/oldstyle.css" media="print"> <!-- optional -->

comparison

Comparison between standard print (left) and Gutenberg (middle, Modern style and right, Old style)

npm

Gutenberg is available on npm

npm install gutenberg-css

(or yarn add gutenberg-css for yarn users)

CDN

You can also use the unpkg service as a CDN.

<link rel="stylesheet" href="https://unpkg.com/[email protected]" media="print">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/themes/oldstyle.min.css" media="print">

What does the framework do ?

Hide elements

To hide elements to be printed you can simply add the class no-print.

Force break page

Gutenberg provides two ways to break a page, the class break-before will to break before and break-after to break after.

Example:

<!-- The title will be on a new page -->
<h1 class="break-before">My title</h1>

<p class="break-after">I will break after this paragraph</p>
<!-- Break here, the next paragraph will be on a new page -->
<p>I am on a new page</p>

Avoid break inside

To avoid the page to break "inside" an element, you can use the avoid-break-inside class.

Example:

<div class="avoid-break-inside">
  <img src="gutenberg.png" />

  <p>I really don't want this part to be cut</p>
</div>

Not reformat links or acronym

If you do not want to reformat the links, acronym or abbreviation to show the full url or title, you can use the class no-reformat.

Force to print background

To force backgrounds to be printed (can be useful when you "print" a pdf), add this CSS (compatible with Safari and Chrome):

-webkit-print-color-adjust: exact;
        print-color-adjust: exact;

Dev

  • npm i to install the dependencies
  • npm run watch to "watch" the scss folder and compile to css
  • npm run build to compile gutenberg to css

More Repositories

1

Java8-CheatSheet

A Java 8+ Cheat Sheet for functional programming
486
star
2

Material-Colors-native

Material Colors - A React Native App to Select Material Colors for macOS.
JavaScript
264
star
3

mu

The μ css framework — a 1 ko css file.
HTML
232
star
4

Documentor

Super intuitive documentation generator, from markdown files to a single html file (style, scripts, images, search engine embedded) 📖 
JavaScript
40
star
5

hn-top

Hacker news top stories
V
22
star
6

Phase

Generates sounds from javascript functions.
TypeScript
14
star
7

Genetic-Algorithms-notebooks

Genetic Algorithms notebooks - The Traveling Salesman Problem
Jupyter Notebook
7
star
8

Hurl

A database-free pastebin https://bafs.github.io/Hurl/#eJxVkEFOAzEMRfc9xa_YVRUrxAlYcAA2LD2J2zGd2qPE6VDuwIITcEWOgFPoolKiJIr9__u+w3MrE6SCkMlpoMrYFWbMVJ0H0dWrNSRStPjZHKkcsi26gRuWIs44WytwfneQZtSRCsNHRjJ1Vg+hPWM4o8pxnuJgzaL7S0m3Dp1+zVylcEbhJLNE3_1qdUW7BRs4UWe5CnQfEq03prb747pIrPHyXxtiXejxAazJcvh15mTHuXCt8VzER3xMMqAaNCJaKcIxncGao6n0Lvx8f332HYxPvczhdOhEoe9mkbGItTqdtxDvpm+txngwFwuwWIGZePYtRjpFrKZY_wLV544N
JavaScript
7
star
9

telegram-cryptobot

A super simple bot to read prices from cryptowat.ch API
Python
5
star
10

wikir

A humble phoenix wiki based on markdown [beta]
Elixir
4
star
11

Laticss

Intuituve, scalable and simple micro framework-grid system
CSS
4
star
12

css-responsive-navigation

A pure CSS responsive navigation
CSS
4
star
13

Resonance

Electron music player built with Vue and Vuex [not maintained]
JavaScript
4
star
14

Demacroable

This package replace the official illuminate/macroable package with an empty trait.
PHP
4
star
15

chip8

Chip8 emulator
PHP
3
star
16

franceculture-downloader

France Culture podcasts downloader in nodejs
JavaScript
3
star
17

crc-php

Generic CRC implementation in modern PHP (CRC16, CRC24, CRC32 and more)
PHP
3
star
18

pyborg-telegram

Pyborg port for telegram (work in progress)
Python
2
star
19

Latinational-layout

A macOS layout based on QWERTY, with an emphasis on Latin languages accents. (beta)
2
star
20

equal-temperament-playground

Equal temperament playground
Svelte
2
star
21

jekyll-crystal-theme

A really simple & sober Jekyll theme.
HTML
1
star
22

atom-bleen-syntax

Bleen syntax for Atom editor
CSS
1
star
23

SimpleIrcServer

Java
1
star
24

BetterHorstmannCodeChecker

A Better Horstmann Code Checker
JavaScript
1
star
25

bafs.github.io

CSS
1
star
26

vue-electron-boilerplate

A Vue, Vuex, ES6, Electron Boilerplate with Hot loading
JavaScript
1
star
27

psalm-typecov

Type coverage report for psalm
PHP
1
star
28

Quaris

A Gamification platform made with Spring | Quaris Administration: https://github.com/BafS/Quaris-backend-admin | API doc: https://bafs.github.io/Quaris
Java
1
star
29

SimplyXKCD

A simple XKCD App for iOS and Android developed with React-native. [WIP]
JavaScript
1
star
30

gamme

A flexible scale generator for guitar and piano (WIP)
TypeScript
1
star
31

FFMpegGUI

A simple FFMpeg GUI wrapper
C++
1
star
32

es6-workflow

A simple workflow to work with ES6 using Gulp, Babel and Browserify
JavaScript
1
star