Skip to content

Resolves #829: Workaround for Image alt-text hover behaviour on Safari #828

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/api/OpenProcessing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ export const getSketch = memoize(
return payload as OpenProcessingSketchResponse;
});

/**
* Note: this currently calls `/api/sketch/:id/code`
* But only uses the width and height properties from this call
* Width and height should instead be added to properties for `/api/sketch/:id` or `api/curation/:curationId/sketches` instead
*/
export const getSketchSize = memoize(async (id: string) => {
const sketch = await getSketch(id)
if (sketch.mode !== 'p5js') {
Expand Down
3 changes: 1 addition & 2 deletions src/components/Image/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ const noAltText = t("No alt text");
class:list={[
"renderable-alt",
"text-body-caption",
"bg-bg-gray-40 absolute top-0 mt-sm mx-sm px-[7.5px] pb-[2.5px] rounded-xl text-ellipsis",
"line-clamp-3 hover:line-clamp-none",
"bg-bg-gray-40 absolute top-0 mt-sm mx-sm px-[7.5px] pb-[2.5px] rounded-xl",
props.visibleAltTextClass,
]}
>
Expand Down
9 changes: 9 additions & 0 deletions styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,15 @@ input[type="search"]::-webkit-search-results-decoration {

.show-alt-text .renderable-alt {
display: -webkit-box; // Needs webkit box to support line-clamp
// The below is a workaround for known issues with Safari compatibility for Tailwind line-clamp
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 3;
}

.show-alt-text .renderable-alt:hover {
-webkit-line-clamp: unset;
}

.dark-theme.monochrome-theme .renderable-alt{
Expand Down