Last active
January 17, 2021 18:56
-
-
Save Wolfr/a7fc62ed0ba8e4047af54175641525f7 to your computer and use it in GitHub Desktop.
Toolbar
This file contains hidden or 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
body { | |
background: red; | |
} | |
.st-toolbar { | |
display: flex; | |
width: 100%; | |
justify-content: space-between; | |
} | |
.st-toolbar-group { | |
display: flex; | |
} | |
.st-toolbar-group--left .st-toolbar-item { | |
margin-right: 20px; | |
} | |
.st-toolbar-group--right .st-toolbar-item { | |
margin-left: 20px; | |
} | |
.st-button-group { | |
display: flex; | |
} | |
.st-button-group button { | |
margin-right: 8px; | |
} | |
button { | |
background: red; | |
} |
This file contains hidden or 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
<st-toolbar> | |
<st-toolbar-group side="left"> | |
<st-toolbar-item> | |
<st-button-group> | |
<st-button label="Max" /> | |
</st-button-group> | |
</st-toolbar-item> | |
</st-toolbar-group> | |
<st-toolbar-group side="right"> | |
<st-toolbar-item> | |
<st-button-group> | |
<st-button label="Max" /> | |
</st-button-group> | |
</st-toolbar-item> | |
</st-toolbar-group> | |
</st-toolbar> |
This file contains hidden or 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
import { Component, Prop, h } from '@stencil/core'; | |
@Component({ | |
tag: 'st-toolbar-group', | |
shadow: true, | |
}) | |
export class StButton { | |
@Prop() side: string; | |
render() { | |
return <div | |
class={{ | |
'st-toolbar-group': true, | |
'st-toolbar-group--left': this.side === 'left', | |
'st-toolbar-group--right': this.side === 'right' | |
}} | |
> | |
<slot /> | |
</div>; | |
} | |
} |
This file contains hidden or 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
import { Component, Prop, h } from '@stencil/core'; | |
@Component({ | |
tag: 'st-toolbar-item', | |
shadow: true, | |
}) | |
export class StButton { | |
@Prop() label: string; | |
render() { | |
return <div class="st-toolbar-item"><slot /></div>; | |
} | |
} |
This file contains hidden or 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
import { Component, h } from '@stencil/core'; | |
@Component({ | |
tag: 'st-toolbar', | |
shadow: true, | |
}) | |
export class StButton { | |
render() { | |
return <div class="st-toolbar"><slot /></div>; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment