mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 21:43:13 -04:00
move vendored uk components to templates
This commit is contained in:
15
app/templates/components/uk_components/inset-text/README.md
Normal file
15
app/templates/components/uk_components/inset-text/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Inset text
|
||||
|
||||
## Installation
|
||||
|
||||
See the [main README quick start guide](https://github.com/alphagov/govuk-frontend#quick-start) for how to install this component.
|
||||
|
||||
## Guidance and Examples
|
||||
|
||||
Find out when to use the inset text component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/inset-text).
|
||||
|
||||
## Component options
|
||||
|
||||
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
|
||||
|
||||
See [options table](https://design-system.service.gov.uk/components/inset-text/#options-example-default) for details.
|
||||
@@ -0,0 +1,28 @@
|
||||
@import "../../settings/all";
|
||||
@import "../../tools/all";
|
||||
@import "../../helpers/all";
|
||||
|
||||
@include govuk-exports("govuk/component/inset-text") {
|
||||
.govuk-inset-text {
|
||||
@include govuk-font($size: 19);
|
||||
@include govuk-text-colour;
|
||||
padding: govuk-spacing(3);
|
||||
// Margin top intended to collapse
|
||||
// This adds an additional 10px to the paragraph above
|
||||
@include govuk-responsive-margin(6, "top");
|
||||
@include govuk-responsive-margin(6, "bottom");
|
||||
|
||||
clear: both;
|
||||
|
||||
border-left: $govuk-border-width-wide solid $govuk-border-colour;
|
||||
|
||||
> :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
> :only-child,
|
||||
> :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
[
|
||||
{
|
||||
"name": "text",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "If `html` is set, this is not required. Text to use within the back link component. If `html` is provided, the `text` argument will be ignored."
|
||||
},
|
||||
{
|
||||
"name": "html",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "If `text` is set, this is not required. HTML to use within the back link component. If `html` is provided, the `text` argument will be ignored."
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "Id attribute to add to the inset text container."
|
||||
},
|
||||
{
|
||||
"name": "classes",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "Classes to add to the inset text container."
|
||||
},
|
||||
{
|
||||
"name": "attributes",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "HTML attributes (for example data attributes) to add to the inset text container."
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,3 @@
|
||||
{% macro govukInsetText(params) %}
|
||||
{%- include './template.njk' -%}
|
||||
{% endmacro %}
|
||||
@@ -0,0 +1,4 @@
|
||||
<div {%- if params.id %} id="{{ params.id }}"{% endif %} class="govuk-inset-text {%- if params.classes %} {{ params.classes }}{% endif %}"
|
||||
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
|
||||
{{ params.html | safe if params.html else params.text }}
|
||||
</div>
|
||||
Reference in New Issue
Block a user