GithubHelp home page GithubHelp logo

chrisquinnr / gutenberg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bafs/gutenberg

0.0 1.0 0.0 88 KB

Modern framework to print the web correctly.

Home Page: http://bafs.github.io/Gutenberg

JavaScript 7.68% CSS 92.32%

gutenberg's Introduction

Gutenberg

Modern framework to print correctly

npm (scoped) npm npm Code Climate Beerpay

How to use

Simply include the right stylesheet(s) in your html an load it only for a printer. Gutenberg.css is the base stylesheet but there is 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

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 provide to way break page, the class page-break will for to break before and page-break-after to break after.

Example:

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

<p class="page-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>

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

  1. npm install to install dependencies
  2. gulp watch to "watch" the scss folder and compile to css

gutenberg's People

Contributors

bafs avatar tomm1996 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.