diff --git a/core/modules/system/templates/form-element.html.twig b/core/modules/system/templates/form-element.html.twig index a961801..9d5b78e 100644 --- a/core/modules/system/templates/form-element.html.twig +++ b/core/modules/system/templates/form-element.html.twig @@ -60,7 +60,7 @@ description_display == 'invisible' ? 'visually-hidden', ] %} - + {% if label_display in ['before', 'invisible'] %} {{ label }} {% endif %} @@ -80,7 +80,7 @@ {{ label }} {% endif %} {% if description_display in ['after', 'invisible'] and description.content %} - + {{ description.content }} {% endif %} diff --git a/core/modules/system/templates/html.html.twig b/core/modules/system/templates/html.html.twig index 5ef96cd..a08ec09 100644 --- a/core/modules/system/templates/html.html.twig +++ b/core/modules/system/templates/html.html.twig @@ -35,7 +35,7 @@ {{ scripts }} - {{ 'Skip to main content'|t }} {{ page_top }} diff --git a/core/modules/system/templates/image.html.twig b/core/modules/system/templates/image.html.twig index 2f29304..bde7b17 100644 --- a/core/modules/system/templates/image.html.twig +++ b/core/modules/system/templates/image.html.twig @@ -17,4 +17,4 @@ set classes = [ style_name ? 'image-style-' ~ style_name|clean_class, ] %} - + diff --git a/core/themes/classy/templates/form-element.html.twig b/core/themes/classy/templates/form-element.html.twig new file mode 100644 index 0000000..a961801 --- /dev/null +++ b/core/themes/classy/templates/form-element.html.twig @@ -0,0 +1,87 @@ +{# +/** + * @file + * Default theme implementation for a form element. + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - prefix: (optional) The form element prefix, may not be set. + * - suffix: (optional) The form element suffix, may not be set. + * - required: The required marker, or empty if the associated form element is + * not required. + * - type: The type of the element. + * - name: The name of the element. + * - label: A rendered label element. + * - label_display: Label display setting. It can have these values: + * - before: The label is output before the element. This is the default. + * The label includes the #title and the required marker, if #required. + * - after: The label is output after the element. For example, this is used + * for radio and checkbox #type elements. If the #title is empty but the + * field is #required, the label will contain only the required marker. + * - invisible: Labels are critical for screen readers to enable them to + * properly navigate through forms but can be visually distracting. This + * property hides the label for everyone except screen readers. + * - attribute: Set the title attribute on the element to create a tooltip but + * output no label element. This is supported only for checkboxes and radios + * in \Drupal\Core\Render\Element\CompositeFormElementTrait::preRenderCompositeFormElement(). + * It is used where a visual label is not needed, such as a table of + * checkboxes where the row and column provide the context. The tooltip will + * include the title and required marker. + * - description: (optional) A list of description properties containing: + * - content: A description of the form element, may not be set. + * - attributes: (optional) A list of HTML attributes to apply to the + * description content wrapper. Will only be set when description is set. + * - description_display: Description display setting. It can have these values: + * - before: The description is output before the element. + * - after: The description is output after the element. This is the default + * value. + * - invisible: The description is output after the element, hidden visually + * but available to screen readers. + * - disabled: True if the element is disabled. + * - title_display: Title display setting. + * + * @see template_preprocess_form_element() + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'form-item', + 'form-type-' ~ type|clean_class, + 'form-item-' ~ name|clean_class, + title_display not in ['after', 'before'] ? 'form-no-label', + disabled == 'disabled' ? 'form-disabled', + ] +%} +{% + set description_classes = [ + 'description', + description_display == 'invisible' ? 'visually-hidden', + ] +%} + + {% if label_display in ['before', 'invisible'] %} + {{ label }} + {% endif %} + {% if prefix is not empty %} + {{ prefix }} + {% endif %} + {% if description_display == 'before' and description.content %} + + {{ description.content }} + + {% endif %} + {{ children }} + {% if suffix is not empty %} + {{ suffix }} + {% endif %} + {% if label_display == 'after' %} + {{ label }} + {% endif %} + {% if description_display in ['after', 'invisible'] and description.content %} + + {{ description.content }} + + {% endif %} + diff --git a/core/themes/classy/templates/form.html.twig b/core/themes/classy/templates/form.html.twig new file mode 100644 index 0000000..2cd1e95 --- /dev/null +++ b/core/themes/classy/templates/form.html.twig @@ -0,0 +1,17 @@ +{# +/** + * @file + * Default theme implementation for a 'form' element. + * + * Available variables + * - attributes: A list of HTML attributes for the wrapper element. + * - children: The child elements of the form. + * + * @see template_preprocess_form() + * + * @ingroup themeable + */ +#} + + {{ children }} + diff --git a/core/themes/classy/templates/html.html.twig b/core/themes/classy/templates/html.html.twig new file mode 100644 index 0000000..5ef96cd --- /dev/null +++ b/core/themes/classy/templates/html.html.twig @@ -0,0 +1,46 @@ +{# +/** + * @file + * Default theme implementation for the basic structure of a single Drupal page. + * + * Variables: + * - css: A list of CSS files for the current page. + * - head: Markup for the HEAD element (including meta tags, keyword tags, and + * so on). + * - head_title: A modified version of the page title, for use in the TITLE tag. + * - head_title_array: List of text elements that make up the head_title + * variable. May contain or more of the following: + * - title: The title of the page. + * - name: The name of the site. + * - slogan: The slogan of the site. + * - page_top: Initial rendered markup. This should be printed before 'page'. + * - page: The rendered page markup. + * - page_bottom: Closing rendered markup. This variable should be printed after + * 'page'. + * - styles: Style tags necessary to import all necessary CSS files in the head. + * - scripts: Script tags necessary to load the JavaScript files and settings + * in the head. + * + * @see template_preprocess_html() + * + * @ingroup themeable + */ +#} + + + + {{ head }} + {{ head_title }} + {{ styles }} + {{ scripts }} + + + + {{ page_top }} + {{ page }} + {{ page_bottom }} + {{ scripts_bottom }} + + diff --git a/core/themes/classy/templates/image.html.twig b/core/themes/classy/templates/image.html.twig new file mode 100644 index 0000000..2f29304 --- /dev/null +++ b/core/themes/classy/templates/image.html.twig @@ -0,0 +1,20 @@ +{# +/** + * @file + * Default theme implementation of an image. + * + * Available variables: + * - attributes: HTML attributes for the img tag. + * - style_name: (optional) The name of the image style applied. + * + * @see template_preprocess_image() + * + * @ingroup themeable + */ +#} +{% +set classes = [ + style_name ? 'image-style-' ~ style_name|clean_class, +] +%} + diff --git a/core/themes/classy/templates/indentation.html.twig b/core/themes/classy/templates/indentation.html.twig new file mode 100644 index 0000000..e5e7b32 --- /dev/null +++ b/core/themes/classy/templates/indentation.html.twig @@ -0,0 +1,20 @@ +{# +/** + * @file + * Default theme implementation for a set of indentation divs. + * + * These
tags are used for drag and drop tables. + * + * Available variables: + * - size: Optional. The number of indentations to create. + * + * @ingroup themeable + */ +#} + +{% for i in 1..size if size > 0 %}
 
{% endfor %} diff --git a/core/themes/classy/templates/input.html.twig b/core/themes/classy/templates/input.html.twig new file mode 100644 index 0000000..1409c25 --- /dev/null +++ b/core/themes/classy/templates/input.html.twig @@ -0,0 +1,15 @@ +{# +/** + * @file + * Default theme implementation for an 'input' #type form element. + * + * Available variables: + * - attributes: A list of HTML attributes for the input element. + * - children: Optional additional rendered elements. + * + * @see template_preprocess_input() + * + * @ingroup themeable + */ +#} +{{ children }}