diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index e06bc49..b126ca6 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -26,7 +26,7 @@ jobs: extended: true # optional, default is false - name: Build - run: hugo --config exampleSite/config.toml --minify + run: hugo --config demoSite/config.toml --minify - uses: FirebaseExtended/action-hosting-deploy@v0 with: diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index 687bfb6..1cded39 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -24,7 +24,7 @@ jobs: extended: true # optional, default is false - name: Build - run: hugo --config exampleSite/config.toml --minify + run: hugo --config demoSite/config.toml --minify - uses: FirebaseExtended/action-hosting-deploy@v0 with: diff --git a/.gitignore b/.gitignore index 6b800ba..99ec36f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ # firebase .firebase +# mac +**/.DS_Store + ### Node ### # Logs logs diff --git a/assets/css/banner.scss b/assets/css/banner.scss index feb3d80..97004e6 100644 --- a/assets/css/banner.scss +++ b/assets/css/banner.scss @@ -12,7 +12,7 @@ } & a { - color: #1d212c; + color: var(--accent-contrast-color); display: inline; } diff --git a/assets/css/buttons.scss b/assets/css/buttons.scss index 0c119f7..9830e13 100644 --- a/assets/css/buttons.scss +++ b/assets/css/buttons.scss @@ -18,7 +18,7 @@ a.button { border-radius: 8; border: 1px solid var(--accent); background: var(--accent); - color: var(--background); + color: var(--accent-contrast-color); font: inherit; font-weight: bold; appearance: none; diff --git a/assets/css/logo.scss b/assets/css/logo.scss index d455cc7..2969041 100644 --- a/assets/css/logo.scss +++ b/assets/css/logo.scss @@ -3,6 +3,6 @@ align-items: center; text-decoration: none; background: var(--accent); - color: black; + color: color-mix(in srgb, var(--accent), var(--accent-contrast-color) 90%);; padding: 5px 10px; } diff --git a/assets/css/main.scss b/assets/css/main.scss index 3e2f581..fc24a7e 100644 --- a/assets/css/main.scss +++ b/assets/css/main.scss @@ -110,7 +110,7 @@ figure { padding: 5px 10px; margin-top: 5px; background: var(--accent); - color: var(--background); + color: var(--accent-contrast-color); /* opacity: .8; */ &.left { @@ -291,7 +291,7 @@ ol { mark { background: var(--accent); - color: var(--background); + color: var(--accent-contrast-color); } .container { diff --git a/assets/css/syntax.scss b/assets/css/syntax.scss index d68dfb5..20095ce 100644 --- a/assets/css/syntax.scss +++ b/assets/css/syntax.scss @@ -17,7 +17,7 @@ code.language-scss, .token.number, .token.inserted, .token.important { - color: var(--accent) !important; + color: var(--syntax-value-color, color-mix(in srgb, var(--accent), white)) !important; } .token.tag-id, @@ -34,7 +34,7 @@ code.language-scss, .token.class-name, .token.constant, .token.symbol { - color: rgba(var(--accent), 0.3) !important; + color: var(--syntax-var-color, color-mix(in srgb, var(--accent) 90%, transparent)) !important; } .token.property, @@ -44,7 +44,7 @@ code.language-scss, code.language-javascript, code.language-html, .command-line-prompt > span:before { - color: color-mix(in srgb, var(--accent) 90%, #999 10%) !important; + color: var(--syntax-func-color, color-mix(in srgb, var(--accent) 70%, #999 30%)) !important; } .token.selector, diff --git a/assets/css/variables.scss b/assets/css/variables.scss index 43fd443..70e44ad 100644 --- a/assets/css/variables.scss +++ b/assets/css/variables.scss @@ -1,6 +1,7 @@ :root { /* COLOR VARIABLES */ --background: color-mix(in srgb, var(--accent) 2%, #1D1E28 98%); + --accent-contrast-color: black; --color: white; --border-color: rgba(255, 255, 255, .1); diff --git a/exampleSite/config.toml b/demoSite/config.toml similarity index 76% rename from exampleSite/config.toml rename to demoSite/config.toml index 30f695c..96efe12 100644 --- a/exampleSite/config.toml +++ b/demoSite/config.toml @@ -3,15 +3,6 @@ languageCode = "en-us" # theme = "hugo-theme-re-terminal" paginate = 5 -# Only for demo deploy perpous -[module] -[[module.mounts]] -source = 'exampleSite/content' -target = 'content' -[[module.mounts]] -source = 'exampleSite/static' -target = 'static' - [params] contentTypeName = "posts" themeColor = "blue" @@ -46,3 +37,25 @@ url = "/about" identifier = "showcase" name = "Showcase" url = "/showcase" + + +# Only for demo deploy perpous +[module] +[[module.mounts]] +source = 'demoSite/content' +target = 'content' +[[module.mounts]] +source = 'demoSite/static' +target = 'static' +[[module.mounts]] +source = 'static' +target = 'static' +[[module.mounts]] +source = 'demoSite/layouts' +target = 'layouts' +[[module.mounts]] +source = 'layouts' +target = 'layouts' +[[module.mounts]] +source = 'archetypes' +target = 'archetypes' diff --git a/exampleSite/content/about.md b/demoSite/content/about.md similarity index 100% rename from exampleSite/content/about.md rename to demoSite/content/about.md diff --git a/demoSite/content/posts/css-vars.md b/demoSite/content/posts/css-vars.md new file mode 100644 index 0000000..6beba0d --- /dev/null +++ b/demoSite/content/posts/css-vars.md @@ -0,0 +1,62 @@ ++++ +title = "CSS Variables update" +date = "2024-07-30" +author = "Mirus" +cover = "img/css-variables-update.webp" +description = "A small demo of native CSS Variables. You can create your very own re-Terminal today!" +layout = "css-vars-showcase" +Toc=true ++++ + +## What is going on? + +Hello. This is a first step toward color schema flexibility. + +You still can use existing predefined `accent` colors from the list: +- blue +- green +- orange +- pink +- red + +but if you need to pick another accent colors you can do it with the help of native CSS Variables. + +Just create, if you haven't any yet, `static/style.css` + +and redefine two CSS variables, like this + +```css +:root { + --accent: blue; + --accent-contrast-color: yellow; +} +``` + +### Any other CSS Variable I should know? + +You can find all of them in the browser's page inspector, but here is the list with default values anyway: + +```css + :root { + --accent: #23B0FF; /* 1 of 5 basic colors */ + --background: color-mix(in srgb, var(--accent) 2%, #1D1E28 98%); /* background color; inherit shades of the accent */ + --accent-contrast-color: black; /* mainly uses for text on the accent backgrounds but not limited */ + --color: white; /* text color, also some other text use the variable in color mixing */ + --border-color: rgba(255, 255, 255, .1); /* border color */ + --phone: "max-width: 684px"; /* phone breakpoint */ + --tablet: "max-width: 900px"; /* tablet breakpoint */ + + /* code syntax */ + /* take a look at themes/re-terminal/assets/css/syntax.scss to understand in detail which color stands for */ + --syntax-func-color: color-mix(in srgb, var(--accent) 70%, #999 30%); + --syntax-var-color: color-mix(in srgb, var(--accent) 90%, transparent); + --syntax-value-color: color-mix(in srgb, var(--accent), white); + } +``` + + +### Future plans +Already right now you can play with CSS Variables and achieve decent results, but I hope will work on some light-ish presets and maybe on exposing event more tokens to the users. + + +## The interactive demo \ No newline at end of file diff --git a/exampleSite/content/posts/hello.md b/demoSite/content/posts/hello.md similarity index 100% rename from exampleSite/content/posts/hello.md rename to demoSite/content/posts/hello.md diff --git a/exampleSite/content/showcase.md b/demoSite/content/showcase.md similarity index 97% rename from exampleSite/content/showcase.md rename to demoSite/content/showcase.md index 1ffc150..08a22f3 100644 --- a/exampleSite/content/showcase.md +++ b/demoSite/content/showcase.md @@ -4,6 +4,9 @@ date: "2018-07-18" author: "Hello Robot" --- +# Features in updates +- [native CSS variables showcase](/posts/css-vars/) + ## Header 2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec interdum metus. Aenean rutrum ligula sodales ex auctor, sed tempus dui mollis. Curabitur ipsum dui, aliquet nec commodo at, tristique eget ante. **Donec quis dolor nec nunc mollis interdum vel in purus**. Sed vitae leo scelerisque, sollicitudin elit sed, congue ante. In augue nisl, vestibulum commodo est a, tristique porttitor est. Proin laoreet iaculis ornare. Nullam ut neque quam. diff --git a/demoSite/layouts/posts/css-vars-showcase.html b/demoSite/layouts/posts/css-vars-showcase.html new file mode 100644 index 0000000..2635b57 --- /dev/null +++ b/demoSite/layouts/posts/css-vars-showcase.html @@ -0,0 +1,51 @@ +{{ define "head" }} + +{{ end }}{{ define "main" }} +
+ + {{ partial "single_basic.html" . }} + +
+ #------ + +
+
+ #------ + +
+ + + + {{ if eq .Type $.Site.Params.contentTypeName }} {{ partial + "posts_pagination.html" . }} {{ end }} {{ if not (.Params.hideComments | + default false) }} {{ partial "comments.html" . }} {{ end }} +
+{{ end }} \ No newline at end of file diff --git a/demoSite/static/img/css-variables-update.webp b/demoSite/static/img/css-variables-update.webp new file mode 100644 index 0000000..057cce7 Binary files /dev/null and b/demoSite/static/img/css-variables-update.webp differ diff --git a/exampleSite/static/img/hello.jpg b/demoSite/static/img/hello.jpg similarity index 100% rename from exampleSite/static/img/hello.jpg rename to demoSite/static/img/hello.jpg diff --git a/images/screenshot.png b/images/screenshot.png index c5ae803..16a8a7b 100644 Binary files a/images/screenshot.png and b/images/screenshot.png differ diff --git a/images/tn.png b/images/tn.png index e6f363d..d6f0a90 100644 Binary files a/images/tn.png and b/images/tn.png differ