diff --git a/core/includes/form.inc b/core/includes/form.inc
index 694fb41..1237c5d 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -208,6 +208,7 @@ function template_preprocess_fieldset(&$variables) {
   $variables['legend_span']['attributes'] = new Attribute();
 
   if (!empty($element['#description'])) {
+    $variables['description_display'] = $element['#description_display'];
     $description_id = $element['#attributes']['id'] . '--description';
     $description_attributes['id'] = $description_id;
     $variables['description']['attributes'] = new Attribute($description_attributes);
diff --git a/core/modules/system/templates/fieldset.html.twig b/core/modules/system/templates/fieldset.html.twig
index ab6796c..70ee088 100644
--- a/core/modules/system/templates/fieldset.html.twig
+++ b/core/modules/system/templates/fieldset.html.twig
@@ -33,6 +33,11 @@
     <span{{ legend_span.attributes.addClass(legend_span_classes) }}>{{ legend.title }}</span>
   </legend>
   <div class="fieldset-wrapper">
+    {% if description_display == 'before' and description.content %}
+      <div{{ description.attributes }}>
+        {{ description.content }}
+      </div>
+    {% endif %}
     {% if prefix %}
       <span class="field-prefix">{{ prefix }}</span>
     {% endif %}
@@ -40,8 +45,10 @@
     {% if suffix %}
       <span class="field-suffix">{{ suffix }}</span>
     {% endif %}
-    {% if description.content %}
-      <div{{ description.attributes.addClass('description') }}>{{ description.content }}</div>
+    {% if description_display in ['after', 'invisible'] and description.content %}
+      <div{{ description.attributes.addClass(description_classes) }}>
+        {{ description.content }}
+      </div>
     {% endif %}
   </div>
 </fieldset>
