mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-15 23:52:23 -06:00
Change link/anchor styling to use `text-decoration`, `text-decoration-color`, `text-underline-offset`. Looking to tackle some low-hanging fruit! Closes #636. [Link to deploy preview](https://deploy-preview-967--just-the-docs.netlify.app/). Old behaviour: <img width="582" alt="Screen Shot 2022-09-16 at 11 56 26 AM" src="https://user-images.githubusercontent.com/14893287/190711440-8e56c3a2-250f-4121-8c57-8e6e20c4ae07.png"> New behaviour: <img width="546" alt="Screen Shot 2022-09-16 at 11 56 19 AM" src="https://user-images.githubusercontent.com/14893287/190711520-2cc7fd4d-d449-4e14-9e75-96545f9f578d.png"> Some notes: - the only visible change should be minor differences in the thickness of the line (browser defaults) + how underhangs (ex a "g") interact with the line - color-wise, this is a no-op :) - I added an offset to mimic the behaviour of `background-size: 1px 1px;` Let me know what we think!
115 lines
1.6 KiB
SCSS
115 lines
1.6 KiB
SCSS
// Base element style overrides
|
|
// stylelint-disable selector-no-type, selector-max-type, selector-max-specificity, selector-max-id
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
::selection {
|
|
color: $white;
|
|
background: $link-color;
|
|
}
|
|
|
|
html {
|
|
@include fs-4;
|
|
|
|
scroll-behavior: smooth;
|
|
}
|
|
|
|
body {
|
|
font-family: $body-font-family;
|
|
font-size: inherit;
|
|
line-height: $body-line-height;
|
|
color: $body-text-color;
|
|
background-color: $body-background-color;
|
|
overflow-wrap: break-word;
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
dl,
|
|
pre,
|
|
address,
|
|
blockquote,
|
|
table,
|
|
div,
|
|
hr,
|
|
form,
|
|
fieldset,
|
|
noscript .table-wrapper {
|
|
margin-top: 0;
|
|
}
|
|
|
|
h1,
|
|
h2,
|
|
h3,
|
|
h4,
|
|
h5,
|
|
h6,
|
|
#toctitle {
|
|
margin-top: 0;
|
|
margin-bottom: 1em;
|
|
font-weight: 500;
|
|
line-height: $body-heading-line-height;
|
|
color: $body-heading-color;
|
|
}
|
|
|
|
p {
|
|
margin-top: 1em;
|
|
margin-bottom: 1em;
|
|
}
|
|
|
|
a {
|
|
color: $link-color;
|
|
text-decoration: none;
|
|
}
|
|
|
|
a:not([class]) {
|
|
text-decoration: underline;
|
|
text-decoration-color: $border-color;
|
|
text-underline-offset: 2px;
|
|
|
|
&:hover {
|
|
text-decoration-color: rgba($link-color, 0.45);
|
|
}
|
|
}
|
|
|
|
code {
|
|
font-family: $mono-font-family;
|
|
font-size: 0.75em;
|
|
line-height: $body-line-height;
|
|
}
|
|
|
|
figure,
|
|
pre {
|
|
margin: 0;
|
|
}
|
|
|
|
li {
|
|
margin: 0.25em 0;
|
|
}
|
|
|
|
img {
|
|
max-width: 100%;
|
|
height: auto;
|
|
}
|
|
|
|
hr {
|
|
height: 1px;
|
|
padding: 0;
|
|
margin: $sp-6 0;
|
|
background-color: $border-color;
|
|
border: 0;
|
|
}
|
|
|
|
// adds a GitHub-style sidebar to blockquotes
|
|
blockquote {
|
|
margin: 10px 0;
|
|
|
|
// resets user-agent stylesheets for blockquotes
|
|
margin-block-start: 0;
|
|
margin-inline-start: 0;
|
|
padding-left: 15px;
|
|
border-left: 3px solid $border-color;
|
|
}
|