Last active
March 27, 2023 13:18
-
-
Save KevinBatdorf/1c365af7b799c142ed3cd91a51329f4c to your computer and use it in GitHub Desktop.
Word Wrap Example for Code Block Pro WordPress plugin (if line numbers enabled)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div.wp-block-kevinbatdorf-code-block-pro:not(.code-block-pro-editor) pre code { | |
overflow-wrap: break-word !important; | |
/* In some cases you may need the max() */ | |
padding: 0 2rem 0 max(var(--cbp-line-number-width), 2rem) !important; | |
white-space: pre-wrap !important; | |
word-break: break-word !important; | |
} | |
div.wp-block-kevinbatdorf-code-block-pro:not(.code-block-pro-editor) pre code .line { | |
min-height: 1.625rem; | |
position: static !important; | |
} | |
div.wp-block-kevinbatdorf-code-block-pro.cbp-has-line-numbers:not(.code-block-pro-editor) pre code .line:not(.cbp-line-number-disabled):before { | |
position: absolute; | |
left: 0.5rem; | |
/* In some cases you may need the max() */ | |
width: max(var(--cbp-line-number-width), 2rem) !important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you very much Kevin!
-- Tom