NotGovUK icon indicating copy to clipboard operation
NotGovUK copied to clipboard

Add GDS styling for code snippets

Open daniel-ac-martin opened this issue 2 years ago • 3 comments

See: https://govuk-prototype-kit.herokuapp.com/docs/install/install-the-kit.md

daniel-ac-martin avatar Jul 12 '22 10:07 daniel-ac-martin

(Thanks to @tomyems for the suggestion.)

daniel-ac-martin avatar Jul 12 '22 10:07 daniel-ac-martin

Would code snippets be 'components-internal' rather than 'components'? I guess it depends on whether applications are likely to use code snippets in production?

There are two styles to code snippets in the GOV.UK prototype. One is inline in red, and the other is in a scrollable block. Should they be one component, with an attribute that toggles between inline or block, or are they two separate components? (I'd have guessed that they're doing the same function so in one component?)

tomyems avatar Sep 05 '22 07:09 tomyems

I think, for now, just some default styling on <pre> and <code> blocks would go a long way. I'm not exactly sure where that should live or whether it needs to be a component.

Then again, I've already got some stuff for the preview boxes on the documentation pages, so perhaps I could just generalise that... (Might be nice as there's some support for syntax highlighting.)

daniel-ac-martin avatar Sep 05 '22 13:09 daniel-ac-martin