1
0
mirror of https://github.com/kuohuanhuan/x-markdown-css.git synced 2024-11-25 06:18:19 +00:00

Compare commits

..

46 Commits

Author SHA1 Message Date
1b2245bab9 chore: release v0.0.1-patch.2 2023-03-03 22:47:54 +08:00
7b50254f83 docs(readme): fix typo in "Usage" block 2023-03-03 22:47:39 +08:00
5f9424617e chore: release v0.0.1-patch.1 2023-03-03 22:46:22 +08:00
f169a6c49a docs(readme): add usage in Sass / SCSS 2023-03-03 22:46:03 +08:00
ba62d6e364 chore: release v0.0.1-patch.0 2023-03-03 21:09:54 +08:00
d7c5188b7d docs(readme): add "Browsers Support" block 2023-03-03 21:09:33 +08:00
de8b9d621c chore(ci): include all files in dist instead of the dir to build.tar.gz 2023-03-03 20:58:09 +08:00
8bb74891ce chore(ci): add LTS to Ubuntu 22.04 comment 2023-03-03 20:54:14 +08:00
d33f046030 chore: release v0.0.1 2023-03-03 20:15:39 +08:00
bd8d8822e5 revert: 706720b8fe 2023-03-03 20:15:12 +08:00
d9678940f2 chore: release v0.0.0-20230303.9 2023-03-03 20:09:40 +08:00
706720b8fe chore(ci): use windows-2022 instead of ubuntu-22.04 to release 2023-03-03 20:07:17 +08:00
ff06dee900 chore: release v0.0.0-20230303.7 2023-03-03 20:02:21 +08:00
80ccac3dd1 chore(ci): add pre-release and release comment to task name 2023-03-03 20:02:07 +08:00
229680ca85 chore: release v0.0.0-20230303.6 2023-03-03 20:00:25 +08:00
e3fcf96559 chore(ci): upload tar.gz file instead of .zip that no longer exists 2023-03-03 20:00:07 +08:00
c77fbd21ae chore: release v0.0.0-20230303.5 2023-03-03 19:53:55 +08:00
a4f5996f04 chore(ci): solve incorrect version of cardinalby/git-tag-action 2023-03-03 19:53:41 +08:00
cb009147b9 chore: release v0.0.0-20230303.4 2023-03-03 19:52:51 +08:00
188ac468fd chore(ci): add pre-release specific & add latest tag 2023-03-03 19:52:31 +08:00
24056e42d5 chore: release v0.0.0-20230303.3 2023-03-03 19:32:35 +08:00
274fc0fb31 chore(ci): generate Changelog **after** release 2023-03-03 19:32:19 +08:00
e83212e00f chore: release v0.0.0-20230303.2 2023-03-03 19:29:41 +08:00
40a50968ed chore(ci): solve version conflicts & errors 2023-03-03 19:29:27 +08:00
1a62e1258e chore: release v0.0.0-20230303.1 2023-03-03 19:26:55 +08:00
648738b890 refactor(markdown): split margin to margin-top and margin-bottom 2023-03-03 19:13:28 +08:00
7dc2238fdf feat(markdown): apply different opacities for .header-anchor 2023-03-03 19:10:15 +08:00
65b4b24002 chore(ci): create a tar.gz file instead of a .zip one 2023-03-03 19:04:32 +08:00
94e8477077 chore: create and modify footer author comment 2023-03-03 18:45:16 +08:00
4bbc199636 chore(build): disable postcss-custom-properties option in PostCSS 2023-03-03 18:42:00 +08:00
fd57e4bc4f chore(npm): replace main key in package.json with sass and style 2023-03-03 18:34:08 +08:00
ab38a24a75 chore: release v0.0.0-20230302.12 2023-03-02 23:15:01 +08:00
93e2f86137 chore(npm): add build.zip to .npmignore 2023-03-02 23:14:27 +08:00
e622185bbf chore: release v0.0.0-20230302.11 2023-03-02 23:07:32 +08:00
78cf02d7b8 chore(ci): add a name for vimtor/action-zip task 2023-03-02 23:07:02 +08:00
eba9d56ae6 chore: release v0.0.0-20230302.10 2023-03-02 22:52:18 +08:00
2da4f4deb2 chore(ci): add .zip file to GitHub Release and upload artifact 2023-03-02 22:52:00 +08:00
cd9ecdfed3 chore: release v0.0.0-20230302.9 2023-03-02 22:33:59 +08:00
9bf22aa5bd chore(ci): update Node.js version in CI to 18 from 16 2023-03-02 22:33:39 +08:00
e6718acc37 chore: release v0.0.0-20230302.8 2023-03-02 22:28:25 +08:00
15ef37c0d2 chore(ci): use softprops/action-gh-release to create GitHub Releases 2023-03-02 22:27:49 +08:00
6fd50e0707 chore: release v0.0.0-20230302.7 2023-03-02 21:18:38 +08:00
8da53d8cde style(markdown): improve selectors 2023-03-02 21:18:14 +08:00
decfa2c47c chore: release v0.0.0-20230302.6 2023-03-02 20:39:44 +08:00
58317f99cb chore(ci): change registry URL to npmjs.com from npmjs.org 2023-03-02 20:39:24 +08:00
a3f9084a2e chore(ci): rename task Lint to Test Lint 2023-03-02 20:35:07 +08:00
8 changed files with 99 additions and 34 deletions

View File

@ -11,7 +11,7 @@ on:
jobs: jobs:
# Test Lint # Test Lint
lint: lint:
# Use Ubuntu 22.04 # Use Ubuntu 22.04 LTS
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
# Step I # Step I
@ -21,13 +21,13 @@ jobs:
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 18
registry-url: https://registry.npmjs.org/ registry-url: https://registry.npmjs.com
# Step III # Step III
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: npm ci
# Step IV # Step IV
- name: Lint - name: Test Lint
run: npm run lint run: npm run lint
# Test Build # Test Build
build: build:
@ -47,10 +47,19 @@ jobs:
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ registry-url: https://registry.npmjs.com
# Step III # Step III
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: npm ci
# Step IV # Step IV
- name: Test Build - name: Test Build
run: npm run build run: npm run build
# Step V
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: built-on__os_${{ matrix.os }}__nodejs_${{ matrix.node-version }}
path: dist/
retention-days: 3
# Authored by @kuohuanhuan.

View File

@ -6,9 +6,9 @@ on:
- 'v*' - 'v*'
jobs: jobs:
# NPM Registry Release # NPM Registry & GitHub Release
release: release:
# Use Ubuntu 22.04 # Use Ubuntu 22.04 LTS
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
# Step I # Step I
@ -20,8 +20,8 @@ jobs:
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 18
registry-url: https://registry.npmjs.org/ registry-url: https://registry.npmjs.com
# Step III # Step III
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: npm ci
@ -29,12 +29,40 @@ jobs:
- name: Build Project - name: Build Project
run: npm run build run: npm run build
# Step V # Step V
- name: Create tar.gz File
uses: TheDoctor0/zip-release@0.7.1
with:
type: tar
path: dist/*
filename: build.tar.gz
# Step VI
- name: Publish to NPM Registry - name: Publish to NPM Registry
uses: rxfork/npm-publish@v1 uses: rxfork/npm-publish@v1
with: with:
token: ${{ secrets.NPM_TOKEN }} token: ${{ secrets.NPM_TOKEN }}
# Step VI # Step VII
- name: Generate Changelog - name: Generate Changelog
run: npx changelogithub@0.12 run: npx changelogithub@0.12
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Step VIII
# / pre-release
- name: GitHub Release (pre-release)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-')
uses: softprops/action-gh-release@v1
with:
prerelease: true
files: |
dist/*
build.tar.gz
# / release
- name: GitHub Release (release)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-') == false
uses: softprops/action-gh-release@v1
with:
prerelease: false
files: |
dist/*
build.tar.gz
# Authored by @kuohuanhuan.

View File

@ -1,3 +1,4 @@
build.tar.gz
node_modules/ node_modules/
.github/ .github/
.vscode/ .vscode/

View File

@ -29,7 +29,10 @@ module.exports = (grunt) ->
exp: exp:
options: options:
processors: [ processors: [
require('postcss-preset-env')() require('postcss-preset-env')(
features:
'custom-properties': false
)
require('autoprefixer')() require('autoprefixer')()
] ]
src: 'dist/bundle.css' src: 'dist/bundle.css'
@ -37,7 +40,10 @@ module.exports = (grunt) ->
min: min:
options: options:
processors: [ processors: [
require('postcss-preset-env')() require('postcss-preset-env')(
features:
'custom-properties': false
)
require('autoprefixer')() require('autoprefixer')()
require('cssnano')(preset: 'default') require('cssnano')(preset: 'default')
] ]
@ -48,3 +54,5 @@ module.exports = (grunt) ->
'sass' 'sass'
'postcss' 'postcss'
] ]
# Authored by @kuohuanhuan.

View File

@ -14,6 +14,10 @@
- Node.js >= 16 - Node.js >= 16
## Browsers Support
According to [.browserslistrc](https://github.com/kuohuanhuan/x-markdown-css/blob/master/.browserslistrc), `x-markdown-css` supports **all browsers support CSS variables.**
## Install ## Install
```sh ```sh
@ -40,7 +44,9 @@ npx grunt build
## Usage ## Usage
You can use the minified CSS file with a CDN service: You can use `x-markdown-css` with:
1. A CDN service:
- UNPKG: `https://unpkg.com/x-markdown-css@latest/dist/bundle.min.css` - UNPKG: `https://unpkg.com/x-markdown-css@latest/dist/bundle.min.css`
- jsDelivr: `https://fastly.jsdelivr.net/npm/x-markdown-css@latest/dist/bundle.min.css` - jsDelivr: `https://fastly.jsdelivr.net/npm/x-markdown-css@latest/dist/bundle.min.css`
@ -48,6 +54,22 @@ You can use the minified CSS file with a CDN service:
> *ps. `bundle.css` without `.min` stands for unminified version.* > *ps. `bundle.css` without `.min` stands for unminified version.*
2. A Sass / SCSS project
First, install it with NPM ([PNPM](https://pnpm.io) or [Yarn](https://yarnpkg.com) also works):
```sh
npm i x-markdown-css@latest
```
Then, add it to your Sass / SCSS file (SCSS for example):
```scss
@import 'x-markdown-css';
```
> *ps. No path or file extention is required, just simply use `x-markdown-css` to import it.*
## Uses ## Uses
- [SCSS](https://sass-lang.com) - [SCSS](https://sass-lang.com)

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "x-markdown-css", "name": "x-markdown-css",
"version": "0.0.0-20230302.5", "version": "0.0.1-patch.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {

View File

@ -1,6 +1,6 @@
{ {
"name": "x-markdown-css", "name": "x-markdown-css",
"version": "0.0.0-20230302.5", "version": "0.0.1-patch.2",
"description": "A simple and customizable markdown CSS stylesheet for everyone.", "description": "A simple and customizable markdown CSS stylesheet for everyone.",
"keywords": [ "keywords": [
"markdown", "markdown",
@ -16,7 +16,8 @@
"article", "article",
"documentation" "documentation"
], ],
"main": "index.js", "sass": "src/index.scss",
"style": "dist/bundle.min.css",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/kuohuanhuan/x-markdown-css.git" "url": "git+https://github.com/kuohuanhuan/x-markdown-css.git"

View File

@ -1,12 +1,10 @@
.markdown-body { .markdown-body {
color: var(--xm-c-general); color: var(--xm-c-general);
font-family: var(--xm-font-display) !important; font-family: var(--xm-font-display) !important;
pre { pre:not(.shiki, .highlight) {
&:not(.shiki, .highlight) { margin: 0;
margin: 0; padding: 0;
padding: 0; background: transparent;
background: transparent;
}
} }
.shiki, .shiki,
.highlight { .highlight {
@ -38,7 +36,8 @@
} }
hr { hr {
width: 50px; width: 50px;
margin: 2rem auto; margin-top: 2rem;
margin-bottom: 2rem;
} }
blockquote, blockquote,
q { q {
@ -81,7 +80,7 @@ html:not(.dark) .shiki-dark,
.header-anchor { .header-anchor {
float: left; float: left;
margin-top: .125rem; margin-top: .125rem;
margin-left: -1.2rem; margin-left: -1.25rem;
padding-right: .5rem; padding-right: .5rem;
border: 0 !important; border: 0 !important;
font-size: .875rem; font-size: .875rem;
@ -92,16 +91,13 @@ html:not(.dark) .shiki-dark,
text-decoration: none; text-decoration: none;
} }
} }
h1, @for $i from 1 through 6 {
h2, h#{$i} {
h3, &:hover,
h4, &:focus {
h5, .header-anchor {
h6 { opacity: .35 + $i * .025;
&:hover, }
&:focus {
.header-anchor {
opacity: .5;
} }
} }
} }