Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/assets/stylesheets/design_system/_hljs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
.hljs-quote,
.hljs-template-tag {
/* var(--highlight-namespace) */
color: #b75501;
color: #b25301;
}

.hljs-selector-class {
Expand Down Expand Up @@ -84,7 +84,7 @@
.hljs-title,
.hljs-literal {
/* var(--highlight-literal) */
color: #b75501;
color: #b25301;
}

.hljs-bullet,
Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/design_system/govuk.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@
overflow-x: auto;
overflow-y: auto;
padding: 0.5rem;

&:focus {
outline: 3px solid #fd0;
outline-offset: 2px;
}
}

.app-example__code pre {
Expand Down
7 changes: 6 additions & 1 deletion app/assets/stylesheets/design_system/nhsuk.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
overflow-x: auto;
overflow-y: auto;
padding: 0.5rem;

&:focus {
outline: 3px solid #fd0;
outline-offset: 2px;
}
}

.app-example__code pre {
Expand All @@ -36,7 +41,7 @@
}

.app-example__code pre code.hljs {
background: transparent;
background: #f0f4f5;
}

.app-example__copy-button {
Expand Down
2 changes: 1 addition & 1 deletion lib/design_system/generic/builders/code.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def render_code(code, language)
content_tag(:div, class: 'app-example__code', data: { controller: 'ds--clipboard' }) do
content_tag(:button, 'Copy', class: 'app-example__copy-button',
data: { action: 'click->ds--clipboard#copy', 'ds--clipboard-target': 'buttonText' }) +
content_tag(:div, class: 'app-example__scroll') do
content_tag(:div, class: 'app-example__scroll', tabindex: 0) do
content_tag(:pre, data: { 'ds--clipboard-target': 'source' }) do
content_tag(:code, code, data: { controller: 'ds--code-highlight' },
class: "hljs language-#{language}")
Expand Down
Loading