-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
id
and ability to copy link of each section of spec
- Loading branch information
1 parent
3811378
commit 4b5afc4
Showing
7 changed files
with
273 additions
and
46 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
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,9 +1,15 @@ | ||
-- import: fastn | ||
|
||
-- fastn.package: fast-nspec | ||
-- fastn.package: fastn-spec.fifthtry.site | ||
|
||
-- fastn.dependency: design-system.fifthtry.site | ||
provided-via: fastn-spec.fifthtry.site/ds | ||
|
||
-- fastn.dependency: dark-flame-cs.fifthtry.site | ||
-- fastn.dependency: midnight-storm-typography.fifthtry.site | ||
-- fastn.dependency: svg-icons.fifthtry.site | ||
|
||
|
||
-- fastn.auto-import: design-system.fifthtry.site as ds | ||
-- fastn.auto-import: fastn-spec.fifthtry.site/eds as eds | ||
-- fastn.auto-import: fastn/processors as pr |
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 @@ | ||
-- import: design-system.fifthtry.site | ||
export: borders, button, icon-button, primary-button, toggle-image-link, secondary-button, circle-text-button, phosphor-icon-button, inline-row, footer-link, copyright-text, page-widths, header-link, page, heading-hero, heading-medium, heading-small, heading-tiny, copy-large, copy-regular, copy-small, fine-print, source-code, link, section-row, section-column, column, element-radius, radius, row, flush, gap, hv, spaces, border-data, border-bottom, alert, container, text-input, danger-button, checkbox, link-button, floater, copy-to-clipboard-text, copy-to-clipboard-icon, label-text, package-info, storybook, code, heading-large, | ||
exposing: page-widths | ||
|
||
|
||
-- page-widths widths: | ||
regular.px: 1140 | ||
narrow.px: 800 | ||
wide.px: 1340 | ||
|
||
-- import: dark-flame-cs.fifthtry.site as dark-flame | ||
-- import: midnight-storm-typography.fifthtry.site as typography | ||
|
||
-- ftd.color-scheme colors: $dark-flame.main | ||
-- ftd.type-data types: $typography.types |
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,106 @@ | ||
-- import: svg-icons.fifthtry.site/phosphor | ||
|
||
-- string current-url: | ||
$processor$: pr.current-url | ||
|
||
-- component heading-large-id: | ||
caption text: | ||
string id: | ||
optional ds.gap margin: | ||
ftd.color color: $ds.colors.text-strong | ||
optional string link: | ||
ftd.text-style list style: | ||
optional body content: | ||
private string slug: $url(a = $heading-large-id.id) | ||
private boolean $copied: false | ||
|
||
-- ftd.column: | ||
|
||
-- ftd.row: | ||
id: $heading-large-id.id | ||
align-content: left | ||
|
||
-- phosphor.light: clipboard | ||
size: 32 | ||
if: { !heading-large-id.copied } | ||
$on-click$: $ftd.copy-to-clipboard(a = $heading-large-id.slug) | ||
$on-click$: $ftd.set-bool($a = $heading-large-id.copied, v = true) | ||
|
||
-- phosphor.light: clipboard-text | ||
size: 32 | ||
if: { heading-large-id.copied } | ||
$on-click$: $ftd.copy-to-clipboard(a = $heading-large-id.slug) | ||
$on-click$: $ftd.set-bool($a = $heading-large-id.copied, v = false) | ||
|
||
|
||
-- ds.heading-large: $heading-large-id.text | ||
margin: $heading-large-id.margin | ||
color: $heading-large-id.color | ||
link: $heading-large-id.link | ||
style: $heading-large-id.style | ||
|
||
|
||
-- end: ftd.row | ||
|
||
-- ds.copy-regular: | ||
if: { heading-large-id.content } | ||
|
||
$heading-large-id.content | ||
|
||
-- end: ftd.column | ||
|
||
-- end: heading-large-id | ||
|
||
-- component heading-medium-id: | ||
caption text: | ||
string id: | ||
optional ds.gap margin: | ||
ftd.color color: $ds.colors.text-strong | ||
optional string link: | ||
ftd.text-style list style: | ||
private string slug: $url(a = $heading-medium-id.id) | ||
private boolean $copied: false | ||
optional body content: | ||
|
||
-- ftd.column: | ||
|
||
-- ftd.row: | ||
id: $heading-medium-id.id | ||
align-content: left | ||
|
||
-- phosphor.light: clipboard | ||
size: 32 | ||
if: { !heading-medium-id.copied } | ||
$on-click$: $ftd.copy-to-clipboard(a = $heading-medium-id.slug) | ||
$on-click$: $ftd.set-bool($a = $heading-medium-id.copied, v = true) | ||
|
||
-- phosphor.light: clipboard-text | ||
size: 32 | ||
if: { heading-medium-id.copied } | ||
$on-click$: $ftd.copy-to-clipboard(a = $heading-medium-id.slug) | ||
$on-click$: $ftd.set-bool($a = $heading-medium-id.copied, v = false) | ||
|
||
|
||
-- ds.heading-medium: $heading-medium-id.text | ||
margin: $heading-medium-id.margin | ||
color: $heading-medium-id.color | ||
link: $heading-medium-id.link | ||
style: $heading-medium-id.style | ||
|
||
-- end: ftd.row | ||
|
||
-- ds.copy-regular: | ||
if: { heading-medium-id.content } | ||
|
||
$heading-medium-id.content | ||
|
||
-- end: ftd.column | ||
|
||
-- end: heading-medium-id | ||
|
||
|
||
-- string url(a): | ||
string a: | ||
string current_url: $current-url | ||
|
||
"https://fastn-spec.fifthtry.site" + current_url + "#" + a |
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.