mirror of
https://github.com/cotes2020/chirpy-starter.git
synced 2025-07-02 04:18:56 +10:00
fix: update layout and import Chirpy template files
This commit is contained in:
1532
_sass/addon/commons.scss
Normal file
1532
_sass/addon/commons.scss
Normal file
File diff suppressed because it is too large
Load Diff
204
_sass/addon/module.scss
Normal file
204
_sass/addon/module.scss
Normal file
@ -0,0 +1,204 @@
|
||||
/*
|
||||
* Mainly scss modules, only imported to `assets/css/main.scss`
|
||||
*/
|
||||
|
||||
/* ---------- scss placeholder --------- */
|
||||
|
||||
%heading {
|
||||
color: var(--heading-color);
|
||||
font-weight: 400;
|
||||
font-family: $font-family-heading;
|
||||
}
|
||||
|
||||
%section {
|
||||
main & {
|
||||
margin-top: 2.5rem;
|
||||
margin-bottom: 1.25rem;
|
||||
|
||||
&:focus {
|
||||
outline: none; /* avoid outline in Safari */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
%anchor {
|
||||
.anchor {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
@media (hover: hover) {
|
||||
.anchor {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
transition: opacity 0.25s ease-in, visibility 0s ease-in 0.25s;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.anchor {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
transition: opacity 0.25s ease-in, visibility 0s ease-in 0s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
%tag-hover {
|
||||
background: var(--tag-hover);
|
||||
transition: background 0.35s ease-in-out;
|
||||
}
|
||||
|
||||
%table-cell {
|
||||
padding: 0.4rem 1rem;
|
||||
font-size: 95%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
%link-hover {
|
||||
color: #d2603a !important;
|
||||
border-bottom: 1px solid #d2603a;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
%link-color {
|
||||
color: var(--link-color);
|
||||
}
|
||||
|
||||
%link-underline {
|
||||
border-bottom: 1px solid var(--link-underline-color);
|
||||
}
|
||||
|
||||
%clickable-transition {
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
%no-cursor {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
%no-bottom-border {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
%cursor-pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
%normal-font-style {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
%rounded {
|
||||
border-radius: $base-radius;
|
||||
}
|
||||
|
||||
%img-caption {
|
||||
+ em {
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
font-size: 80%;
|
||||
padding: 0;
|
||||
color: #6d6c6c;
|
||||
}
|
||||
}
|
||||
|
||||
%sidebar-links {
|
||||
color: var(--sidebar-muted-color);
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
%text-clip {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
%text-highlight {
|
||||
color: var(--text-muted-highlight-color);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
%text-sm {
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
%text-xs {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
%sup-fn-target {
|
||||
&:target {
|
||||
background-color: var(--footnote-target-bg);
|
||||
width: -moz-fit-content;
|
||||
width: -webkit-fit-content;
|
||||
width: fit-content;
|
||||
transition: background-color 1.75s ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- scss mixin --------- */
|
||||
|
||||
@mixin mt-mb($value) {
|
||||
margin-top: $value;
|
||||
margin-bottom: $value;
|
||||
}
|
||||
|
||||
@mixin ml-mr($value) {
|
||||
margin-left: $value;
|
||||
margin-right: $value;
|
||||
}
|
||||
|
||||
@mixin pt-pb($val) {
|
||||
padding-top: $val;
|
||||
padding-bottom: $val;
|
||||
}
|
||||
|
||||
@mixin pl-pr($val) {
|
||||
padding-left: $val;
|
||||
padding-right: $val;
|
||||
}
|
||||
|
||||
@mixin placeholder {
|
||||
color: var(--text-muted-color) !important;
|
||||
}
|
||||
|
||||
@mixin placeholder-focus {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
@mixin label($font-size: 1rem, $font-weight: 600, $color: var(--label-color)) {
|
||||
color: $color;
|
||||
font-size: $font-size;
|
||||
font-weight: $font-weight;
|
||||
}
|
||||
|
||||
@mixin align-center {
|
||||
position: relative;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
@mixin prompt($type, $fa-content, $fa-style: 'solid', $rotate: 0) {
|
||||
&.prompt-#{$type} {
|
||||
background-color: var(--prompt-#{$type}-bg);
|
||||
|
||||
&::before {
|
||||
content: $fa-content;
|
||||
color: var(--prompt-#{$type}-icon-color);
|
||||
font: var(--fa-font-#{$fa-style});
|
||||
|
||||
@if $rotate != 0 {
|
||||
transform: rotate(#{$rotate}deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
292
_sass/addon/syntax.scss
Normal file
292
_sass/addon/syntax.scss
Normal file
@ -0,0 +1,292 @@
|
||||
/*
|
||||
* The syntax highlight.
|
||||
*/
|
||||
|
||||
@import 'colors/syntax-light';
|
||||
@import 'colors/syntax-dark';
|
||||
|
||||
html {
|
||||
@media (prefers-color-scheme: light) {
|
||||
&:not([data-mode]),
|
||||
&[data-mode='light'] {
|
||||
@include light-syntax;
|
||||
}
|
||||
|
||||
&[data-mode='dark'] {
|
||||
@include dark-syntax;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
&:not([data-mode]),
|
||||
&[data-mode='dark'] {
|
||||
@include dark-syntax;
|
||||
}
|
||||
|
||||
&[data-mode='light'] {
|
||||
@include light-syntax;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -- code snippets -- */
|
||||
|
||||
%code-snippet-bg {
|
||||
background-color: var(--highlight-bg-color);
|
||||
}
|
||||
|
||||
%code-snippet-padding {
|
||||
padding-left: 1rem;
|
||||
padding-right: 1.5rem;
|
||||
}
|
||||
|
||||
.highlighter-rouge {
|
||||
color: var(--highlighter-rouge-color);
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 1.2em; /* Override BS Inline-code style */
|
||||
}
|
||||
|
||||
.highlight {
|
||||
@extend %rounded;
|
||||
@extend %code-snippet-bg;
|
||||
|
||||
overflow: auto;
|
||||
padding-bottom: 0.75rem;
|
||||
|
||||
@at-root figure#{&} {
|
||||
@extend %code-snippet-bg;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin-bottom: 0;
|
||||
font-size: $code-font-size;
|
||||
line-height: 1.4rem;
|
||||
word-wrap: normal; /* Fixed Safari overflow-x */
|
||||
}
|
||||
|
||||
table {
|
||||
td {
|
||||
&:first-child {
|
||||
display: inline-block;
|
||||
margin-left: 1rem;
|
||||
margin-right: 0.75rem;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
padding-right: 2rem !important;
|
||||
}
|
||||
|
||||
pre {
|
||||
overflow: visible; /* Fixed iOS safari overflow-x */
|
||||
word-break: normal; /* Fixed iOS safari linenos code break */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.lineno {
|
||||
text-align: right;
|
||||
color: var(--highlight-lineno-color);
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
} /* .highlight */
|
||||
|
||||
code {
|
||||
-webkit-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
color: var(--code-color);
|
||||
|
||||
&.highlighter-rouge {
|
||||
font-size: $code-font-size;
|
||||
padding: 3px 6px;
|
||||
word-break: break-word;
|
||||
border-radius: 4px;
|
||||
background-color: var(--inline-code-bg);
|
||||
}
|
||||
|
||||
&.filepath {
|
||||
background-color: inherit;
|
||||
color: var(--filepath-text-color);
|
||||
font-weight: 600;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
a > &.highlighter-rouge {
|
||||
padding-bottom: 0; /* show link's underlinke */
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
a:hover > &.highlighter-rouge {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
blockquote & {
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
td.rouge-code {
|
||||
@extend %code-snippet-padding;
|
||||
|
||||
/*
|
||||
Prevent some browser extends from
|
||||
changing the URL string of code block.
|
||||
*/
|
||||
a {
|
||||
color: inherit !important;
|
||||
border-bottom: none !important;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
div[class^='language-'] {
|
||||
@extend %rounded;
|
||||
@extend %code-snippet-bg;
|
||||
|
||||
box-shadow: var(--language-border-color) 0 0 0 1px;
|
||||
|
||||
.content > & {
|
||||
@include ml-mr(-1rem);
|
||||
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide line numbers for default, console, and terminal code snippets */
|
||||
div {
|
||||
&.nolineno,
|
||||
&.language-plaintext,
|
||||
&.language-console,
|
||||
&.language-terminal {
|
||||
td:first-child {
|
||||
padding: 0 !important;
|
||||
margin-right: 0;
|
||||
|
||||
.lineno {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.code-header {
|
||||
@extend %no-cursor;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: $code-header-height;
|
||||
margin-left: 0.75rem;
|
||||
margin-right: 0.25rem;
|
||||
|
||||
/* the label block */
|
||||
span {
|
||||
line-height: $code-header-height;
|
||||
|
||||
/* label icon */
|
||||
i {
|
||||
font-size: 1rem;
|
||||
width: $code-icon-width;
|
||||
color: var(--code-header-icon-color);
|
||||
|
||||
&.small {
|
||||
font-size: 70%;
|
||||
}
|
||||
}
|
||||
|
||||
@at-root [file] #{&} > i {
|
||||
position: relative;
|
||||
top: 1px; /* center the file icon */
|
||||
}
|
||||
|
||||
/* label text */
|
||||
&::after {
|
||||
content: attr(data-label-text);
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
color: var(--code-header-text-color);
|
||||
}
|
||||
}
|
||||
|
||||
/* clipboard */
|
||||
button {
|
||||
@extend %cursor-pointer;
|
||||
@extend %rounded;
|
||||
|
||||
border: 1px solid transparent;
|
||||
height: $code-header-height;
|
||||
width: $code-header-height;
|
||||
padding: 0;
|
||||
background-color: inherit;
|
||||
|
||||
i {
|
||||
color: var(--code-header-icon-color);
|
||||
}
|
||||
|
||||
&[timeout] {
|
||||
&:hover {
|
||||
border-color: var(--clipboard-checked-color);
|
||||
}
|
||||
|
||||
i {
|
||||
color: var(--clipboard-checked-color);
|
||||
}
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
&:not([timeout]):hover {
|
||||
background-color: rgba(128, 128, 128, 0.37);
|
||||
|
||||
i {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 576px) {
|
||||
div[class^='language-'] {
|
||||
.content > & {
|
||||
@include ml-mr(0);
|
||||
|
||||
border-radius: $base-radius;
|
||||
}
|
||||
|
||||
.code-header {
|
||||
@include ml-mr(0);
|
||||
|
||||
$dot-margin: 1rem;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
margin-left: $dot-margin;
|
||||
width: $code-dot-size;
|
||||
height: $code-dot-size;
|
||||
border-radius: 50%;
|
||||
background-color: var(--code-header-muted-color);
|
||||
box-shadow: ($code-dot-size + $code-dot-gap) 0 0
|
||||
var(--code-header-muted-color),
|
||||
($code-dot-size + $code-dot-gap) * 2 0 0
|
||||
var(--code-header-muted-color);
|
||||
}
|
||||
|
||||
span {
|
||||
// center the text of label
|
||||
margin-left: calc(($dot-margin + $code-dot-size) / 2 * -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
33
_sass/addon/variables.scss
Normal file
33
_sass/addon/variables.scss
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* The SCSS variables
|
||||
*/
|
||||
|
||||
/* sidebar */
|
||||
|
||||
$sidebar-width: 260px !default; /* the basic width */
|
||||
$sidebar-width-large: 300px !default; /* screen width: >= 1650px */
|
||||
$sb-btn-gap: 0.8rem !default;
|
||||
$sb-btn-gap-lg: 1rem !default;
|
||||
|
||||
/* other framework sizes */
|
||||
|
||||
$topbar-height: 3rem !default;
|
||||
$search-max-width: 200px !default;
|
||||
$footer-height: 5rem !default;
|
||||
$footer-height-large: 6rem !default; /* screen width: < 850px */
|
||||
$main-content-max-width: 1250px !default;
|
||||
$base-radius: 0.625rem !default;
|
||||
$back2top-size: 2.75rem !default;
|
||||
|
||||
/* syntax highlight */
|
||||
|
||||
$code-font-size: 0.85rem !default;
|
||||
$code-header-height: 2.25rem !default;
|
||||
$code-dot-size: 0.75rem !default;
|
||||
$code-dot-gap: 0.5rem !default;
|
||||
$code-icon-width: 1.75rem !default;
|
||||
|
||||
/* fonts */
|
||||
|
||||
$font-family-base: 'Source Sans Pro', 'Microsoft Yahei', sans-serif !default;
|
||||
$font-family-heading: Lato, 'Microsoft Yahei', sans-serif !default;
|
Reference in New Issue
Block a user