Skip to content

Commit

Permalink
Move inline styles to a stylesheet
Browse files Browse the repository at this point in the history
  • Loading branch information
frankieroberto committed Dec 6, 2023
1 parent 33596b1 commit 2c708b2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/components/_example.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
```
{% endset %}

{%- set outputHtml %}<iframe style="width: 100%; display: block; max-width: 100%; border: 0; background: white; height: 300px;" src="/examples/{{ params.component }}"></iframe><p class="govuk-body-s" style="border-top: 1px solid #b1b4b6; padding: 10px 20px;"><a href="/examples/{{ params.component }}" class="govuk-link" target="_blank">Open this example in a new tab</a></p>{%- endset %}
{%- set outputHtml %}<iframe class="app-example__iframe" src="/examples/{{ params.component }}"></iframe><p class="app-example__link govuk-body-s"><a href="/examples/{{ params.component }}" class="govuk-link" target="_blank">Open this example in a new tab</a></p>{%- endset %}

{{ govukTabs({
items: [
Expand Down
16 changes: 16 additions & 0 deletions docs/components/_example.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

.app-example__iframe {
width: 100%;
max-width: 100%;
height: 300px;
display: block;
border: 0;
background-color: govuk-colour("white");
}

.app-example__link {
border-top-width: 1px;
border-top-style: solid;
border-color: $govuk-border-colour;
padding: 10px 20px;
}
3 changes: 3 additions & 0 deletions docs/eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ module.exports = function(eleventyConfig) {
url: process.env.GITHUB_ACTIONS
? 'https://x-govuk.github.io/govuk-prototype-components/'
: '/',
stylesheets: [
'/styles/application.css'
],
header: {
organisationLogo: 'x-govuk',
organisationName: 'X-GOVUK',
Expand Down
4 changes: 4 additions & 0 deletions docs/styles/application.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

@import "govuk-frontend/govuk/base";

@import "../components/_example.scss";

0 comments on commit 2c708b2

Please sign in to comment.