Aos: Content not showing when printing

Created on 14 Feb 2017  路  5Comments  路  Source: michalsnik/aos

When printing newly loaded page, content outside of viewport is not printing

bug done

Most helpful comment

I wrapped all AOS styles inside @media screen {} in v3.0.0-beta.3. Enjoy!
If you'll encounter any issues let me know :)

All 5 comments

Ah, this is worth considering to fix in css. Right now I'm not checking for print media query and just hide anything with data-aos when those elements don't have aos-animate class.

Good point @DavidMarekCZ. Thanks for pointing this! :)

Came across the same issue in my last project and solved it with a wildcard rule like this

@media print{
    *[data-aos*=""] {
        display: inline-block !important
    }
}

Adapting @burnaDLX solution (many thanks for that), I am using the following to reset the scaling and transformation so it prints as if the animations have finished:

@media print{
    [data-aos] {
        display: block !important;
        opacity: 1 !important;
        transform: translate(0) scale(1) !important;
    }
}

The above workaround doesn't work in my case, since I've got very specific CSS rules for print which removes most images entirely to print my site as a classic book-style document.

Is there a way to disable AOS entirely for print?

I experiented by wrapping an @import rule for aos.css in a @media screen but it doesn't seem to work.

EDIT: Actually, what does seem to work is just adding media=screen" to the HTML, like so: <link rel="stylesheet" href="aos/aos.css" media="screen" />

I wrapped all AOS styles inside @media screen {} in v3.0.0-beta.3. Enjoy!
If you'll encounter any issues let me know :)

Was this page helpful?
0 / 5 - 0 ratings