From 9438f8ef61ee3f450e5b072ebcca05ac64671800 Mon Sep 17 00:00:00 2001 From: Peter Savchenko Date: Fri, 20 May 2022 22:42:58 +0300 Subject: [PATCH] upd secondary colour, page button call --- src/backend/views/components/button.twig | 4 +++- src/backend/views/pages/page.twig | 4 +--- src/frontend/styles/components/button.pcss | 1 - src/frontend/styles/vars.pcss | 6 +++--- src/frontend/svg/trash.svg | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/backend/views/components/button.twig b/src/backend/views/components/button.twig index 19b0e5c..9527399 100644 --- a/src/backend/views/components/button.twig +++ b/src/backend/views/components/button.twig @@ -6,6 +6,8 @@ - name - style: primary, secondary or warning - size: small, default + - url: URL to navigate in case if button is the navigation link + - class: additional class for the button Usage example: {% include 'components/button.twig' with {label: 'Label', icon: 'check', style: 'secondary', size: 'default'} %} @@ -22,7 +24,7 @@ <{{tag}} {{ name is not empty ? 'name="' ~ name ~ '"': '' }} - class="{{mainClass}} {{mainClass}}--{{style|default('primary')}} {{mainClass}}--{{size|default('default')}} {{icon ? mainClass ~ '--with-icon' : ''}}" + class="{{ mainClass }} {{ mainClass }}--{{ style|default('primary') }} {{ mainClass }}--{{ size|default('default') }} {{ icon ? mainClass ~ '--with-icon' : '' }} {{ class ?? '' }}" {{ url is not empty ? 'href="' ~ url ~ '"' : '' }} > {% if icon %} diff --git a/src/backend/views/pages/page.twig b/src/backend/views/pages/page.twig index 83553c7..e123c4d 100644 --- a/src/backend/views/pages/page.twig +++ b/src/backend/views/pages/page.twig @@ -20,9 +20,7 @@ Last edit {{ (page.body.time / 1000) | date("M d Y") }} {% if isAuthorized == true %} - - {% include 'components/button.twig' with {label: 'Edit', icon: 'pencil', size: 'small'} %} - + {% include 'components/button.twig' with {label: 'Edit', icon: 'pencil', size: 'small', url: '/page/edit/' ~ page._id, class: 'page__header-button'} %} {% endif %}

diff --git a/src/frontend/styles/components/button.pcss b/src/frontend/styles/components/button.pcss index 3be0a9b..3111d01 100644 --- a/src/frontend/styles/components/button.pcss +++ b/src/frontend/styles/components/button.pcss @@ -55,7 +55,6 @@ &--secondary { background: var(--color-button-secondary); - color: var(--color-text-main); &:hover { background: var(--color-button-secondary-hover); diff --git a/src/frontend/styles/vars.pcss b/src/frontend/styles/vars.pcss index 78c4fe4..93dbae5 100644 --- a/src/frontend/styles/vars.pcss +++ b/src/frontend/styles/vars.pcss @@ -10,9 +10,9 @@ --color-button-primary-hover: #2E7AE6; --color-button-primary-active: #296DCC; - --color-button-secondary: #F3F6F8; - --color-button-secondary-hover: #D9DCDE; - --color-button-secondary-active: #C0C3C4; + --color-button-secondary: #717682; + --color-button-secondary-hover: #5D6068; + --color-button-secondary-active: #4B4F5B; --color-button-warning: #EF5C5C; --color-button-warning-hover: #D65151; diff --git a/src/frontend/svg/trash.svg b/src/frontend/svg/trash.svg index ae7f535..27e759f 100644 --- a/src/frontend/svg/trash.svg +++ b/src/frontend/svg/trash.svg @@ -1,3 +1,3 @@ - +