docs(menu): fix the popover demo and warning blockquote

PiperOrigin-RevId: 590796459
This commit is contained in:
Elliott Marquez 2023-12-13 20:19:18 -08:00 committed by Copybara-Service
parent f92eb0efe0
commit bad478dd91
3 changed files with 16 additions and 3 deletions

View File

@ -62,7 +62,7 @@ function blockquote($) {
const $blockquote = $(blockquote);
const $first = $blockquote.children().first();
const text = $first.text().trim();
const iconRegex = /^(tip|important|note):\s*/i;
const iconRegex = /^(tip|important|note|warning):\s*/i;
const match = text.match(iconRegex);
const hasIcon = match;
@ -85,6 +85,10 @@ function blockquote($) {
$blockquote.addClass('important');
icon = 'priority_high';
break;
case 'warning':
$blockquote.addClass('warning');
icon = 'warning';
break;
case 'note':
$blockquote.addClass('note');
icon = 'bookmark';

View File

@ -237,6 +237,15 @@ blockquote.important {
}
blockquote.important,
blockquote.important a {
blockquote.important a {
color: var(--md-sys-color-on-primary-container);
}
blockquote.warning {
background-color: var(--md-sys-color-error-container);
}
blockquote.warning,
blockquote.warning a {
color: var(--md-sys-color-on-error-container);
}

View File

@ -243,7 +243,7 @@ to the bottom of the button with three items, Apple, Banana, and
Cucumber."](images/menu/usage-popover.webp)
<!-- no-catalog-end -->
<!-- catalog-include "figures/menu/usage-fixed.html" -->
<!-- catalog-include "figures/menu/usage-popover.html" -->
```html
<!-- Note the lack of position: relative parent. -->