diff --git a/aio/src/styles/2-modules/api-pages/_api-pages.scss b/aio/src/styles/2-modules/api-pages/_api-pages.scss index e0dd991527..70c09237a2 100644 --- a/aio/src/styles/2-modules/api-pages/_api-pages.scss +++ b/aio/src/styles/2-modules/api-pages/_api-pages.scss @@ -10,53 +10,23 @@ details.overloads { box-shadow: none; - .icon-action-header { - display: flex; - flex-direction: row; - align-items: center; + > summary { justify-content: space-between; - - a { - display: flex; - } - } - - .detail-contents { - padding: 0; - border-radius: 2px; - box-shadow: none; - - > *:not(hr) { - margin: 16px 24px; - } - } - - summary { - height: inherit; padding: 0; h4 { margin: 0; clear: left; } - .actions { - display: flex; - @include mixins.font-size(14); - } - .show-all { - display: initial; - } - .collapse-all { - display: none; - } } - &[open] > summary { - .show-all { - display: none; - } - .collapse-all { - display: initial; + > .details-content { + padding: 0; + border-radius: 2px; + box-shadow: none; + + > *:not(hr) { + margin: 16px 24px; } } } diff --git a/aio/src/styles/2-modules/details/_details.scss b/aio/src/styles/2-modules/details/_details.scss index 4e533ae8c3..dea5ebd8bf 100644 --- a/aio/src/styles/2-modules/details/_details.scss +++ b/aio/src/styles/2-modules/details/_details.scss @@ -14,6 +14,19 @@ * * * ``` + * + * Optionally, you can use an `.actions` container inside `` to show expand/collapse + * actions and/or a rotating icon: + * ```html + * + * Some title + * + * Show more + * Show less + * expand_more + * + * + * ``` */ details { @@ -21,33 +34,57 @@ details { cursor: pointer; @include mixins.font-size(16); position: relative; - padding: 16px 24px; - height: 16px; - display: block; // Remove the built in details marker in FF + padding: 16px; + height: inherit; + display: flex; // Remove the built in details marker in FF + align-items: center; overflow: hidden; &::-webkit-details-marker { display: none; // Remove the built in details marker in webkit } - // Rotate the icon - i.material-icons.expand { - @include mixins.rotate(0deg); - - @at-root #{selector.replace(&, 'details', 'details[open]')} { - @include mixins.rotate(180deg); - } - } - > h2 { margin: 0; padding: 0; border: none; display: inline; } + + .actions { + align-items: center; + display: flex; + @include mixins.font-size(14); + + // Show/hide expand and collapse actions. + .action-expand { + display: initial; + + @at-root #{selector.replace(&, 'details', 'details[open]')} { + display: none; + } + } + + .action-collapse { + display: none; + + @at-root #{selector.replace(&, 'details', 'details[open]')} { + display: initial; + } + } + + // Rotate the expand/collapse icon. + .material-icons.expand { + @include mixins.rotate(0deg); + + @at-root #{selector.replace(&, 'details', 'details[open]')} { + @include mixins.rotate(180deg); + } + } + } } - .detail-contents { + .details-content { padding: 16px 24px; } } diff --git a/aio/tools/transforms/templates/api/lib/memberHelpers.html b/aio/tools/transforms/templates/api/lib/memberHelpers.html index 49dc46c02a..0f0d3896ab 100644 --- a/aio/tools/transforms/templates/api/lib/memberHelpers.html +++ b/aio/tools/transforms/templates/api/lib/memberHelpers.html @@ -130,16 +130,14 @@
-
-

{$ method.overloads.length $} overloads...

- - Show All - Hide All - expand_more - -
+

{$ method.overloads.length $} overloads...

+ + Show All + Hide All + expand_more +
-
+
{% if method.isAbstract %} {$ renderOverloadInfo(method, cssClass + '-overload', method) $}