-
Notifications
You must be signed in to change notification settings - Fork 32
Add optional border styling to images for better contrast #2081
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
base: main
Are you sure you want to change the base?
Conversation
@copilot You're getting in the weeds with npm. :) You just need to run this to rebuild the site's CSS and static assets:
From the |
Co-authored-by: theletterf <[email protected]>
... Thanks for the guidance! I've successfully implemented the border feature using The implementation is complete in commit abeb409:
The CSS was successfully built and the feature is working as expected. You can see the border class in the generated HTML: <img ... class="border" /> With CSS: .markdown-content .border {
border-style: var(--tw-border-style);
border-width: 1px;
border-color: var(--color-grey-20);
} Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
🔍 Preview links for changed docs |
The rendering LGTM and we can tweak the border styling later if needed, but I wouldn't say this suffices to close the issue as this is currently only taking into account images added using the corresponding directive. For images using the regular markdown syntax, we're able to pass parameters such as alt text, size... like this: |
Is it not sufficient to use the |
@colleenmcginnis I suggested that. I think @florent-leborgne would probably go beyond that and use it for all images. So, currently, the PR probably doesn't make anyone happy. :D
|
If that's the case, I agree that we should consider just adding IMO If we can't articulate when to use |
Since Experience team is the one that produces more screenshots, I'll defer to @florent-leborgne here.
I like this approach best, and then decide whether we want the new screenshot border on by default or not. |
sorry this sounded like a quick improvement but is turning into a longer discussion :D It happens!
I don't know if I like this option. Because I think all non-inline visuals (diagrams, videos, screenshots, gifs) should get the same general styling (border, position, etc.) by default unless for a specific one we need to work around that default for some reason and opt out. For that reason, I think we cannot implement this partially just on image directives (though yes, ok, that is a good start), and that the "screenshot" parameter doesn't really mean something obvious (why would we style a screenshot differently than another visual?). Maybe it's more about renaming it then. But again this only partially address the original intent of the issue. If we can't agree on this now, this is fine too! This discussion can wait until we have a designer to weigh in and provide their sentiment on the matter. It's not urgent at all. |
@florent-leborgne sorry I wasn't more specific with this ☝️ . I was thinking we would make the
Yes. If we don't think |
Implements an optional
:border:
directive for images to improve contrast with the page background, especially for screenshots with white or light backgrounds from the product UI.Changes Made
:border:
directive option to the image block that applies a 1px border with color-grey-20 (#e5e9f0)Border
property toImageBlock.cs
,ImageViewModel.cs
, and updated the HTML renderer.border
CSS class inimages.css
with 1px border using color-grey-20ImageView.cshtml
to dynamically apply CSS classesimages.md
with usage examplesImageBlockWithBorderTests
to verify the border functionalityUsage
Key Features
:border:
directive:screenshot:
and:width:
Fixes #2064
Original prompt
Fixes #2064
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.