Skip to content

Commit

Permalink
feat: add css-api - fix comment about imports
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG committed Sep 23, 2024
1 parent a0f80c9 commit 4a8c549
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 64 deletions.
56 changes: 37 additions & 19 deletions src/scss/_common.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* stylelint-disable declaration-no-important */

@import 'private';
@import 'brand';

Expand Down Expand Up @@ -34,7 +35,12 @@
margin-bottom: 0 !important;
}

h1, h2, h3, h4, h5, h6 {
h1,
h2,
h3,
h4,
h5,
h6 {
margin-bottom: 15px;
font-weight: 500;
}
Expand Down Expand Up @@ -74,31 +80,32 @@
color: var(--yfm-color-link);
text-decoration: none;

&:hover, &:active {
&:hover,
&:active {
color: var(--yfm-color-link-hover);
}

&:not([href]) {
color: inherit;
}

}

strong {
font-weight: 700;
}

img, svg {
img,
svg {
box-sizing: content-box;
max-width: 100%;
border: none;
vertical-align: middle;

&[align=right] {
&[align='right'] {
padding-left: 20px;
}

&[align=left] {
&[align='left'] {
padding-right: 20px;
}
}
Expand Down Expand Up @@ -127,10 +134,12 @@
dl,
table,
pre {
margin: 0 0 15px 0;
margin: 0 0 15px;
}

ul, ol, dl {
ul,
ol,
dl {
& pre {
margin-top: 15px;
}
Expand Down Expand Up @@ -178,24 +187,27 @@
border-spacing: 0;
background: var(--yfm-color-base);

thead, tr:nth-child(2n) {
thead,
tr:nth-child(2n) {
background-color: var(--yfm-color-table-row-background);
}

tr:first-child {
td, th {
td,
th {
border-top: none;
}
}

tr:last-child {
td, th {
td,
th {
border-bottom: none;
}
}


th, td {
th,
td {
padding: 10px 20px;
overflow: hidden;
text-overflow: ellipsis;
Expand All @@ -214,10 +226,12 @@
text-align: left;
}

tr td:first-child, tr th:first-child {
tr td:first-child,
tr th:first-child {
border-left: none;
}
tr td:last-child, tr th:last-child {
tr td:last-child,
tr th:last-child {
border-right: none;
}
}
Expand Down Expand Up @@ -280,7 +294,8 @@
}
}

ul, ol {
ul,
ol {
padding-left: 2.2em;
}

Expand Down Expand Up @@ -363,7 +378,8 @@
white-space: pre;
}

sup, sub {
sup,
sub {
line-height: 0;
}

Expand Down Expand Up @@ -393,6 +409,8 @@
user-select: none;
}

--yfm-font-family-monospace: "Menlo", "Monaco", "Consolas", "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", "Courier", monospace;
--yfm-font-family-sans: 'Segoe UI', Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
--yfm-font-family-monospace: 'Menlo', 'Monaco', 'Consolas', 'Ubuntu Mono', 'Liberation Mono',
'DejaVu Sans Mono', 'Courier New', 'Courier', monospace;
--yfm-font-family-sans: 'Segoe UI', arial, helvetica, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
}
6 changes: 0 additions & 6 deletions src/scss/_cut.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
@import 'private';
@import 'brand';

.yfm-cut {
@include private-brand();
@include brand();

$class: &;
margin-bottom: 15px;

Expand Down
6 changes: 0 additions & 6 deletions src/scss/_file.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
@import 'private';
@import 'brand';

$defaultIcon: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzODQgNTEyIj48cGF0aCBmaWxsPSJjdXJyZW50Q29sb3IiIGQ9Ik0zNjkuOSA5Ny45TDI4NiAxNEMyNzcgNSAyNjQuOC0uMSAyNTIuMS0uMUg0OEMyMS41IDAgMCAyMS41IDAgNDh2NDE2YzAgMjYuNSAyMS41IDQ4IDQ4IDQ4aDI4OGMyNi41IDAgNDgtMjEuNSA0OC00OFYxMzEuOWMwLTEyLjctNS4xLTI1LTE0LjEtMzR6bS0yMi42IDIyLjdjMi4xIDIuMSAzLjUgNC42IDQuMiA3LjRIMjU2VjMyLjVjMi44LjcgNS4zIDIuMSA3LjQgNC4ybDgzLjkgODMuOXpNMzM2IDQ4MEg0OGMtOC44IDAtMTYtNy4yLTE2LTE2VjQ4YzAtOC44IDcuMi0xNiAxNi0xNmgxNzZ2MTA0YzAgMTMuMyAxMC43IDI0IDI0IDI0aDEwNHYzMDRjMCA4LjgtNy4yIDE2LTE2IDE2em0tNDgtMjQ0djhjMCA2LjYtNS40IDEyLTEyIDEySDEwOGMtNi42IDAtMTItNS40LTEyLTEydi04YzAtNi42IDUuNC0xMiAxMi0xMmgxNjhjNi42IDAgMTIgNS40IDEyIDEyem0wIDY0djhjMCA2LjYtNS40IDEyLTEyIDEySDEwOGMtNi42IDAtMTItNS40LTEyLTEydi04YzAtNi42IDUuNC0xMiAxMi0xMmgxNjhjNi42IDAgMTIgNS40IDEyIDEyem0wIDY0djhjMCA2LjYtNS40IDEyLTEyIDEySDEwOGMtNi42IDAtMTItNS40LTEyLTEydi04YzAtNi42IDUuNC0xMiAxMi0xMmgxNjhjNi42IDAgMTIgNS40IDEyIDEyeiIvPjwvc3ZnPg==');

/**
Expand All @@ -10,9 +7,6 @@ $defaultIcon: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5
*/

.yfm-file {
@include private-brand();
@include brand();

&__icon {
---yfm-file-icon-img: var(--yfm-file-icon, #{$defaultIcon});

Expand Down
10 changes: 0 additions & 10 deletions src/scss/_highlight.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
@import 'private';
@import 'brand';

.yfm {
@include private-brand();
@include brand();

.hljs {
display: block;
overflow-x: auto;
Expand All @@ -21,7 +15,6 @@
color: var(--yfm-color-hljs-comment);
}


.hljs-keyword,
.hljs-attribute,
.hljs-selector-tag,
Expand Down Expand Up @@ -58,7 +51,6 @@
color: var(--yfm-color-hljs-pseudo);
}


.hljs-literal {
color: var(--yfm-color-hljs-literal);
}
Expand All @@ -70,7 +62,6 @@
color: var(--yfm-color-hljs-addition);
}


.hljs-meta {
color: var(--yfm-color-hljs-meta);
}
Expand All @@ -79,7 +70,6 @@
color: var(--yfm-color-hljs-meta-string);
}


.hljs-emphasis {
font-style: italic;
}
Expand Down
6 changes: 0 additions & 6 deletions src/scss/_modal.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/* stylelint-disable declaration-no-important */

@import 'private';
@import 'brand';

.wide-container {
@include private-brand();
@include brand();

position: fixed;
width: 100vw;
height: 100vh;
Expand Down
8 changes: 1 addition & 7 deletions src/scss/_note.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
@import 'private';
@import 'brand';

.yfm .yfm-note {
@include private-brand();
@include brand();

max-width: 1296px;
margin: 20px 0;
padding: 20px 20px 20px 64px;
Expand All @@ -15,7 +9,7 @@
}

& > p {
margin: 0 0 10px 0;
margin: 0 0 10px;

&:first-child {
&::before {
Expand Down
11 changes: 1 addition & 10 deletions src/scss/_term.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
@import 'private';
@import 'brand';

.yfm-term {
@include private-brand();
@include brand();

&_title {
color: var(--yfm-color-term-title);
cursor: pointer;
Expand Down Expand Up @@ -53,10 +47,7 @@
content: '';
position: absolute;
z-index: -1;
top: 0;
right: 0;
bottom: 0;
left: 0;
inset: 0;

border-radius: inherit;
box-shadow: 0 0 0 1px var(--yfm-color-term-dfn-pseudo-shadow);
Expand Down

0 comments on commit 4a8c549

Please sign in to comment.