✨ feat: add support for github-style alerts#654
Conversation
✅ Deploy Preview for tabi-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thanks, @Bnyro! I was not aware of this Zola feature. I appreciate your trying to reuse code! I've pushed a commit with some changes:
Could you take a look? If it looks good to you, I'll merge. Thanks!! |
| background-size: contain; | ||
| background-repeat: no-repeat; | ||
| aspect-ratio: 1/1; | ||
| width: 1.5rem; |
There was a problem hiding this comment.
I personally preferred the previous solution to use a mixin for sharing the common styles for icons - but you have to maintain it in the end, so that's up to you :)
We could even do something like
`scss
%admonition-icon {
inset-block-start: 0.8rem;
inset-inline-start: 0.8rem;
background-size: contain;
background-repeat: no-repeat;
aspect-ratio: 1/1;
width: 1.5rem;
}
.admonition-icon-danger,
.markdown-alert-caution::after {
@extend %admonition-icon;
-webkit-mask: ...;
}
(ref https://sass-lang.com/documentation/at-rules/extend/)
| position: relative; | ||
| margin-block: 1em; | ||
| border-radius: 10px; | ||
| border-inline-start: 6px solid; | ||
| padding: 0.8rem; | ||
| color: var(--text-color-high-contrast); | ||
| font-family: var(--sans-serif-font); |
There was a problem hiding this comment.
I'm also not sure if it isn't better to not duplicate these styles because they're exactly the same as .admonition
Thank you for looking into this! I really appreciate your documentation changes, and your My only concern is that the current code duplication between |
|
Arabic translation is good, thank you |
|
Thank you so much, @TheAwiteb ! @Bnyro good catch on the duplication. made some changes. thoughts? |
Looks much better now, thanks! Good to merge from my side :) |
Summary
Related issue
Changes
.markdown-alert-note,.markdown-alert-info, ...) similar to admonitions::beforetwo times to inject the icon and the admonition title - but I don't know if it's possible to change the HTML Zola generates, and if it's possible, it's probably more complicatedmarkdowndocumentation blog postAccessibility
Screenshots
> [!CAUTION]{{ admonition(type="danger", text=...) }}Type of change
Checklist
theme.tomlwith a sane default for the featureconfig.tomlin tabi-startconfig.tomlcommentstheme.tomlcomments (not needed I think?)PS: I'm not really familiar with SASS, so if there's any cool feature in SASS to simplify the code, I'm happy to change it :)