help-beta: Use defaultClass instead of defaultStyle.

Somehow defaultStyle was not getting applied in all cases, but
defaultClass was getting applied in all cases. We don't have time to
investigate, but using a class is better anyways, so this change should
be fine.
This commit is contained in:
Shubham Padia
2025-07-22 14:22:02 +00:00
committed by Tim Abbott
parent 935a8b9278
commit bd935e07d8
2 changed files with 25 additions and 5 deletions

View File

@@ -12,11 +12,10 @@ export default defineConfig({
// eslint-disable-next-line new-cap
Icons({
compiler: "astro",
// unplugin-icons sets height and width by itself.
// It was setting the height to 1024 and 960 for some
// icons. It is better to set the height explicitly.
defaultStyle:
"display: inline; vertical-align: text-bottom; height: 1em; width: 1em; margin-bottom: 0; margin-top: 0;",
// We need to override some default starlight behaviour to make
// icons look nice, see the css for this class to see the reasoning
// for each individual override of the default css.
defaultClass: "zulip-unplugin-icon",
customCollections: {
// unplugin-icons has a FileSystemIconLoader which is more
// versatile. But it only supports one directory path for

View File

@@ -33,6 +33,27 @@
padding: 1rem var(--sl-content-pad-x);
}
.zulip-unplugin-icon {
/* Make sure the icon does not occupy it's own row. */
display: inline;
vertical-align: text-bottom;
/* unplugin-icons sets height and width by itself.
It was setting the height to 1024 and 960 for some
icons. It is better to set the height explicitly. */
height: 1em;
width: 1em;
/* Some css rules in starlight insert these margins to tags
that fit certain criteria, e.g. if it's a first child of
an li item and similar cases, and the icon disturbs the
spacing of everything around it just because it was an
svg tag. We set this explicitly to zero to avoid those
issues. */
margin-bottom: 0;
margin-top: 0;
}
.sl-markdown-content {
img {
vertical-align: top;