Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use transpiler dartsass #264

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 41 additions & 41 deletions assets/theme/scss/bulma.scss
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
@charset "utf-8";

@import "../../mod/bulma/utilities/_all.sass";
@import "../../mod/bulma/base/_all.sass";
@use "../../mod/bulma/utilities/_all.sass";
@use "../../mod/bulma/base/_all.sass";

$tablet: 760px;
$dimensions: 16 24 32 48 64 96 128 180 256;

// ====================
// components
// ====================
// @import "../../mod/bulma/components/_all.sass";
// @use "../../mod/bulma/components/_all.sass";

$breadcrumb-item-hover-color: gold;
$breadcrumb-item-active-color: $grey-lighter;
@import "../../mod/bulma/components/breadcrumb.sass";
@use "../../mod/bulma/components/breadcrumb.sass";

$card-color: $grey-lighter;
$card-header-color: skyblue;
$card-background-color: $grey-dark;
$card-footer-border-top: 1px solid $grey-darker;
@import "../../mod/bulma/components/card.sass";
@use "../../mod/bulma/components/card.sass";

$dropdown-content-background-color: $grey-dark;
$dropdown-item-color: $grey-lighter;
@import "../../mod/bulma/components/dropdown.sass";
// @import "../../mod/bulma/components/level.sass";
// @import "../../mod/bulma/components/list.sass";
// @import "../../mod/bulma/components/media.sass";
// @import "../../mod/bulma/components/menu.sass";
// @import "../../mod/bulma/components/message.sass";
// @import "../../mod/bulma/components/modal.sass";
// @import "../../mod/bulma/components/navbar.sass";
// @import "../../mod/bulma/components/pagination.sass";
// @import "../../mod/bulma/components/panel.sass";
// @import "../../mod/bulma/components/tabs.sass";
@use "../../mod/bulma/components/dropdown.sass";
// @use "../../mod/bulma/components/level.sass";
// @use "../../mod/bulma/components/list.sass";
// @use "../../mod/bulma/components/media.sass";
// @use "../../mod/bulma/components/menu.sass";
// @use "../../mod/bulma/components/message.sass";
// @use "../../mod/bulma/components/modal.sass";
// @use "../../mod/bulma/components/navbar.sass";
// @use "../../mod/bulma/components/pagination.sass";
// @use "../../mod/bulma/components/panel.sass";
// @use "../../mod/bulma/components/tabs.sass";

// ====================
// elements
// ====================
// @import "../../mod/bulma/elements/_all.sass";
// @import "../../mod/bulma/elements/box.sass";
// @use "../../mod/bulma/elements/_all.sass";
// @use "../../mod/bulma/elements/box.sass";

$button-color: $grey-lighter;
$button-background-color: $grey-dark;
$button-hover-color: skyblue;
@import "../../mod/bulma/elements/button.sass";
@import "../../mod/bulma/elements/container.sass";
@import "../../mod/bulma/elements/content.sass";
// @import "../../mod/bulma/elements/form.sass";
// @import "../../mod/bulma/elements/icon.sass";
@import "../../mod/bulma/elements/image.sass";
// @import "../../mod/bulma/elements/notification.sass";
@import "../../mod/bulma/elements/other.sass";
// @import "../../mod/bulma/elements/progress.sass";
@use "../../mod/bulma/elements/button.sass";
@use "../../mod/bulma/elements/container.sass";
@use "../../mod/bulma/elements/content.sass";
// @use "../../mod/bulma/elements/form.sass";
// @use "../../mod/bulma/elements/icon.sass";
@use "../../mod/bulma/elements/image.sass";
// @use "../../mod/bulma/elements/notification.sass";
@use "../../mod/bulma/elements/other.sass";
// @use "../../mod/bulma/elements/progress.sass";

$table-color: $grey-lighter;
$table-head-cell-color: gold;
Expand All @@ -61,33 +61,33 @@ $table-background-color: $grey-dark;
$table-striped-row-even-background-color: $grey-dark;
$table-row-hover-background-color: sienna;
$table-striped-row-even-hover-background-color: sienna;
@import "../../mod/bulma/elements/table.sass";
@use "../../mod/bulma/elements/table.sass";

@import "../../mod/bulma/elements/tag.sass";
@import "../../mod/bulma/elements/title.sass";
@use "../../mod/bulma/elements/tag.sass";
@use "../../mod/bulma/elements/title.sass";

// ====================
// form
// ====================
// @import "../../mod/bulma/form/_all.sass";
// @import "../../mod/bulma/form/checkbox-radio.sass";
// @import "../../mod/bulma/form/file.sass";
// @import "../../mod/bulma/form/input-textarea.sass";
// @import "../../mod/bulma/form/select.sass";
// @import "../../mod/bulma/form/shared.sass";
// @import "../../mod/bulma/form/tools.sass";
// @use "../../mod/bulma/form/_all.sass";
// @use "../../mod/bulma/form/checkbox-radio.sass";
// @use "../../mod/bulma/form/file.sass";
// @use "../../mod/bulma/form/input-textarea.sass";
// @use "../../mod/bulma/form/select.sass";
// @use "../../mod/bulma/form/shared.sass";
// @use "../../mod/bulma/form/tools.sass";

// ====================
// grid
// ====================
// @import "../../mod/bulma/grid/_all.sass";
@import "../../mod/bulma/grid/columns.sass";
// @import "../../mod/bulma/grid/tiles.sass";
// @use "../../mod/bulma/grid/_all.sass";
@use "../../mod/bulma/grid/columns.sass";
// @use "../../mod/bulma/grid/tiles.sass";

// ====================
// layout
// ====================
@import "../../mod/bulma/layout/_all.sass";
@use "../../mod/bulma/layout/_all.sass";

// ====================
// Iris theme
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
hugo:
container_name: hugo_theme_iris
# image: "ghcr.io/peaceiris/hugo:v${HUGO_VERSION}"
image: ghcr.io/peaceiris/hugo:v${HUGO_VERSION}-full # Hugo Modules and Node.js
image: ghcr.io/peaceiris/hugo:dartsass # Hugo Modules and Node.js
# image: ghcr.io/peaceiris/hugo:v0.75.1-full # workaround for Codespaces
ports:
- 1313:1313
Expand Down
1 change: 0 additions & 1 deletion exampleSite/resources

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"mod/revealjs/dist/reveal.css","MediaType":"text/css","Data":{}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import url(./fonts/source-sans-pro/source-sans-pro.css);section.has-dark-background,section.has-dark-background h1,section.has-dark-background h2,section.has-dark-background h3,section.has-dark-background h4,section.has-dark-background h5,section.has-dark-background h6{color:#fff}:root{--background-color: #fff;--main-font: Source Sans Pro, Helvetica, sans-serif;--main-font-size: 42px;--main-color: #222;--block-margin: 20px;--heading-margin: 0 0 20px 0;--heading-font: Source Sans Pro, Helvetica, sans-serif;--heading-color: #222;--heading-line-height: 1.2;--heading-letter-spacing: normal;--heading-text-transform: uppercase;--heading-text-shadow: none;--heading-font-weight: 600;--heading1-text-shadow: none;--heading1-size: 2.5em;--heading2-size: 1.6em;--heading3-size: 1.3em;--heading4-size: 1em;--code-font: monospace;--link-color: #2a76dd;--link-color-hover: #6ca0e8;--selection-background-color: #98bdef;--selection-color: #fff}.reveal-viewport{background:#fff;background-color:#fff}.reveal{font-family:"Source Sans Pro", Helvetica, sans-serif;font-size:42px;font-weight:normal;color:#222}.reveal ::selection{color:#fff;background:#98bdef;text-shadow:none}.reveal ::-moz-selection{color:#fff;background:#98bdef;text-shadow:none}.reveal .slides section,.reveal .slides section>section{line-height:1.3;font-weight:inherit}.reveal h1,.reveal h2,.reveal h3,.reveal h4,.reveal h5,.reveal h6{margin:0 0 20px 0;color:#222;font-family:"Source Sans Pro", Helvetica, sans-serif;font-weight:600;line-height:1.2;letter-spacing:normal;text-transform:uppercase;text-shadow:none;word-wrap:break-word}.reveal h1{font-size:2.5em}.reveal h2{font-size:1.6em}.reveal h3{font-size:1.3em}.reveal h4{font-size:1em}.reveal h1{text-shadow:none}.reveal p{margin:20px 0;line-height:1.3}.reveal h1:last-child,.reveal h2:last-child,.reveal h3:last-child,.reveal h4:last-child,.reveal h5:last-child,.reveal h6:last-child{margin-bottom:0}.reveal img,.reveal video,.reveal iframe{max-width:95%;max-height:95%}.reveal strong,.reveal b{font-weight:bold}.reveal em{font-style:italic}.reveal ol,.reveal dl,.reveal ul{display:inline-block;text-align:left;margin:0 0 0 1em}.reveal ol{list-style-type:decimal}.reveal ul{list-style-type:disc}.reveal ul ul{list-style-type:square}.reveal ul ul ul{list-style-type:circle}.reveal ul ul,.reveal ul ol,.reveal ol ol,.reveal ol ul{display:block;margin-left:40px}.reveal dt{font-weight:bold}.reveal dd{margin-left:40px}.reveal blockquote{display:block;position:relative;width:70%;margin:20px auto;padding:5px;font-style:italic;background:rgba(255,255,255,0.05);box-shadow:0px 0px 2px rgba(0,0,0,0.2)}.reveal blockquote p:first-child,.reveal blockquote p:last-child{display:inline-block}.reveal q{font-style:italic}.reveal pre{display:block;position:relative;width:90%;margin:20px auto;text-align:left;font-size:0.55em;font-family:monospace;line-height:1.2em;word-wrap:break-word;box-shadow:0px 5px 15px rgba(0,0,0,0.15)}.reveal code{font-family:monospace;text-transform:none}.reveal pre code{display:block;padding:5px;overflow:auto;max-height:400px;word-wrap:normal}.reveal table{margin:auto;border-collapse:collapse;border-spacing:0}.reveal table th{font-weight:bold}.reveal table th,.reveal table td{text-align:left;padding:0.2em 0.5em 0.2em 0.5em;border-bottom:1px solid}.reveal table th[align="center"],.reveal table td[align="center"]{text-align:center}.reveal table th[align="right"],.reveal table td[align="right"]{text-align:right}.reveal table tbody tr:last-child th,.reveal table tbody tr:last-child td{border-bottom:none}.reveal sup{vertical-align:super;font-size:smaller}.reveal sub{vertical-align:sub;font-size:smaller}.reveal small{display:inline-block;font-size:0.6em;line-height:1.2em;vertical-align:top}.reveal small *{vertical-align:top}.reveal img{margin:20px 0}.reveal a{color:#2a76dd;text-decoration:none;transition:color .15s ease}.reveal a:hover{color:#6ca0e8;text-shadow:none;border:none}.reveal .roll span:after{color:#fff;background:#1a53a1}.reveal .r-frame{border:4px solid #222;box-shadow:0 0 10px rgba(0,0,0,0.15)}.reveal a .r-frame{transition:all .15s linear}.reveal a:hover .r-frame{border-color:#2a76dd;box-shadow:0 0 20px rgba(0,0,0,0.55)}.reveal .controls{color:#2a76dd}.reveal .progress{background:rgba(0,0,0,0.2);color:#2a76dd}@media print{.backgrounds{background-color:#fff}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"mod/revealjs/dist/theme/white.css","MediaType":"text/css","Data":{}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.chroma{color:#f8f8f2;background-color:#272822}.chroma .err{color:#960050;background-color:#1e0010}.chroma .lntd{vertical-align:top;padding:0;margin:0;border:0}.chroma .lntable{border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block}.chroma .hl{display:block;width:100%;background-color:#ffffcc}.chroma .lnt{margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f}.chroma .ln{margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f}.chroma .k{color:#66d9ef}.chroma .kc{color:#66d9ef}.chroma .kd{color:#66d9ef}.chroma .kn{color:#f92672}.chroma .kp{color:#66d9ef}.chroma .kr{color:#66d9ef}.chroma .kt{color:#66d9ef}.chroma .na{color:#a6e22e}.chroma .nc{color:#a6e22e}.chroma .no{color:#66d9ef}.chroma .nd{color:#a6e22e}.chroma .ne{color:#a6e22e}.chroma .nf{color:#a6e22e}.chroma .nx{color:#a6e22e}.chroma .nt{color:#f92672}.chroma .l{color:#ae81ff}.chroma .ld{color:#e6db74}.chroma .s{color:#e6db74}.chroma .sa{color:#e6db74}.chroma .sb{color:#e6db74}.chroma .sc{color:#e6db74}.chroma .dl{color:#e6db74}.chroma .sd{color:#e6db74}.chroma .s2{color:#e6db74}.chroma .se{color:#ae81ff}.chroma .sh{color:#e6db74}.chroma .si{color:#e6db74}.chroma .sx{color:#e6db74}.chroma .sr{color:#e6db74}.chroma .s1{color:#e6db74}.chroma .ss{color:#e6db74}.chroma .m{color:#ae81ff}.chroma .mb{color:#ae81ff}.chroma .mf{color:#ae81ff}.chroma .mh{color:#ae81ff}.chroma .mi{color:#ae81ff}.chroma .il{color:#ae81ff}.chroma .mo{color:#ae81ff}.chroma .o{color:#f92672}.chroma .ow{color:#f92672}.chroma .c{color:#75715e}.chroma .ch{color:#75715e}.chroma .cm{color:#75715e}.chroma .c1{color:#75715e}.chroma .cs{color:#75715e}.chroma .cp{color:#75715e}.chroma .cpf{color:#75715e}.chroma .gd{color:#f92672}.chroma .ge{font-style:italic}.chroma .gi{color:#a6e22e}.chroma .gs{font-weight:bold}.chroma .gu{color:#75715e}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"theme/css/syntax.css","MediaType":"text/css","Data":{}}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"theme/scss/bulma.css","MediaType":"text/css","Data":{}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"theme/scss/style.css","MediaType":"text/css","Data":{}}
12 changes: 7 additions & 5 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
{{ partial "head/general" . }}
{{ partial "head/json-ld" . }}

{{ $sassOptions := (dict "transpiler" "dartsass" "outputStyle" "compressed") }}

{{ if $.Params.slide }}
<style>
{{ $cssMain := resources.Get "mod/revealjs/dist/reveal.css" | toCSS | minify }}
{{ $cssMain := resources.Get "mod/revealjs/dist/reveal.css" | resources.ToCSS $sassOptions }}
{{ $cssMain.Content | safeCSS }}
{{ $cssTheme := resources.Get "mod/revealjs/dist/theme/white.css" | toCSS | minify }}
{{ $cssTheme := resources.Get "mod/revealjs/dist/theme/white.css" | resources.ToCSS $sassOptions }}
{{ $cssTheme.Content | safeCSS }}
</style>
{{ else }}
<style>
{{ $bulmaCSS := resources.Get "theme/scss/bulma.scss" | toCSS | minify }}
{{ $bulmaCSS := resources.Get "theme/scss/bulma.scss" | resources.ToCSS $sassOptions }}
{{ $bulmaCSS.Content | safeCSS }}

{{ $syntaxCSS := resources.Get "theme/css/syntax.css" | toCSS | minify }}
{{ $syntaxCSS := resources.Get "theme/css/syntax.css" | resources.ToCSS $sassOptions }}
{{ $syntaxCSS.Content | safeCSS }}

{{ $themeCSS := resources.Get "theme/scss/style.scss" | toCSS | minify }}
{{ $themeCSS := resources.Get "theme/scss/style.scss" | resources.ToCSS $sassOptions }}
{{ $themeCSS.Content | safeCSS }}
</style>
{{ end }}
Expand Down
10 changes: 0 additions & 10 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ git pull origin master
git pull origin --tags

npm ci

npm run build
RESOURCES_DIR="resources"
if [ -n "$(git diff ${RESOURCES_DIR})" ]; then
git add "${RESOURCES_DIR}"
git commit -m "chore(release): update ${RESOURCES_DIR}"
else
print_info "skip add and commit for ${RESOURCES_DIR}"
fi

npm run release -- --release-as "${RELEASE_TYPE}" --preset eslint

TAG_NAME="v$(jq -r '.version' ./package.json)"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading