-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improve link focus styles #89
base: master
Are you sure you want to change the base?
Changes from all commits
c66deda
3339e27
c172acc
f6f599e
25c13d7
083ce60
c1437ab
31629ea
de5aac0
ddf3814
1612003
b13c420
8b2905a
2b2c335
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,20 +19,21 @@ | |
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-eslint-comments": "^3.2.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-simple-import-sort": "^7.0.0", | ||
"eslint-plugin-sonarjs": "^0.8.0-125", | ||
"eslint-plugin-unicorn": "^33.0.1", | ||
"esm": "^3.2.25", | ||
"htm": "^3.0.4", | ||
"markdown-it": "^10.0.0", | ||
"markdown-it": "^12.2.0", | ||
"markdown-it-link-attributes": "^3.0.0", | ||
"preact": "^10.5.13", | ||
"preact-render-to-string": "^5.1.19", | ||
"prettier": "2.3.2", | ||
"react": "^17.0.2", | ||
"twind": "^0.16.16" | ||
}, | ||
"devDependencies": { | ||
"@types/eslint": "^7.2.13" | ||
"@types/eslint": "^7.2.13", | ||
"eslint-plugin-simple-import-sort": "^7.0.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ESLint is run in Netlify deploy preview builds, and Netlify installs only dependencies (not devDependencies), so this must be moved back to dependencies. The build is currently failing because of this. |
||
}, | ||
"engines": { | ||
"node": ">=14.0.0", | ||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,6 +1,7 @@ | ||||||||||
import { ExternalLinkIcon } from '@heroicons/react/solid' | ||||||||||
import { html } from 'htm/preact' | ||||||||||
import { apply, tw } from 'twind' | ||||||||||
import { linkClasses } from '../utils/const' | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I would move this here because the classes are closely related to the Link component. Wdyt? See also Locality of Behavior / Co-location. 😜 |
||||||||||
|
||||||||||
export default ({ | ||||||||||
children, | ||||||||||
|
@@ -10,7 +11,7 @@ export default ({ | |||||||||
...rest | ||||||||||
}) => html` | ||||||||||
<a | ||||||||||
class=${tw(classes, apply('underline text-red(hover:600 active:700)'))} | ||||||||||
class=${tw(classes, apply(linkClasses))} | ||||||||||
href=${href} | ||||||||||
style="text-decoration-thickness: 1px" | ||||||||||
...${rest} | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
import { html } from 'htm/preact' | ||
|
||
import char from '../data/char' | ||
import Link from './Link' | ||
|
||
export default () => html` | ||
<p class="italic"> | ||
Soitin tulossa pian${char.trade}! Sitä ennen voit kuunnella podia mm.${' '} | ||
<a href="https://open.spotify.com/show/1st4zWhHxzXn345vqdTfk8"> | ||
<${Link} href="https://open.spotify.com/show/1st4zWhHxzXn345vqdTfk8"> | ||
Spotifyssa | ||
</a> | ||
<//> | ||
${' ja '} | ||
<a href="https://podcasts.apple.com/us/podcast/koodikrapula/id1572320652"> | ||
<${Link} | ||
href="https://podcasts.apple.com/us/podcast/koodikrapula/id1572320652" | ||
> | ||
Apple Podcastsissa | ||
</a> | ||
<//> | ||
. | ||
</p> | ||
` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* eslint-disable eslint-comments/disable-enable-pair */ | ||
/* eslint-disable import/prefer-default-export */ | ||
|
||
export const linkClasses = | ||
'underline text-red(hover:600 active:700) focus-visible:(outline-none ring(2 blue-300 offset-2))' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
import markdownIt from 'markdown-it' | ||
import markdownItLinkAttributes from 'markdown-it-link-attributes' | ||
import { linkClasses } from './const' | ||
|
||
export default markdownIt({ html: true }) | ||
export default markdownIt({ html: true }).use(markdownItLinkAttributes, { | ||
attrs: { | ||
class: linkClasses, | ||
}, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: move this before
'no-use-before-define'
so that the built-in rules are sorted alphabetically. 😂