bulma icon indicating copy to clipboard operation
bulma copied to clipboard

Add print utility classes

Open kmohrf opened this issue 7 years ago • 13 comments

Overview of the problem

This is about the Bulma CSS framework I'm using Bulma version [0.4.1] I am sure this issue is not a duplicate?

Description

It would be nice to

  • have response helpers for the print media in order to hide/show elements
  • be able to determine the sizing of elements with the .is-([0-9]+)-print classes

It might also be reasonable to hide some elements in print styles like buttons and navs by default but that may be to invasive, unintuitive and in my experience a few .is-hidden-print classes are easily added.

I’m not familiar with sass, but in case you like the idea of having print utility classes i might be able to put together a pull request.

kmohrf avatar Apr 28 '17 11:04 kmohrf

Agreed, this is a great idea, that seems manageable to implement.

markvesterskov avatar May 18 '17 08:05 markvesterskov

Did this go anywhere? Would be nice to be able to control the display of my bulma layout for print!

kylane avatar Dec 20 '17 05:12 kylane

I found some good ideas here: https://uxdesign.cc/i-totally-forgot-about-print-style-sheets-f1e6604cfd6. I'll try this for my website using bulma.

noraj avatar Jan 06 '18 17:01 noraj

👍

I'm all in for .is-hidden-print at the very least. I've initiated something in #2329.

o8e avatar Jan 23 '19 14:01 o8e

@media print { .is-hidden-print { display: none !important; } } I have this in my project. Let me know if it's bad form. I'm relatively new to CSS.

davidcook-ms avatar Jan 31 '19 15:01 davidcook-ms

column is-[x]-print would be nice, along with mobile, tablet, desktop etc

glenndevenish avatar May 31 '19 13:05 glenndevenish

hi, would love to try this feature. but the commit seems to have conflict?

linasim89 avatar Jun 14 '20 05:06 linasim89

Hey @jgthms, @kmohrf, @o8e

I think we need to adding support for print by:

  • Adding global print style that handles all print stuff like page dimensions @page, displaying content CSS fragmentaion, and so on...
  • Adding utility classes to hide/show elements based on media type in this case(@media print).
  • Hide decorative things like background-image.
  • Unify the background-color and color of the print page.
  • Showing the external links URL beside the content by using this CSS hack:
a[href^="http"]:not([href*="mywebsite.com"]):after {
  content: " ("attr(href)")";
}

that's all in my mind right now. I could update the list later.

Muhnad avatar Nov 19 '20 00:11 Muhnad

Here is what we're using, based on https://github.com/jgthms/bulma/pull/2329:

https://gitlab.com/find-it-program-locator/newtowne/-/blob/8.x-1.x/src/global/_print.sass

mlncn avatar Nov 19 '20 00:11 mlncn

By now I have created this small NPM package: https://www.npmjs.com/package/bulma-print to use as a stand-in until printing support gets into Bulma proper. Suggestions, Comments and contributions are welcome!

suterma avatar Jul 25 '22 06:07 suterma

Screenshot 2023-09-15 at 01 41 47 I am working on creating a research report. When I want to save the report as a pdf the navigation ribbon overlays the content. How can I avoid this?

My current ribbons:

 <!-- top ribbon -->
  <nav id="navitop" class="navbar is-fixed-top">
    <div id="topc" class="columns">
      <div class="column is-12">
        <!-- disclaimer -->
        <h1 class="title disclaimer is-4">
          RESEARCH ONLY - <u>NOT</u> FOR CLINICAL USE
        </h1>
        <!-- disclaimer -->
      </div>
    </div>
  </nav>

  <!-- bottom ribbon -->
  <nav id="navibottom" class="navbar is-fixed-bottom">
    <div id="botc" class="columns is-gapless is-vcentered">
      <div class="column is-4">
        {{ meta.readable_id }}
      </div>
      <div class="column is-4">
        <!-- disclaimer -->
        <h1 class="title disclaimer is-6">
          RESEARCH ONLY <br /><u>NOT</u> FOR CLINICAL USE
        </h1>
        <!-- disclaimer -->
      </div>
      <div class="column is-4">
        {{ meta.timestamp }}
      </div>
    </div>
  </nav>

neuronflow avatar Sep 14 '23 23:09 neuronflow

Hi @neuronflow this is a valid question, however, this is not a Q&A here. I suggest you ask your question at Stackoverflow. They have a tag for bulma there an lots of experienced users. That said, I suggest you look into to the is-fixed-bottom and is-fixed-top and change the fixing and/or the height for printing specifically. See the above mentioned NPM package and links as an idea.

suterma avatar Sep 15 '23 05:09 suterma

Thanks, posted on SO: https://stackoverflow.com/questions/77110189/stop-bulma-ribbons-from-overlaying-content-when-printing

Sorry, I was under the impression that this is a bug and that the ribbons do not behave as intended, hence I reported here.

neuronflow avatar Sep 15 '23 06:09 neuronflow