Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add word wrap in print styles #312

Open
KevinBatdorf opened this issue Apr 4, 2024 · 0 comments
Open

Add word wrap in print styles #312

KevinBatdorf opened this issue Apr 4, 2024 · 0 comments

Comments

@KevinBatdorf
Copy link
Owner

KevinBatdorf commented Apr 4, 2024

The cod egets cut off. Word wrap and line highlighting dont play nice together today but with print it will work.

@media print {
  .wp-block-kevinbatdorf-code-block-pro:not(#x) pre code {
    text-wrap: wrap !important;
  }
  .wp-block-kevinbatdorf-code-block-pro:not(#x) .line {
    min-width: 0 !important;
  }
}

edit: or maybe this in place of the text-wrap above

.wp-block-kevinbatdorf-code-block-pro:not(#x) pre code {
    white-space: pre-wrap !important; // or pre-wrap ?
}

Was suggested to add some context when printing

@media print {
    .wp-block-kevinbatdorf-code-block-pro:not(#x)::before {
        content: "Note: This code bay be improperly formatted when printing";
        display: block;
    }
}
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant