Repository navigation
Conversation
Prism measures the line heights when it highlights, and a code block in a closed accordion panel is not displayed then, so every row got a height of 0 and the numbers piled up. Nothing measured again when the panel opened. A ResizeObserver on the `pre` now sizes the rows once it is visible. The accordion add-on joins the development project, not the package, so the acceptance tests can cover a code block inside a real panel. In the editor, the `caret-color` rules targeted `> textarea`, but the textarea is wrapped, so the caret was black on the dark theme. The line numbers now use the same monospaced fonts as the view. Closes #34
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #34
Line numbers in an accordion
Prism sizes the line numbers only when it highlights. In a closed accordion panel the code is not displayed at that moment, so each row gets
height: 0and the numbers pile up. This also happens to panels opened from theactiveAccordionURL parameter, because they open after the highlight. The plugin only measures again on a windowresize.SyntaxHighlighternow observes itsprewith aResizeObserverand sizes the rows when it has a height. WithoutResizeObserver(jsdom) it does nothing.Editor
caret-colorrules used> textarea, which never matched because the editor wraps the textarea. The caret was black in both themes, so it could not be seen on the dark one. The other rules in the> textareablock are also dead, and are left alone: applyingbackground-color: whitesmokewould hide the code.A thicker caret is not included: browsers have no caret width, and
caret-shape: blockcovers the character and reads as overwrite mode.Accordion in the project
@eeacms/volto-accordion-blockis added to the root project andvolto.config.jsonly, not to the package, so the add-on gains no dependency. A new acceptance test uses it to cover a code block in a real panel.Tests
100 unit tests and 8 acceptance tests pass locally. The acceptance run used a development bundle, so CI is the first run against a production build. Hiding the code during load with
ResizeObserverremoved left the rows at 0px, on a live page.