Skip to content

Egeaonline - Remove printing restrictions by 7db2531d22

Details

Author7db2531d22

LicenseNo License

Categoryegeaonline.it

Created

Updated

Size16 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Remove printing restrictions from Egea Online

Notes

Userstyle doesn't have notes.

Source code

Source code has over 10K characters, so we truncated it. You can inspect the full source code on install link.
/* ==UserStyle==
@name           digitabook.egeaonline.it - Dec 2023
@namespace      github.com/openstyles/stylus
@version        1.0.0
@description    A new userstyle
@author         Me
==/UserStyle== */
@-moz-document url-prefix("https://digitabook.egeaonline.it") {

    @media print {

        /*
        A4 paper format
        Size: https://en.wikipedia.org/wiki/ISO_216#A_series
        Margins: https://en.wikipedia.org/wiki/Margin_(typography)#The_digital_page
        */
        @page {
            size: a4 portrait !important;
            margin: 1in !important;
        }
        
        @page rotated {
            size: a4 landscape !important;
            margin: 1in !important;
        }

        /* Re-make page visible */
        div.viewer-container.no-printable,
        div.viewer-container.no-printable * {
            display: block !important;
            margin: 0em !important;
            padding: 0em !important;
            line-height: normal !important;
        }
        
        body {
            font-weight: unset !important;
            text-align: unset !important;
        }

        *,
        ::after,
        ::before {
            box-sizing: content-box !important;
            border: medium !important;
        }

        /* Set font */
        div.viewer-container.no-printable div.page-container * {
            font-family: Noto Serif, serif !important;
            font-size: 18px !important;
            line-height: 150% !important;
        }

        /* Hide squares before subsection numbers */
        .section-container .container-title::before {
            display: none !important;
        }

        /* Section: A */
        /* block */
        div.viewer-container.no-printable div.title-container.section-main-title.chapter {
            margin-bottom: 1em !important;
            break-inside: avoid !important;
        }

        /* number */
        div.viewer-container.no-printable div.title-container.section-main-title.chapter > span.main-title-number {
            padding-right: 0.5em !important;
            font-size: 22px !important;
        }

        /* text */
        div.viewer-container.no-printable div.title-container.section-main-title.chapter > div > h1.main-title.font-title,
        div.viewer-container.no-printable div.title-container.section-main-title.chapter > div > h1.main-title.font-title * {
            display: inline !important;
            font-size: 22px !important;
        }

        /* Subsection: A.B */
        /* block */
        div.viewer-container.no-printable div.title-container > h3.font-title.container-title {
            break-inside: avoid !important;
            margin-bottom: 1em !important;
        }

        /* number + text */
        div.viewer-container.no-printable div.title-container > h3.font-title.container-title > span {
            break-inside: avoid !important;
            display: inline !important;
        }

        /* number only */
        div.viewer-container.no-printable div.title-container > h3.font-title.container-title > span > span.container-title-num {
            break-inside: avoid !important;
            display: inline !important;
        }

        /* Subsection: A.B.C */
        div.viewer-container.no-printable h5.box-title {
            break-inside: avoid !important;
            margin-bottom: 1em !important;
        }

        div.viewer-container.no-printable h5.box-title * {
            display: inline !important;
        }

        /* Paragraphs */
        div.viewer-container.no-printable div.box-content > div.box-text > p {
            /* break-inside: avoid !important; */
            margin-bottom: 1em !important;
        }

        div.viewer-container.no-printable div.box-content > div.box-text > p * {
            display: inline !important;
        }

        /* Quotes (right-aligned) */
        div.viewer-container.no-printable div.box-content > div.box-text > p.text-quote.text-quote-right {
            text-align: right !important;
            max-width: unset !important;
        }

        /* Computer code */
        div.viewer-container.no-printable span.text-code {
            font-family: Noto Sans Mono, mono !important;
        }

        /* Attachments */
        div.viewer-container.no-printable meta-attachment * {
            display: inline !important;
        }

        /* Lists */
        
        div.viewer-container.no-printable div.box-content div.box-text ol li,
        div.viewer-container.no-printable div.box-content div.box-text ul li,
        div.viewer-container.no-printable div.box-content div.box-text * ol li,
        div.viewer-container.no-printable div.box-content div.box-text * ul li {
            display: list-item !important;
            list-style-position: inside !important;
            margin-bottom: 1em !important;
        }

        div.viewer-container.no-printable div.box-content div.box-text ol li, 
        div.viewer-container.no-printable div.box-content div.box-text * ol li {
            list-style-type: decimal !important;
        }
        
        div.viewer-container.no-printable div.box-content div.box-text ul li,
        div.viewer-container.no-printable div.box-content div.box-text * ul li {
            list-style-type: disc !important;
        }
        
        /* 2nd leve list items */
        div.viewer-container.no-printable div.box-content div.box-text * li * li
        {
            margin-left: 2em !important;
        }
        
         div.viewer-container.no-printable div.box-content div.box-text * li * li:nth-child(1)
        {
            margin-top: 1em !important;
        }

        /* Tables */
        div.viewer-container.no-printable div.box-content div.box-text table {
            display: table !important;
            border: 1pt solid !important;
            margin-bottom: 1em !important;
            /* We need to shrink the table to make left and right margins visible */
            margin-left: 0.1em !important;
            /* margin-right has no effect. We need to set width */
            max-width: 99.5% !important;
            /*
            The border-collapse CSS property sets whether cells inside a <table> have shared or separate borders.
            collapse -> Adjacent cells have shared borders (the collapsed-border table rendering model).
            separate ->  Adjacent cells have distinct borders (the separated-border table rendering model).
            */
            border-collapse: collapse !important;
            overflow-wrap: break-word !important;
        }
        
        /* if tables are too wide, use this to put table in new page in landscape mode */
        /*
        div.viewer-container.no-printable div.box-content div.box-text table {
            transform: rotate(-90deg) translate(-100%, 3%) !important;
            transform-origin: left top !important;
            break-before: page !important;
            break-inside: avoid !important;
            break-after: page !important;
            margin: 0px 0px !important;
            min-width: 240mm !important;
            min-height: 297mm !important;
            font-size: 10px !important;
        }
        */

        div.viewer-container.no-printable div.box-content div.box-text table thead {
            display: table-header-group !important;
        }

        div.viewer-container.no-printable div.box-content div.box-text table tfoot {
            display: table-footer-group !important;
        }

        div.viewer-container.no-printable div.box-content div.box-text table tbody {
            display: table-row-group !important;
        }
        
        div.viewer-container.no-printable div.box-content div.box-text table tr {
            display: table-row !important;
        }

        div.viewer-container.no-printable div.box-content div.box-text table td {
            display: table-cell !important;
            border: 1pt solid !important;
            padding: 0em !important;
            width: min-content !important;
            height: min-content !important;
            font-size: 6px !important;
            white-space: normal !important;
        }
        
        div.viewer-container.no-printable div.box-content div.box-text table td:nth-child(n+2) {
            white-space: nowrap !important;
        }
        
         div.viewer-container.no-printable div.box-content div.box-text table colgroup {
            display: table-column-group !important;
        }

        div.viewer-container.no-printable div.box-content div.box-text table col {
            display: table-column !important;
        }
        
        div.viewer-container.no-printable div.box-content div.box-text table tbody tr:first-child {
            --bg-opacity: unset !important;
            font-weight: unset !important;
        }

        /* Images (they are not inside box-text) */
        div.viewer-container.no-printable div.box-content div.box-image {
            margin-bottom: 1em !important;
        }

        /* Popup */
        /* element `meta-note` can be a direct children of `p` or be inside `p > span` */
        /* - Hide popup icon */
        div.viewer-container.no-printable div.box-content > div.box-text > p meta-note > div.note-component,
        div.viewer-container.no-printable div.box-content > div.box-text > p meta-note > div.note-component * {
            display: none !important;
        }

        /* - Show poopup text inline */
        div.viewer-container.no-printable div.box-content > div.box-text > p meta-note > meta-popover-content > div.meta-popover-content {
            top: unset !important;
            left: unset !important;
            opacity: unset !important;
            width: unset !important;
            position: unset !important;
            max-width: unset !important;
            font-weight: unset !important;
            border: unset !important;
            box-shadow: unset !important;
            border-radius: un...

Reviews

No reviews yet.