-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from oddbird/100-copy-colors-to-clipboard
Add click to copy behavior
- Loading branch information
Showing
32 changed files
with
334 additions
and
71 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ herman: | |
sassOptions: | ||
loadPaths: | ||
- 'src/sass' | ||
- 'node_modules' | ||
use: | ||
- 'config' | ||
display: | ||
|
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script lang="ts"> | ||
import Icon from '$lib/components/util/Icon.svelte'; | ||
export let text: string; | ||
export let size: string | null = null; | ||
let justCopied = false; | ||
let timeout: ReturnType<typeof setTimeout>; | ||
const copyOutput = () => { | ||
justCopied = true; | ||
void navigator.clipboard.writeText(text); | ||
clearTimeout(timeout); | ||
timeout = setTimeout(() => { | ||
justCopied = false; | ||
}, 1000); | ||
}; | ||
</script> | ||
|
||
<button on:click={copyOutput} type="button" data-btn="icon"> | ||
{#if !justCopied} | ||
<Icon name="clipboard" {size} /> | ||
<span class="sr-only">Click to copy</span> | ||
{:else} | ||
<Icon name="copy" {size} /> | ||
<span class="sr-only">Copied</span> | ||
{/if} | ||
</button> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 24.12 24.12" | ||
{...$$restProps} | ||
> | ||
<path | ||
id="arrow" | ||
d="m14.37,12.26l-.55.06v-1.65c0-.27-.18-.4-.25-.44-.08-.04-.28-.13-.51,0l-5.56,3.21c-.23.13-.25.35-.25.44s.02.31.25.44l5.56,3.21c.23.13.43.04.51,0s.25-.18.25-.44v-1.26l.44-.06c.91-.12,1.76-.17,2.54-.17,3.74,0,6.02,1.2,7.32,2.28-2.06-5.77-7.38-5.89-9.74-5.63h0Z" | ||
/> | ||
<path | ||
id="clipboard" | ||
d="m19.22,21.9c0,.33-.27.6-.6.6H2.25c-.33,0-.6-.27-.6-.6V5.3c0-.33.27-.6.6-.6h.6v.6c0,.8.65,1.45,1.45,1.45h12.28c.8,0,1.45-.65,1.45-1.45v-.6h.6c.33,0,.6.27.6.6v6.47c.55.18,1.09.41,1.63.7v-6.96c0-1.34-1.09-2.43-2.42-2.43h-2.29c-.25-.56-.81-.95-1.46-.95h-2.13c-.29,0-.53-.24-.53-.53,0-.88-.71-1.6-1.6-1.6s-1.6.71-1.6,1.6c0,.29-.24.53-.53.53h-2.13c-.65,0-1.21.39-1.46.95h-2.29c-1.34,0-2.42,1.09-2.42,2.43v16.18c0,1.34,1.09,2.43,2.42,2.43h16c1.34,0,2.42-1.09,2.42-2.43v-4.42c-.49-.17-1.03-.31-1.63-.41v5.05h0Z" | ||
/> | ||
</svg> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 24.12 24.12" | ||
data-icon-theme="success" | ||
{...$$restProps} | ||
> | ||
<path | ||
id="checkmark" | ||
d="m4.59,13.25c1.26.68,4.17,2.37,5.48,4.21.09.13.28.12.35-.02.87-1.66,4.8-10.28,12.46-8.69,0,0-7.71-4.73-13.37,4.62,0,0-1.09-.83-2.01-2.18-.14-.2-.41-.27-.62-.14l-2.32,1.49c-.26.17-.25.54.02.69v.02Z" | ||
/> | ||
<path | ||
id="circle" | ||
d="m19.14,10.58c.84,3.69-.78,7.66-4.23,9.63-4.23,2.42-9.64.95-12.07-3.29-1.61-2.81-1.49-6.14,0-8.77.76-1.33,1.86-2.48,3.28-3.3s2.97-1.18,4.5-1.15c2.04.03,4.02.76,5.6,2.09.1.09.21.17.31.26.58-.09,1.59-.1,2.18-.11-1.09-1.36-2.47-2.38-4-3.05-.71-.31-1.45-.54-2.21-.69-2.39-.46-4.95-.11-7.22,1.19S1.32,6.86.53,9.25C.22,10.19.04,11.17,0,12.17c-.07,1.9.36,3.83,1.37,5.6s2.46,3.12,4.13,4.02c2.04,1.1,4.41,1.51,6.73,1.13,1.2-.2,2.39-.6,3.51-1.24s2.07-1.46,2.85-2.4c1.33-1.6,2.15-3.54,2.38-5.57.14-1.24.06-2.5-.25-3.74-.49.09-1.14.22-1.64.4.02.07.04.14.06.21Z" | ||
/> | ||
</svg> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
@use 'config'; | ||
@use 'initial'; | ||
@use 'patterns'; | ||
@use 'components'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Components Manifest | ||
// =================== | ||
|
||
@forward 'social-nav'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[data-nav='social'] { | ||
--li-padding-bottom: 0; | ||
--link: var(--action-light); | ||
--link-focus: var(--action); | ||
|
||
a { | ||
&:link, | ||
&:visited { | ||
--outline-width: 0; | ||
|
||
display: block; | ||
|
||
&:focus-visible { | ||
transform: scale(1.15); | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
@forward 'accoutrement/sass/tools' with ( | ||
$size-var-prefix: '', | ||
$ratio-var-prefix: '', | ||
$color-var-prefix: '', | ||
$easing-var-prefix: '', | ||
$ratio-var-prefix: '', | ||
$size-var-prefix: '', | ||
$time-var-prefix: '' | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$springy: cubic-bezier(0.175, 0.885, 0.32, 1.275); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@use 'sassdoc-theme-herman/scss/utilities' as herman; | ||
@use '../tools'; | ||
@use 'easing'; | ||
@use 'times'; | ||
@use 'sass:meta'; | ||
@forward 'easing'; | ||
@forward 'times'; | ||
|
||
/// # Animation Config | ||
/// Accoutrement maps for storing global animation tokens. | ||
/// @link https://www.oddbird.net/accoutrement/docs/animate.html | ||
/// Accoutrement Animate | ||
/// @group animation | ||
|
||
/// ## Easing | ||
/// --------- | ||
/// Named easings that can be re-used to create consistent movement. | ||
/// @group animation | ||
/// @example scss | ||
/// @use 'config/animation/easing'; | ||
/// @use 'config/tools'; | ||
/// @use 'sass:meta'; | ||
/// | ||
/// @each $name, $easing in tools.compile-easing(meta.module-variables('easing')) { | ||
/// /* #{$name}: #{$easing}; */ | ||
/// } | ||
|
||
/// ## Times | ||
/// --------- | ||
/// Named times that can be re-used to create consistent motion timing. | ||
/// @group animation | ||
/// @example scss | ||
/// @use 'config/animation/times'; | ||
/// @use 'config/tools'; | ||
/// @use 'sass:meta'; | ||
/// | ||
/// @each $name, $time in tools.compile-times(meta.module-variables('times')) { | ||
/// /* #{$name}: #{$time}; */ | ||
/// } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
$fast: 300ms; | ||
$slow: 1000ms; |
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
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
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
Oops, something went wrong.