Skip to content

Commit

Permalink
Add squircles
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 2, 2021
1 parent 0b5bf2e commit 5568764
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
6 changes: 6 additions & 0 deletions asset/houdini.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* eslint-env browser */
if ('paintWorklet' in CSS) {
CSS.paintWorklet.addModule(
'https://www.unpkg.com/css-houdini-squircle@0.1.5/squircle.min.js'
)
}
20 changes: 20 additions & 0 deletions asset/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ abbr {
background-color: rgb(0 0 0 / 4%);
border-radius: 8px;
overflow: hidden;
mask-image: paint(squircle);

--squircle-radius: 8px;
--squircle-smooth: 1;
}

.release {
Expand Down Expand Up @@ -512,6 +516,10 @@ abbr {
background-color: var(--hl);
color: var(--blue-1);
transition: color 200ms, background-color 200ms;
mask-image: paint(squircle);

--squircle-radius: 3px;
--squircle-smooth: 1;
}

a.tag:hover,
Expand Down Expand Up @@ -569,6 +577,10 @@ a.tag:focus .count {
.landing {
color: var(--gray-0);
background-image: linear-gradient(150deg, #0366d6 15%, #24292e 85%);
mask-image: paint(squircle);

--squircle-radius: 16px;
--squircle-smooth: 1;
}

.landing .article {
Expand Down Expand Up @@ -684,6 +696,10 @@ a.tag:focus .count {
border: 0;
border-radius: 3px;
height: calc(0.25 * (1em + 1ex));
mask-image: paint(squircle);

--squircle-radius: 3px;
--squircle-smooth: 1;
}

.content table {
Expand Down Expand Up @@ -725,6 +741,10 @@ a.tag:focus .count {
border-radius: 3px;
position: absolute;
left: 0;
mask-image: paint(squircle);

--squircle-radius: 3px;
--squircle-smooth: 1;
}

.content ul ul,
Expand Down
2 changes: 1 addition & 1 deletion generate/pipeline/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const main = unified()
.use(rehypePictures, {base: path.join('build')})
.use(rehypeDocument, {
title: 'unified',
js: ['/search.js'],
js: ['/houdini.js', '/search.js'],
link: [
// We take images from these two, so preconnect asap.
{rel: 'preconnect', href: 'https://github.com'},
Expand Down

0 comments on commit 5568764

Please sign in to comment.