Last active
April 2, 2024 10:55
-
-
Save adamkudrna/694f3048c1338f07375b9b8af24afe2f to your computer and use it in GitHub Desktop.
Turn Netlify links into buttons using GitHub design tokens (Firefox user CSS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Make Netlify deploy preview links on GitHub stand out. | |
*/ | |
@-moz-document domain("github.com") { | |
/* Turn Netlify links into buttons using GitHub design tokens. */ | |
.comment-body a[href$="netlify.app"] { | |
position: relative; | |
display: block; | |
margin-block: 1em; | |
padding: 1em; | |
overflow: hidden; | |
font-weight: 500; | |
color: var(--button-primary-fgColor-rest, var(--color-btn-primary-text)) !important; | |
border: 1px solid var(--button-primary-borderColor-rest, var(--color-btn-primary-border)); | |
border-radius: 6px; | |
background-color: var(--button-primary-bgColor-rest, var(--color-btn-primary-bg)) !important; | |
box-shadow: var(--shadow-resting-small, var(--color-btn-primary-shadow)),var(--shadow-highlight, var(--color-btn-primary-inset-shadow)); | |
} | |
.comment-body a[href$="netlify.app"]::after { | |
content: "Preview"; | |
position: absolute; | |
inset: 1px ; | |
display: grid; | |
place-content: center; | |
font-size: 1.25rem; | |
color: inherit; | |
background-color: inherit; | |
} | |
.comment-body a[href$="netlify.app"]:hover { | |
border-color: var(--button-primary-borderColor-hover, var(--color-btn-primary-hover-border)); | |
background-color: var(--button-primary-bgColor-hover, var(--color-btn-primary-hover-bg)) !important; | |
} | |
.comment-body a[href$="netlify.app"]:active { | |
border-color: var(--button-primary-borderColor-active, var(--color-btn-active-border)); | |
background-color: var(--button-primary-bgColor-active, var(--color-btn-active-bg)) !important; | |
box-shadow: var(--button-primary-shadow-selected, var(--color-btn-primary-selected-shadow)); | |
} | |
/* Spirit Design System: Adjust individual button labels by URL. */ | |
.comment-body a[href$="spirit-design-system-demo.netlify.app"]::after { | |
content: "CSS Preview"; | |
} | |
.comment-body a[href$="spirit-design-system-react.netlify.app"]::after { | |
content: "React Preview"; | |
} | |
.comment-body a[href$="spirit-design-system-storybook.netlify.app"]::after { | |
content: "Storybook Preview"; | |
} | |
.comment-body a[href$="spirit-design-system-validations.netlify.app"]::after { | |
content: "Form Validations Preview"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example: