Skip to content

Commit

Permalink
docs(menu): fix the popover demo and warning blockquote
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 590796459
  • Loading branch information
Elliott Marquez authored and copybara-github committed Dec 14, 2023
1 parent f92eb0e commit bad478d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion catalog/eleventy-helpers/filters/md-markdown.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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';
Expand Down
11 changes: 10 additions & 1 deletion catalog/site/css/md-layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion docs/components/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. -->
Expand Down

0 comments on commit bad478d

Please sign in to comment.