Skip to content

Commit

Permalink
build(docs): use postcss
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Apr 2, 2024
1 parent 3589da3 commit c2103cf
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 51 deletions.
85 changes: 46 additions & 39 deletions docs/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,6 @@
--border-color: var(--gray2);
}

@keyframes octocat {
0%,
to {
transform: rotate(0);
}

20%,
60% {
transform: rotate(-25deg);
}

40%,
80% {
transform: rotate(10deg);
}
}

::selection {
background: #f9e4ac;
/* WebKit/Blink Browsers */
Expand Down Expand Up @@ -86,25 +69,7 @@ img[src*='#gh-dark-mode-only'] {
display: none;
}

.github-corner {
border-bottom: 0;
position: fixed;
right: 0;
text-decoration: none;
top: 0;
z-index: 1;
}

.github-corner svg {
color: #fff;
fill: var(--primary-color);
height: 80px;
width: 80px;
}

.github-corner:hover .octo-arm {
animation: octocat 0.5s ease-in-out;
}

main {
display: block;
Expand Down Expand Up @@ -157,7 +122,7 @@ main {
text-decoration: underline;
}

.sidebar ul li.active > a {
.sidebar ul li.active>a {
border-right: 2px solid var(--primary-color);
color: var(--primary-color);
font-weight: 700;
Expand Down Expand Up @@ -202,12 +167,12 @@ body.sticky .sidebar-toggle {
position: relative;
}

.markdown-section > * {
.markdown-section>* {
box-sizing: border-box;
font-size: inherit;
}

.markdown-section > :first-child {
.markdown-section> :first-child {
margin-top: 0 !important;
}

Expand All @@ -231,6 +196,7 @@ body.sticky .sidebar-toggle {
}

@media print {

.github-corner,
.sidebar,
.sidebar-toggle {
Expand All @@ -239,6 +205,7 @@ body.sticky .sidebar-toggle {
}

@media screen and (max-width: 768px) {

.github-corner,
.sidebar {
position: fixed;
Expand Down Expand Up @@ -391,7 +358,7 @@ body {
-webkit-font-smoothing: initial;
}

.markdown-section pre > code {
.markdown-section pre>code {
border: 0;
display: block;
font-family: var(--code-font);
Expand Down Expand Up @@ -429,3 +396,43 @@ body {
.token.comment {
color: var(--gray7);
}

/* github corner */

@keyframes b {
0%,
100% {
transform: rotate(0);
}

20%,
60% {
transform: rotate(-25deg);
}

40%,
80% {
transform: rotate(10deg);
}
}

.github-corner svg {
border-bottom: 0;
position: fixed;
right: 0;
text-decoration: none;
top: 0;
z-index: 1;
}

.github-corner:hover svg .octo-arm {
opacity: 1;
animation: b 560ms ease-in-out;
}

.github-corner svg {
color: white;
fill: black;
height: 80px;
width: 80px;
}
17 changes: 10 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
'use strict'

const strip = require('gulp-strip-css-comments')
const prefix = require('gulp-autoprefixer')
const cssnano = require('gulp-cssnano')
const uglify = require('gulp-uglify')
const postcss = require('gulp-postcss')
const concat = require('gulp-concat')
const uglify = require('gulp-uglify')
const gulp = require('gulp')

const src = {
Expand All @@ -24,9 +22,14 @@ const styles = () =>
gulp
.src(src.css)
.pipe(concat(`${dist.name.css}.min.css`))
.pipe(prefix())
.pipe(strip({ all: true }))
.pipe(cssnano())
.pipe(
postcss([
require('postcss-focus'),
require('cssnano')({
preset: [require('cssnano-preset-advanced')]
})
])
)
.pipe(gulp.dest(dist.path))

const scripts = () =>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
/>

<!-- Stylesheet -->
<link rel="stylesheet" href="/static/style.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codecopy/umd/codecopy.min.css" />
<link rel="stylesheet" href="/static/style.min.css" />
</head>

<body>
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,18 @@
"browser-sync": "latest",
"c8": "latest",
"concurrently": "latest",
"cssnano": "latest",
"cssnano-preset-advanced": "latest",
"finepack": "latest",
"git-authors-cli": "latest",
"gulp": "4",
"gulp-autoprefixer": "8",
"gulp-concat": "latest",
"gulp-cssnano": "latest",
"gulp-strip-css-comments": "2",
"gulp-postcss": "latest",
"gulp-uglify": "latest",
"nano-staged": "latest",
"npm-check-updates": "latest",
"postcss": "latest",
"postcss-focus": "latest",
"simple-git-hooks": "latest",
"standard": "latest"
},
Expand Down
2 changes: 1 addition & 1 deletion static/style.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c2103cf

Please sign in to comment.