-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ld-heading): heading theming and coloring
- Loading branch information
1 parent
a84f392
commit 124b26f
Showing
15 changed files
with
262 additions
and
134 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 was deleted.
Oops, something went wrong.
52 changes: 29 additions & 23 deletions
52
...cs-web-css-switch/docs-web-css-switch.css → ...cs-switch-web-css/docs-switch-web-css.css
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,93 +1,99 @@ | ||
@define-mixin docs-web-css-switch-ui-light { | ||
.docs-web-css-switch button { | ||
@define-mixin docs-switch-web-css-ui-light { | ||
.docs-switch-web-css button { | ||
background-color: var(--ld-col-bg-g); | ||
|
||
&:focus:focus-visible { | ||
.docs-web-css-switch__option:not(.docs-web-css-switch__option--active) { | ||
.docs-switch-web-css__option:not(.docs-switch-web-css__option--active) { | ||
color: var(--ld-col-rb5); | ||
} | ||
} | ||
&:active, | ||
&:active:focus-visible { | ||
.docs-web-css-switch__option:not(.docs-web-css-switch__option--active) { | ||
.docs-switch-web-css__option:not(.docs-switch-web-css__option--active) { | ||
color: var(--ld-col-rb55); | ||
background-color: transparent; | ||
} | ||
} | ||
} | ||
.docs-web-css-switch__option { | ||
.docs-switch-web-css__option { | ||
color: var(--ld-col-rblck4); | ||
|
||
&:hover:not(.docs-web-css-switch__option--active) { | ||
&:hover:not(.docs-switch-web-css__option--active) { | ||
color: var(--ld-col-rb5); | ||
} | ||
} | ||
|
||
.docs-web-css-switch__option--active { | ||
.docs-switch-web-css__option--active { | ||
background-color: var(--ld-col-wht); | ||
color: var(--ld-col-rblck-default); | ||
} | ||
} | ||
@define-mixin docs-web-css-switch-ui-dark { | ||
.docs-web-css-switch button { | ||
@define-mixin docs-switch-web-css-ui-dark { | ||
.docs-switch-web-css button { | ||
background-color: var(--ld-col-rblck5); | ||
|
||
&:focus:focus-visible { | ||
.docs-web-css-switch__option:not(.docs-web-css-switch__option--active) { | ||
.docs-switch-web-css__option:not(.docs-switch-web-css__option--active) { | ||
color: var(--ld-col-rb3); | ||
background-color: var(--ld-col-rblck-default); | ||
} | ||
} | ||
&:active, | ||
&:active:focus-visible { | ||
.docs-web-css-switch__option:not(.docs-web-css-switch__option--active) { | ||
.docs-switch-web-css__option:not(.docs-switch-web-css__option--active) { | ||
color: var(--ld-col-rb2); | ||
background-color: var(--ld-col-rblck-default); | ||
} | ||
} | ||
} | ||
.docs-web-css-switch__option { | ||
.docs-switch-web-css__option { | ||
color: var(--ld-col-rblck2); | ||
|
||
&:hover:not(.docs-web-css-switch__option--active) { | ||
&:hover:not(.docs-switch-web-css__option--active) { | ||
color: var(--ld-col-rb3); | ||
} | ||
} | ||
|
||
.docs-web-css-switch__option--active { | ||
background-color: var(--ld-col-rblck2); | ||
.docs-switch-web-css__option--active { | ||
background-color: var(--ld-col-rblck3); | ||
color: var(--ld-col-rblck-default); | ||
} | ||
} | ||
|
||
@mixin docs-web-css-switch-ui-light; | ||
@mixin docs-switch-web-css-ui-light; | ||
|
||
@media (prefers-color-scheme: dark) { | ||
@mixin docs-web-css-switch-ui-dark; | ||
@mixin docs-switch-web-css-ui-dark; | ||
} | ||
.docs-ui-dark { | ||
@mixin docs-web-css-switch-ui-dark; | ||
@mixin docs-switch-web-css-ui-dark; | ||
} | ||
.docs-ui-light { | ||
@mixin docs-web-css-switch-ui-light; | ||
@mixin docs-switch-web-css-ui-light; | ||
} | ||
|
||
.docs-web-css-switch button { | ||
.docs-switch-web-css button { | ||
--switch-transition-duration: 0s; | ||
font: var(--ld-typo-body-s); | ||
font-weight: 900; | ||
border-radius: var(--ld-sp-4); | ||
display: flex; | ||
align-items: center; | ||
align-items: stretch; | ||
position: relative; | ||
border: 0; | ||
cursor: pointer; | ||
padding: 0; | ||
overflow: hidden; | ||
} | ||
|
||
.docs-web-css-switch__option { | ||
.docs-switch-web-css__option { | ||
position: relative; | ||
padding: var(--ld-sp-4) var(--ld-sp-16) var(--ld-sp-2); | ||
padding: var(--ld-sp-8) var(--ld-sp-16); | ||
z-index: 0; | ||
line-height: 0; | ||
} | ||
|
||
.docs-switch-web-css__icon { | ||
width: 1.5rem; | ||
height: 1rem; | ||
} |
77 changes: 77 additions & 0 deletions
77
src/docs/components/docs-switch-web-css/docs-switch-web-css.tsx
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,77 @@ | ||
import '../../../components' // type definitions for type checks and intelliSense | ||
import { | ||
Component, | ||
Event, | ||
EventEmitter, | ||
h, | ||
Host, | ||
Listen, | ||
Prop, | ||
} from '@stencil/core' | ||
|
||
/** @internal **/ | ||
@Component({ | ||
tag: 'docs-switch-web-css', | ||
styleUrl: 'docs-switch-web-css.css', | ||
shadow: false, | ||
}) | ||
export class DocsSwitchWebCss { | ||
/** On stands for web component; off stands for CSS component */ | ||
@Prop({ mutable: true }) isOn = true | ||
|
||
/** Theme select change event. */ | ||
@Event() switchComponent: EventEmitter<boolean> | ||
|
||
@Listen('click', { capture: true }) | ||
handleClick(ev) { | ||
ev.preventDefault() | ||
this.isOn = !this.isOn | ||
this.switchComponent.emit(this.isOn) | ||
} | ||
|
||
render() { | ||
return ( | ||
<Host class="docs-switch-web-css"> | ||
<button role="switch" aria-checked={this.isOn ? 'true' : 'false'}> | ||
<ld-sr-only> | ||
<slot></slot> | ||
</ld-sr-only> | ||
<span | ||
class={`docs-switch-web-css__option${ | ||
this.isOn ? ' docs-switch-web-css__option--active' : '' | ||
}`} | ||
> | ||
<svg | ||
class="docs-switch-web-css__icon" | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 800 800" | ||
> | ||
<title>Web Component</title> | ||
<path | ||
fill="currentColor" | ||
d="M196.3 400l200 346.4H200L0 400 200 53.6h196.3L196.3 400zM505.4 53.6H600L800 400 600 746.4h-94.6l-98-169.8H502L604 400 502 223.4h-94.7l98-169.8z" | ||
/> | ||
</svg> | ||
</span> | ||
<span | ||
class={`docs-switch-web-css__option${ | ||
!this.isOn ? ' docs-switch-web-css__option--active' : '' | ||
}`} | ||
> | ||
<svg | ||
class="docs-switch-web-css__icon" | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 800 300" | ||
> | ||
<title>CSS Component</title> | ||
<path | ||
fill="currentColor" | ||
d="M0 0h238.7v99.8H99.8v99.8h139v99.9H0V0zM283.2 0h235.3v85.6H381.6v17h136.9v196.9H283.2v-89.9h136.9v-17H283.2V0zM564.7 0H800v85.6H663.1v17H800v196.9H564.7v-89.9h136.9v-17H564.7V0z" | ||
/> | ||
</svg> | ||
</span> | ||
</button> | ||
</Host> | ||
) | ||
} | ||
} |
57 changes: 0 additions & 57 deletions
57
src/docs/components/docs-web-css-switch/docs-web-css-switch.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.