Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Directly add SVG instead of linking via IMG #161

Merged
merged 8 commits into from
Feb 6, 2022

Conversation

choldgraf
Copy link
Member

@choldgraf choldgraf commented Feb 3, 2022

Description

This PR modifies the way that we insert copy buttons into the code blocks, so that we directly insert the SVG into the DOM, rather than linking to one via the <img> tag. This allows users to style the color of the copy button icon, which is particularly useful for things like "dark mode".

try it out here 馃憠 https://readthedocs.org/projects/sphinx-copybutton/builds/15979421/

For example, here's the copy button's current behavior with Furo:

chrome_67VenlcCei

And the new behavior:

chrome_c6hygwMify

Modifying the copy icon now means directly pasting in some SVG code to your conf.py file, rather than specifying a path to an image file. This old copybutton_image_path will go through a deprecation cycle.

@choldgraf choldgraf changed the title Directly add SVG instead of linking via IMG ENH: Directly add SVG instead of linking via IMG Feb 6, 2022
@choldgraf choldgraf merged commit 915aa4c into executablebooks:master Feb 6, 2022
@choldgraf choldgraf deleted the doc-update-docs branch February 6, 2022 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant