mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-25 16:19:44 +02:00
Add button component (twig) (#188)
* Add button component * Replace old buttons with the new ones * Update icons and border radius * Update add page button * Set size small to add page btn * Update button indentation * Cleanup * icons and button component updated * upd secondary colour, page button call * Update small button padding right Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
This commit is contained in:
parent
f75401d0fb
commit
f714225e20
14 changed files with 177 additions and 46 deletions
83
src/frontend/styles/components/button.pcss
Normal file
83
src/frontend/styles/components/button.pcss
Normal file
|
@ -0,0 +1,83 @@
|
|||
.docs-button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: var(--height);
|
||||
padding-left: 12px;
|
||||
padding-right: 12px;
|
||||
color: white;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition-property: background-color;
|
||||
transition-duration: 0.1s;
|
||||
border-radius: 8px;
|
||||
|
||||
@supports(-webkit-mask-box-image: url('')){
|
||||
border-radius: 0;
|
||||
-webkit-mask-box-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10.3872C0 1.83334 1.83334 0 10.3872 0H13.6128C22.1667 0 24 1.83334 24 10.3872V13.6128C24 22.1667 22.1667 24 13.6128 24H10.3872C1.83334 24 0 22.1667 0 13.6128V10.3872Z' fill='black'/%3E%3C/svg%3E%0A") 48% 41% 37.9% 53.3%;;
|
||||
}
|
||||
|
||||
&__icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 4px;
|
||||
|
||||
svg {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
&--default {
|
||||
--height: 40px;
|
||||
}
|
||||
|
||||
&--small {
|
||||
--height: 32px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
&--primary {
|
||||
background: var(--color-button-primary);
|
||||
|
||||
&:hover {
|
||||
background: var(--color-button-primary-hover);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: var(--color-button-primary-active);
|
||||
}
|
||||
}
|
||||
|
||||
&--secondary {
|
||||
background: var(--color-button-secondary);
|
||||
|
||||
&:hover {
|
||||
background: var(--color-button-secondary-hover);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: var(--color-button-secondary-active);
|
||||
}
|
||||
}
|
||||
|
||||
&--warning {
|
||||
background: var(--color-button-warning);
|
||||
|
||||
&:hover {
|
||||
background: var(--color-button-warning-hover);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: var(--color-button-warning-active);
|
||||
}
|
||||
}
|
||||
|
||||
&--with-icon {
|
||||
padding-left: 8px;
|
||||
}
|
||||
}
|
|
@ -12,9 +12,9 @@
|
|||
line-height: 40px;
|
||||
}
|
||||
|
||||
a {
|
||||
&__menu-link,
|
||||
&__logo {
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
&__logo {
|
||||
|
@ -55,24 +55,22 @@
|
|||
a {
|
||||
@media (--mobile) {
|
||||
font-size: 0;
|
||||
padding: 8px;
|
||||
padding: 0 4px;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.docs-button__icon {
|
||||
@media (--mobile) {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a:not(.docs-header__button) {
|
||||
color: inherit;
|
||||
|
||||
&-link {
|
||||
&:hover {
|
||||
color: var(--color-link-active);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__button {
|
||||
@apply --button;
|
||||
@apply --button-primary;
|
||||
margin: auto 30px auto auto;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
&__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: var(--color-text-second);
|
||||
|
||||
@media (--mobile) {
|
||||
|
@ -40,11 +41,8 @@
|
|||
}
|
||||
|
||||
&-button {
|
||||
@apply --button;
|
||||
@apply --button-primary;
|
||||
padding: 5px 10px;
|
||||
font-size: 13px;
|
||||
margin-left: 10px;
|
||||
margin-left: 20px;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,9 +31,10 @@
|
|||
}
|
||||
|
||||
.writing-buttons {
|
||||
&__remove {
|
||||
@apply --button;
|
||||
@apply --button-danger;
|
||||
display: flex;
|
||||
|
||||
button:not(:last-child) {
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
@import './components/page.pcss';
|
||||
@import './components/landing.pcss';
|
||||
@import './components/auth.pcss';
|
||||
@import './components/button.pcss';
|
||||
|
||||
body {
|
||||
font-family: system-ui, Helvetica, Arial, Verdana;
|
||||
|
@ -19,3 +20,8 @@ body {
|
|||
svg {
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: inherit
|
||||
}
|
||||
|
|
|
@ -3,10 +3,22 @@
|
|||
--color-text-second: #5d6068;
|
||||
--color-line-gray: #E8E8EB;
|
||||
--color-link-active: #2071cc;
|
||||
--color-button-danger: #ff5159;
|
||||
--color-bg-light: #f8f7fa;
|
||||
--color-page-active: #ff1767;
|
||||
|
||||
--color-button-primary: #3389FF;
|
||||
--color-button-primary-hover: #2E7AE6;
|
||||
--color-button-primary-active: #296DCC;
|
||||
|
||||
--color-button-secondary: #717682;
|
||||
--color-button-secondary-hover: #5D6068;
|
||||
--color-button-secondary-active: #4B4F5B;
|
||||
|
||||
--color-button-warning: #EF5C5C;
|
||||
--color-button-warning-hover: #D65151;
|
||||
--color-button-warning-active: #BD4848;
|
||||
|
||||
|
||||
/**
|
||||
* Site layout sizes
|
||||
*/
|
||||
|
@ -47,15 +59,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
--button-danger {
|
||||
background: var(--color-button-danger);
|
||||
color: #fff;
|
||||
box-shadow: none;
|
||||
|
||||
&:hover {
|
||||
background: color-mod(var(--color-button-danger) blackness(+10%));
|
||||
}
|
||||
}
|
||||
|
||||
--button-primary {
|
||||
background: var(--color-link-active);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue