feat: add package.json cheatsheet.

This commit is contained in:
jaywcjlove
2022-09-28 13:35:52 +08:00
parent 5234cdc024
commit 7ab9ddf766
16 changed files with 715 additions and 110 deletions

View File

@ -58,19 +58,19 @@ export function getTocsTree(arr = [], result = []) {
if (toc.number === level && titleNum === level) {
const header = getHeader(data.slice(n), level);
const warpCls = ['warp'];
const headerCls = ['warp-header', `h${level}warp`];
const wrapCls = ['wrap'];
const headerCls = ['wrap-header', `h${level}wrap`];
if (level === 1) warpCls.push('max-container');
const warpStyle = toc.properties['data-warp-style'];
delete toc.properties['data-warp-style']
const warpClass = toc.properties['warp-class'];
if (warpClass) warpCls.push(warpClass);
delete toc.properties['warp-class'];
if (level === 1) wrapCls.push('max-container');
const wrapStyle = toc.properties['data-wrap-style'];
delete toc.properties['data-wrap-style']
const wrapClass = toc.properties['wrap-class'];
if (wrapClass) wrapCls.push(wrapClass);
delete toc.properties['wrap-class'];
const panle = {
type: 'element',
tagName: 'div',
properties: { class: warpCls, style: warpStyle },
properties: { class: wrapCls, style: wrapStyle },
children: [
{
type: 'element',
@ -81,7 +81,7 @@ export function getTocsTree(arr = [], result = []) {
{
type: 'element',
tagName: 'div',
properties: { class: 'warp-body' },
properties: { class: 'wrap-body' },
children: [
...header
],
@ -101,7 +101,7 @@ export function getTocsTree(arr = [], result = []) {
panle.children = panle.children.concat({
type: 'element',
tagName: 'div',
properties: { class: [`h${level}warp-body`, bodyClass], style: bodyStyle },
properties: { class: [`h${level}wrap-body`, bodyClass], style: bodyStyle },
children: [...resultChilds]
});
}

View File

@ -4,7 +4,7 @@ export function footer() {
type: 'element',
tagName: 'footer',
properties: {
class: 'footer-warp',
class: 'footer-wrap',
},
children: [
{

View File

@ -45,18 +45,18 @@ blockquote, dl, dd, h1, h2, h3, h4, h5, h6, hr, figure, p, pre {
padding: 0.75rem;
}
body.home .h1warp-body, body.home .h1warp .warp-body {
body.home .h1wrap-body, body.home .h1wrap .wrap-body {
max-width: 940px;
margin-left: auto;
margin-right: auto;
padding: 0.75rem;
}
body.home .h2warp > h2 {
body.home .h2wrap > h2 {
display: inline-block;
padding-right: 0.5rem;
}
body.home .h2warp > h2::after {
body.home .h2wrap > h2::after {
content: ' ';
display: block;
height: 3px;
@ -65,15 +65,15 @@ body.home .h2warp > h2::after {
--bg-opacity: 1;
background-color: rgb(30 41 59/var(--bg-opacity));
}
body.home .h1warp .warp-body p + p {
body.home .h1wrap .wrap-body p + p {
margin-top: 1.6rem;
}
body.home .h1warp .warp-body p {
body.home .h1wrap .wrap-body p {
text-indent: 2rem;
}
body.home .h1warp p {
body.home .h1wrap p {
text-align: left;
}
@ -150,29 +150,29 @@ body.home .h1warp p {
gap: 0.3rem;
}
.warp-header.h1warp {
.wrap-header.h1wrap {
text-align: center;
margin-top: 4.6rem;
margin-bottom: 5rem;
}
.warp-header.h1warp .warp-body {
.wrap-header.h1wrap .wrap-body {
color: rgb(71 85 105/1);
}
.warp-header.h1warp > h1 {
.wrap-header.h1wrap > h1 {
font-size: 3rem;
line-height: 1;
margin-bottom: 3rem;
}
.h1warp-body {
.h1wrap-body {
display: flex;
flex-direction: column;
gap: 3rem;
}
.warp-header.h2warp > h2 {
.wrap-header.h2wrap > h2 {
margin: 0;
padding: 0;
margin-bottom: 24px;
@ -184,7 +184,14 @@ body.home .h1warp p {
margin-top: 0;
}
.warp-header.h3warp {
.wrap-header.h2wrap > :last-child {
margin-bottom: 24px;
}
.wrap-header.h2wrap .wrap-body {
color: rgb(148 163 184/1);
}
.wrap-header.h3wrap {
z-index: 0;
display: flex;
height: 100%;
@ -192,7 +199,7 @@ body.home .h1warp p {
flex-direction: column;
}
.warp-header.h3warp > h3 {
.wrap-header.h3wrap > h3 {
color: rgb(226 232 240/1);
position: absolute;
right: 0px;
@ -209,7 +216,7 @@ body.home .h1warp p {
letter-spacing: 0.05em;
}
.warp-header.h3warp > .warp-body p, .warp-header.h4warp > .warp-body p {
.wrap-header.h3wrap > .wrap-body p, .wrap-header.h4wrap > .wrap-body p {
margin: 0px;
width: 100%;
padding-left: 1rem;
@ -220,7 +227,7 @@ body.home .h1warp p {
background-color: rgb(15 23 42/0.3);
}
.warp-header.h3warp > .warp-body p:first-child:before {
.wrap-header.h3wrap > .wrap-body p:first-child:before {
background-color: rgb(15 23 42/0.3);
color: rgb(30 41 59/0);
content: '-';
@ -231,11 +238,11 @@ body.home .h1warp p {
width: 100%;
}
.warp-header.h3warp > .warp-body p:last-child {
.wrap-header.h3wrap > .wrap-body p:last-child {
margin-top: auto;
}
.warp-header.h3warp > .warp-body {
.wrap-header.h3wrap > .wrap-body {
z-index: 0;
display: flex;
height: 100%;
@ -243,7 +250,7 @@ body.home .h1warp p {
flex-direction: column;
}
.h4warp > h4 {
.h4wrap > h4 {
border-color: rgb(51 65 85/0.5);
background-color: rgb(51 65 85/0.3);
color: rgb(203 213 225/1);
@ -263,13 +270,13 @@ ol, ul, menu {
padding: 0;
}
.h4warp > .warp-body ul,
.h4warp > .warp-body ol,
.h4warp > .warp-body dl,
.h4wrap > .wrap-body ul,
.h4wrap > .wrap-body ol,
.h4wrap > .wrap-body dl,
.h3warp > .warp-body ul,
.h3warp > .warp-body ol,
.h3warp > .warp-body dl {
.h3wrap > .wrap-body ul,
.h3wrap > .wrap-body ol,
.h3wrap > .wrap-body dl {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
display: grid;
@ -277,16 +284,16 @@ ol, ul, menu {
grid-template-columns: repeat(1,minmax(0,1fr));
}
.h2warp-body ul li,
.h2warp-body ol li,
.h2warp-body dl li {
.h2wrap-body ul li,
.h2wrap-body ol li,
.h2wrap-body dl li {
padding: 9px;
padding-left: 26px;
position: relative;
border-bottom: solid 1px rgb(51 65 85/0.5);
}
.h2warp-body ul:not(.style-none)>li::before {
.h2wrap-body ul:not(.style-none)>li::before {
content: '';
position: absolute;
display: inline-block;
@ -298,25 +305,25 @@ ol, ul, menu {
top: 18px;
}
.h2warp-body ul li,
.h2warp-body ol li,
.h2warp-body dl li {
.h2wrap-body ul li,
.h2wrap-body ol li,
.h2wrap-body dl li {
position: relative;
}
.warp-body ul:last-child {
.wrap-body ul:last-child {
margin-bottom: 0;
}
.warp-body ul:last-child li:last-child {
.wrap-body ul:last-child li:last-child {
border-bottom: 0;
}
.h3warp hr {
.h3wrap hr {
border-bottom: 1px solid #475060;
}
.h2warp-body {
.h2wrap-body {
display: grid;
gap: 1.75rem;
font-size: 0.925rem;
@ -325,7 +332,7 @@ ol, ul, menu {
flex-direction: column;
}
.h2warp-body > .warp {
.h2wrap-body > .wrap {
background-color: #1e293b;
color: rgb(203 213 225/1);
position: relative;
@ -437,7 +444,7 @@ pre {
.row-span-4 {
grid-row: span 4/span 4;
}
.wrap {
.wrap-text {
white-space: pre-wrap !important;
overflow-wrap: break-word !important;
}
@ -604,7 +611,7 @@ pre {
/* 代码高亮 End */
.footer-warp {
.footer-wrap {
margin-top: 3.5rem;
color: rgb(100 116 139/1);
background-color: rgb(30 41 59/1);