-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(demo): use css variable instead of shadow mixin
- Loading branch information
Showing
2 changed files
with
53 additions
and
45 deletions.
There are no files selected for viewing
34 changes: 22 additions & 12 deletions
34
projects/demo/src/modules/markup/shadows/shadows.style.less
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,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); | ||
} |
64 changes: 31 additions & 33 deletions
64
projects/demo/src/modules/markup/shadows/shadows.template.html
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,36 +1,34 @@ | ||
<tui-doc-page header="Shadows"> | ||
<ng-template pageTab> | ||
<p>Different kinds of shadows can be applied with mixin:</p> | ||
<div class="example"> | ||
<div class="item item_default"> | ||
<span> | ||
Basic shadow: | ||
<code>.shadow(1)</code> | ||
with | ||
<code>.shadow(5)</code> | ||
when hovered | ||
</span> | ||
</div> | ||
<div class="item item_dropdown"> | ||
Dropdown shadow: | ||
<code>.shadow(2)</code> | ||
</div> | ||
<div class="item item_modal"> | ||
Modal shadow: | ||
<code>.shadow(3)</code> | ||
</div> | ||
<div class="item item_sidebar"> | ||
Sidebar shadow: | ||
<code>.shadow(4)</code> | ||
</div> | ||
<div class="item item_navigation"> | ||
Navigation shadow: | ||
<code>.shadow(6)</code> | ||
</div> | ||
<div class="item item_mobile"> | ||
Mobile modal shadow: | ||
<code>.shadow(7)</code> | ||
</div> | ||
<p class="title tui-space_bottom-5">Different kinds of shadows can be applied with css variables:</p> | ||
<div class="examples"> | ||
<div class="item item_default"> | ||
<span> | ||
Basic shadow: | ||
<code class="code">--tui-shadow</code> | ||
with | ||
<code class="code">--tui-shadow-hovered</code> | ||
when hovered | ||
</span> | ||
</div> | ||
</ng-template> | ||
<div class="item item_dropdown"> | ||
Dropdown shadow: | ||
<code class="code">--tui-shadow-dropdown</code> | ||
</div> | ||
<div class="item item_modal"> | ||
Modal shadow: | ||
<code class="code">--tui-shadow-modal</code> | ||
</div> | ||
<div class="item item_sidebar"> | ||
Sidebar shadow: | ||
<code class="code">--tui-shadow-sidebar</code> | ||
</div> | ||
<div class="item item_navigation"> | ||
Navigation shadow: | ||
<code class="code">--tui-shadow-navigation</code> | ||
</div> | ||
<div class="item item_mobile"> | ||
Mobile modal shadow: | ||
<code class="code">--tui-shadow-sheet</code> | ||
</div> | ||
</div> | ||
</tui-doc-page> |