generated from diplodoc-platform/package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
166 additions
and
18 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// this styles for folding headings in markdown editor | ||
|
||
@use './mixins' as m; | ||
|
||
.yfm { | ||
h1[data-folded], | ||
h2[data-folded], | ||
h3[data-folded], | ||
h4[data-folded], | ||
h5[data-folded], | ||
h6[data-folded] { | ||
@include m.chevron(); | ||
} | ||
|
||
h1[data-folded] { | ||
@include m.chevron_size_xl(); | ||
} | ||
|
||
h2[data-folded], | ||
h3[data-folded] { | ||
@include m.chevron_size_l(); | ||
} | ||
|
||
h4[data-folded] { | ||
@include m.chevron_size_m(); | ||
} | ||
|
||
h5[data-folded] { | ||
@include m.chevron_size_s(); | ||
} | ||
|
||
h6[data-folded] { | ||
@include m.chevron_size_xs(); | ||
} | ||
|
||
h1[data-folded=false], | ||
h2[data-folded=false], | ||
h3[data-folded=false], | ||
h4[data-folded=false], | ||
h5[data-folded=false], | ||
h6[data-folded=false] { | ||
@include m.chevron_open(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,84 @@ | ||
$chevronIcon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/></svg>'); | ||
|
||
@mixin chevron() { | ||
position: relative; | ||
|
||
padding-left: 28px; | ||
|
||
&::before { | ||
position: absolute; | ||
z-index: 1; | ||
top: 50%; | ||
left: 0; | ||
|
||
content: ''; | ||
cursor: pointer; | ||
|
||
background-color: currentColor; | ||
mask-image: $chevronIcon; | ||
mask-repeat: no-repeat; | ||
mask-position: center; | ||
|
||
transition: transform 0.3s ease; | ||
transform: translateY(-50%) rotate(-90deg); | ||
} | ||
} | ||
|
||
@mixin chevron_size_xs() { | ||
&::before { | ||
left: 8px; | ||
|
||
width: 20px; | ||
height: 20px; | ||
|
||
mask-size: 12px; | ||
} | ||
} | ||
|
||
@mixin chevron_size_s() { | ||
&::before { | ||
left: 8px; | ||
|
||
width: 20px; | ||
height: 20px; | ||
|
||
mask-size: 14px; | ||
} | ||
} | ||
|
||
@mixin chevron_size_m() { | ||
&::before { | ||
left: 6px; | ||
|
||
width: 20px; | ||
height: 20px; | ||
|
||
mask-size: 16px; | ||
} | ||
} | ||
|
||
@mixin chevron_size_l() { | ||
&::before { | ||
left: 2px; | ||
|
||
width: 24px; | ||
height: 24px; | ||
|
||
mask-size: 20px; | ||
} | ||
} | ||
|
||
@mixin chevron_size_xl() { | ||
&::before { | ||
width: 28px; | ||
height: 28px; | ||
|
||
mask-size: 20px; | ||
} | ||
} | ||
|
||
@mixin chevron_open() { | ||
&::before { | ||
transform: translateY(-50%); | ||
} | ||
} |
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