-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(spacings): document available css custom props
- Loading branch information
1 parent
6d44cd3
commit 95ce751
Showing
14 changed files
with
142 additions
and
87 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
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,79 @@ | ||
@define-mixin docs-spacing-ui-light { | ||
.docs-spacing { | ||
border-color: var(--ld-col-rblck1); | ||
} | ||
} | ||
@define-mixin docs-spacing-ui-dark { | ||
.docs-spacing { | ||
border-color: var(--ld-col-rblck4); | ||
} | ||
} | ||
|
||
@mixin docs-spacing-ui-light; | ||
|
||
@media (prefers-color-scheme: dark) { | ||
@mixin docs-spacing-ui-dark; | ||
} | ||
.docs-ui-dark { | ||
@mixin docs-spacing-ui-dark; | ||
} | ||
.docs-ui-light { | ||
@mixin docs-spacing-ui-light; | ||
} | ||
|
||
.docs-spacing { | ||
display: flex; | ||
width: 100%; | ||
align-items: center; | ||
overflow: hidden; | ||
border-style: solid; | ||
border-width: var(--ld-sp-1); | ||
color: var(--ld-col-rblck-default); | ||
background-color: var(--ld-col-wht); | ||
padding: var(--ld-sp-16) var(--ld-sp-16) var(--ld-sp-16) var(--ld-sp-8); | ||
min-height: 6rem; | ||
|
||
&:first-of-type { | ||
border-top-left-radius: var(--ld-br-l); | ||
border-top-right-radius: var(--ld-br-l); | ||
} | ||
&:last-of-type { | ||
border-bottom-left-radius: var(--ld-br-l); | ||
border-bottom-right-radius: var(--ld-br-l); | ||
} | ||
&:not(:first-of-type) { | ||
border-top-width: 0; | ||
} | ||
&:not(:last-of-type) { | ||
border-bottom-width: 0; | ||
} | ||
} | ||
|
||
.docs-spacing__var, | ||
.docs-spacing__val { | ||
display: flex; | ||
border-radius: var(--ld-br-l); | ||
align-items: center; | ||
font: var(--ld-typo-body-s); | ||
font-family: 'Source Code Pro', Consolas, Monaco, 'Ubuntu Mono', monospace; | ||
flex-shrink: 0; | ||
white-space: nowrap; | ||
|
||
.docs-copy-to-cb { | ||
margin-right: var(--ld-sp-8); | ||
} | ||
} | ||
|
||
.docs-spacing__var { | ||
width: 9rem; | ||
} | ||
|
||
.docs-spacing__val { | ||
color: var(--ld-col-rblck3); | ||
width: 6.5rem; | ||
} | ||
|
||
.docs-spacing__vis { | ||
display: inline-flex; | ||
background-color: var(--ld-col-vm-default); | ||
} |
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,32 @@ | ||
import '../../../components' // type definitions for type checks and intelliSense | ||
import { Component, h, Host, Prop } from '@stencil/core' | ||
|
||
/** @internal **/ | ||
@Component({ | ||
tag: 'docs-spacing', | ||
styleUrl: 'docs-spacing.css', | ||
shadow: false, | ||
}) | ||
export class DocsSpacing { | ||
/** CSS variable name */ | ||
@Prop() var: string | ||
|
||
/** CSS variable value */ | ||
@Prop() val: string | ||
|
||
render() { | ||
return ( | ||
<Host class="docs-spacing"> | ||
<span class="docs-spacing__var"> | ||
<docs-copy-to-cb textToCopy={this.var} /> | ||
{this.var} | ||
</span> | ||
<span class="docs-spacing__val">{this.val}</span> | ||
<span | ||
class="docs-spacing__vis" | ||
style={{ width: `var(${this.var})`, height: `var(${this.var})` }} | ||
></span> | ||
</Host> | ||
) | ||
} | ||
} |
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
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