From 8aa34e916c44678e5417c0d0187bdcbbc84183c0 Mon Sep 17 00:00:00 2001 From: splincode Date: Sun, 3 Dec 2023 16:31:37 +0300 Subject: [PATCH] chore(demo): use css variable instead of shadow mixin --- .../modules/markup/shadows/shadows.style.less | 34 ++++++---- .../markup/shadows/shadows.template.html | 64 +++++++++---------- 2 files changed, 53 insertions(+), 45 deletions(-) diff --git a/projects/demo/src/modules/markup/shadows/shadows.style.less b/projects/demo/src/modules/markup/shadows/shadows.style.less index 5ddb13bdec008..9c2f3742e3a37 100644 --- a/projects/demo/src/modules/markup/shadows/shadows.style.less +++ b/projects/demo/src/modules/markup/shadows/shadows.style.less @@ -1,51 +1,61 @@ @import '@taiga-ui/core/styles/taiga-ui-local'; -.example { +.title { + text-align: center; +} + +.examples { display: flex; - flex: 1; + gap: 2.5rem; flex-wrap: wrap; - padding: 1.25rem; + align-items: center; + justify-content: center; } .item { .transition(box-shadow); display: flex; + flex-direction: column; align-items: center; justify-content: center; - margin-top: 2.5rem; - margin-left: 2.5rem; width: 17.5rem; height: 5rem; + padding: 0.3125rem; border-radius: var(--tui-radius-m); + border: 1px solid var(--tui-base-02); color: var(--tui-text-03); cursor: pointer; text-align: center; &_default { - .shadow(); + box-shadow: var(--tui-shadow); &:hover { - .shadow(5); + box-shadow: var(--tui-shadow-hover); } } &_dropdown { - .shadow(2); + box-shadow: var(--tui-shadow-dropdown); } &_modal { - .shadow(3); + box-shadow: var(--tui-shadow-modal); } &_sidebar { - .shadow(4); + box-shadow: var(--tui-shadow-sidebar); } &_navigation { - .shadow(6); + box-shadow: var(--tui-shadow-navigation); } &_mobile { - .shadow(7); + box-shadow: var(--tui-shadow-sheet); } } + +.code:not(pre code) { + color: var(--tui-link); +} diff --git a/projects/demo/src/modules/markup/shadows/shadows.template.html b/projects/demo/src/modules/markup/shadows/shadows.template.html index e215ec60f17a8..26a761a76abd7 100644 --- a/projects/demo/src/modules/markup/shadows/shadows.template.html +++ b/projects/demo/src/modules/markup/shadows/shadows.template.html @@ -1,36 +1,34 @@ - -

Different kinds of shadows can be applied with mixin:

-
-
- - Basic shadow: - .shadow(1) - with - .shadow(5) - when hovered - -
-
- Dropdown shadow: - .shadow(2) -
-
- Modal shadow: - .shadow(3) -
-
- Sidebar shadow: - .shadow(4) -
-
- Navigation shadow: - .shadow(6) -
-
- Mobile modal shadow: - .shadow(7) -
+

Different kinds of shadows can be applied with css variables:

+
+
+ + Basic shadow: + --tui-shadow + with + --tui-shadow-hovered + when hovered +
- +
+ Dropdown shadow: + --tui-shadow-dropdown +
+
+ Modal shadow: + --tui-shadow-modal +
+
+ Sidebar shadow: + --tui-shadow-sidebar +
+
+ Navigation shadow: + --tui-shadow-navigation +
+
+ Mobile modal shadow: + --tui-shadow-sheet +
+