-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
glossary css #407
glossary css #407
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,8 +125,16 @@ const insertGlossary = (pageid: string, glossary: Glossary) => { | |
addPopup( | ||
e as HTMLSpanElement, | ||
`glossary-${entry.term}`, | ||
`<div>${entry.contents}</div>` + | ||
(entry.pageid ? `<br><a href="/${entry.pageid}">See more...</a>` : '') | ||
'<div class="glossary-popup flex-container">' + | ||
' <div class="contents">' + | ||
` <h3>${entry.term}</h3>` + | ||
` <div class="padding-bottom-24">${entry.contents}</div>` + | ||
(entry.pageid | ||
? `<a href="/${entry.pageid}" class="button secondary">View full definition</a>` | ||
: '') + | ||
' </div>' + | ||
(entry.image ? `<img src="${entry.image}" alt="${entry.term}"/>` : '') + | ||
'</div>' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (minor) ah, have you considered 1 multiline string template, please? or maybe https://react.dev/reference/react-dom/server/renderToString if we need so much logic here 😅 |
||
) | ||
}) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,6 @@ article .link-popup { | |
position: absolute; | ||
display: inline-block; | ||
font: var(--baseFont); | ||
padding: 5px 10px; | ||
margin-left: 10px; | ||
max-width: 35%; | ||
z-index: 2; | ||
|
@@ -77,6 +76,15 @@ article .link-popup::after { | |
right: 100%; | ||
} | ||
|
||
article .link-popup .glossary-popup > .contents { | ||
padding: var(--spacing-24) var(--spacing-40) var(--spacing-24); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2 or 4 values would make more sense here IMHO, but if the bottom is same as top, repeating it looks suspicious |
||
} | ||
article .link-popup .glossary-popup > img { | ||
width: 100%; | ||
border-top-right-radius: 6px; | ||
border-bottom-right-radius: 6px; | ||
} | ||
|
||
article .link-popup.shown { | ||
visibility: visible; | ||
opacity: 1; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alt=""
for decorative images, please!! we shouldn't make users of screen reader listen to the same header twice 😅