cue icon indicating copy to clipboard operation
cue copied to clipboard

cuelang.org: code-tabs inside info blocks have unwanted extra vertical spaces

Open jpluscplusm opened this issue 10 months ago • 2 comments

What page were you looking at?

https://cl-1210794-3--cue-cls.netlify.app/docs/draft/bugs/terminal-inside-info/

What version of the site were you looking at?

https://github.com/cue-lang/cuelang.org/commit/89bc8d412fc3984cc3488aef05701ecdd9327969

What did you do?

I caused the preprocessor to place a code-tab inside an info block.

What did you expect?

That the code-tab would contain consistently-formatted text, no matter if it were inside or outside an info (or warning or caution) block.

What did you see instead?

The code-tab's text gained an extra leading and extra trailing newline:

Image

jpluscplusm avatar Mar 06 '25 17:03 jpluscplusm

@jpluscplusm - this is marked as "backlog" - so I'm assuming not a priority?

myitcv avatar Mar 08 '25 05:03 myitcv

this is marked as "backlog" - so I'm assuming not a priority?

Yes; I felt this could happily wait until after the first week of April so as not to contend with any other frontend work that's more important.

jpluscplusm avatar Mar 10 '25 12:03 jpluscplusm

The problem seems to be caused by custom styling that styles the code tag within a 'note' (info block) a bit different. This styling was added to style inline code but this now also styles the code block itself. We need to make the selector more specific so it only styles inline code and not the code block.

for developer that will pick this up:

This line:

.note__content code { }

should be made more specific so it styles only direct children that are code or code inside paragraphs which are children. something like this:

.note__content > code,
.note__content > p code  { } 

Estimate: 30 min (with testing if this fixes it and does not break inline code styles)

JorindeUsMedia avatar Aug 26 '25 08:08 JorindeUsMedia