diff --git a/core/themes/seven/css/components/form.css b/core/themes/seven/css/components/form.css index 5c322ea..53a9627 100644 --- a/core/themes/seven/css/components/form.css +++ b/core/themes/seven/css/components/form.css @@ -85,15 +85,22 @@ label[for] { /* Inline errors. */ .form-error { - background: inherit; - border: inherit; - padding: inherit; margin-top: 0.385em; + padding: inherit; + border: inherit; + background: inherit; +} +.form-error .fieldset-wrapper { + margin-top: 1.75em; } .form-error .form-error-message { + margin-bottom: 0; padding-left: 1.231em; - background: transparent url("/core/misc/icons/ea2800/error.svg") no-repeat scroll 0.1em center / 0.76em 0.76em; min-height: inherit; + background: transparent url("../../images/misc-icons-ea2800-error.svg") no-repeat scroll 0.1em center / 0.76em 0.76em; +} +.form-error .form-error-message + .description { + margin-top: 0; } /* Filter */ diff --git a/core/themes/seven/images/misc-icons-ea2800-error.svg b/core/themes/seven/images/misc-icons-ea2800-error.svg new file mode 100644 index 0000000..a715b96 --- /dev/null +++ b/core/themes/seven/images/misc-icons-ea2800-error.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/core/themes/seven/templates/fieldset.html.twig b/core/themes/seven/templates/fieldset.html.twig new file mode 100644 index 0000000..0476f4b --- /dev/null +++ b/core/themes/seven/templates/fieldset.html.twig @@ -0,0 +1,60 @@ +{# +/** + * @file + * Default theme implementation for a fieldset element and its children. + * + * Available variables: + * - attributes: HTML attributes for the fieldset element. + * - errors: (optional) Any errors for this fieldset element, may not be set. + * - required: Boolean indicating whether the fieldeset element is required. + * - legend: The legend element containing the following properties: + * - title: Title of the fieldset, intended for use as the text of the legend. + * - attributes: HTML attributes to apply to the legend. + * - description: The description element containing the following properties: + * - content: The description content of the fieldset. + * - attributes: HTML attributes to apply to the description container. + * - children: The rendered child elements of the fieldset. + * - prefix: The content to add before the fieldset children. + * - suffix: The content to add after the fieldset children. + * + * @see template_preprocess_fieldset() + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'form-item', + 'form-wrapper', + errors ? 'form-error', + ] +%} + + {% + set legend_span_classes = [ + 'fieldset-legend', + required ? 'form-required', + ] + %} + {# Always wrap fieldset legends in a SPAN for CSS positioning. #} + + {{ legend.title }} + +
+ {% if errors %} +
+ {{ errors }} +
+ {% endif %} + {% if prefix %} + {{ prefix }} + {% endif %} + {{ children }} + {% if suffix %} + {{ suffix }} + {% endif %} + {% if description.content %} + {{ description.content }}
+ {% endif %} + +