npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bulma-print

v1.0.1

Published

Extends the Bulma CSS framework with additional classes suitable for printing

Downloads

110

Readme

bulma-print

License GitHub All Releases Release Language npm

Extends the Bulma CSS framework with additional classes and styles suitable for printing.

As with Bulma, you can either use the pre-compiled .css file or install the .sass files from the NPM package.

Using a CDN (without installation)

Import the CSS file directly from jsDelivr. just after Bulma:

<!--index.html-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css"><!--the Bulma CSS-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma-print.css"><!--add bulma-print.css-->

Installing from NPM

npm install bulma-print --save-dev

or

yarn add bulma-print --dev

Now you can either either use the pre-compiled bulma-print.css file:

<!--index.html-->
<link rel="stylesheet" href="css/main.css"><!--the Bulma CSS-->
<link rel="stylesheet" href="./node_modules/bulma-print/css/bulma-print.css"><!--add bulma-print.css-->

or

include the bulma-print.scss file into your Sass chain:

//main.scss
@import "../node_modules/bulma/bulma"; //the bulma.scss
@import "../node_modules/bulma-print/bulma-print"; //add bulma-print.scss

Your Sass compiler will then process bulma-print.scss alongside your project's other Sass files into the CSS file, from where you can use it.

How to use

To arrange the print layout of your pages, you can add the following classes to your HTML:

| Add on class | Description | | ------------- | ------------- | | is-hidden-print | Hides the element on the printed page | | is-print-only | Hides the element on non-print media | | is-not-linked-print | Suppresses the (added by default) printout of the hyperlink URL | | has-page-break-after | Adds a page break after the element | | has-page-break-before | Adds a page break before the element | | is-together-print | Avoids page breaks inside the element |

The class names follow the naming pattern from the visibility helpers, as per the Bulma documentation.

Examples

Not printing the navbar

    <nav id="navbar" class="bd-navbar navbar is-hidden-print">
    <!-- navbar content... -->
    </nav>

Adding a special information, only for printouts

    <section class="hero is-print-only">
        <!-- About this printed document... -->
    </section>

Adding a page break before a header

    <h3 class="has-page-break-before">Try it out!</h3>

Further considerations

Printed links

Bulma-print will by default add the hyperlink URL (href) after any a (anchor) element. Otherwise, hyperlinks are not usable from print media. If you do not like this for a link, you can suppress this via the specific marker class is-not-linked-print.

Page breaks

Print media has the additional concept of pages. The page breaks can be controlled and specifically set, for example you can add has-page-break-before on h1 elements, to add a page break beforehand, to produce a more expected layout on print media. Also, for enumerations like lists or with tables, you might want to keep these on the same page, and can thus use is-together-print on the outermost element, like ul or table.

Responsive size

For printing, Bulma by default uses the layout styles as for their "tablet" screen size. See the Bulma breakpoint documentation. This package does not change this.

Automatic color adjustments

Any browser may try to optimize the printed colors as it sees fit, and most browsers do. See the documentation about the print-color-adjust CSS property for more information. Bulma-print does not change this value. You may want to add your custom styles to produce the exact output you like.

What's included

This package contains:

  • a main Scss file, bulma-print.scss which includes the styles for the above classes.
  • Additional, experimental styles in the experimental folder. Use with caution.
  • a pre-compiled .css file, if you do not want to build from .scss

Build

Use npm run to show all available commands:

  css-deploy
    npm run css-build && npm run css-postcss
  css-build
    sass --no-source-map bulma-print.scss:css/bulma-print.css
  css-postcss
    postcss --use autoprefixer --output css/bulma-print.css css/bulma-print.css

  //Build continuously
  css-watch
    npm run css-build -- --watch    

About Bulma-print

Currently, Bulma is missing print-specific styling. It has been reported as https://github.com/jgthms/bulma/issues/721, and until it's implemented, this package may serve as a stand-in.

About Bulma

If you want to learn more about Bulma, follow these links: Bulma homepage and Documentation.

Copyright and license

Code copyright by Marcel Suter. Code released under the MIT license.