Hugo-theme-stack/assets/scss/partials/sidebar.scss
Jimmy Cai 8a597a5c9c
Merge branch 'canary' into master (#711)
* refactor(i18n): simplify the structure of the translation file

* chore: prepare repository for v4.0.0-alpha

* chore: modify go.mod to v4

* refactor: migrate theme configuration to TOML

* fix: exampleSite not using correct theme

* feat: add favicon from assets folder

* refactor: drop linear grandient background feature

remove node-vibrant from dependencies

* feat: use Hugo's code block render hook to implement code copy button

Now it can have i18n support

* refactor: delete color.ts

* refactor: delete Emoji support post from example site

* refactor: drop support for `hidden` field in front matter

* feat: upgrade to PhotoSwipe v5

* chore: bump the required hugo version to 0.100.0

* refactor: remove PhotoSwipe from external.yaml

* fix: extra margin in search result

* fix: incorrect markdown heading level in example site

* refactor: remove some usages of `default` in template

No longer needed thanks to Hugo's configuration merge

* fix: one line codeblock style in firefox

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/564

* feat: add style to new codeblock

* feat: i18n support for codeblock copy text

* fix(menu): jitter when closing menu

It's caused by flexbox gap property, which can't animate

* fix(search): long text overflows under the Search icon

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/515
2022-10-29 17:02:24 +02:00

203 lines
4.0 KiB
SCSS

.sidebar {
&.sticky {
@include respond(md) {
position: sticky;
}
}
}
.left-sidebar {
display: flex;
flex-direction: column;
flex-shrink: 0;
align-self: stretch;
max-width: none;
width: 100%;
position: relative;
--sidebar-avatar-size: 100px;
--sidebar-element-separation: 20px;
--emoji-size: 40px;
--emoji-font-size: 20px;
@include respond(md) {
width: auto;
padding-top: var(--main-top-padding);
padding-bottom: var(--main-top-padding);
max-height: 100vh;
}
@include respond(2xl) {
--sidebar-avatar-size: 120px;
--sidebar-element-separation: 25px;
--emoji-size: 40px;
}
&.sticky {
top: 0;
}
&.compact {
--sidebar-avatar-size: 80px;
--emoji-size: 30px;
--emoji-font-size: 15px;
header {
@include respond(lg) {
flex-direction: row;
}
.site-meta {
gap: 5px;
}
.site-name {
font-size: 1.4rem;
@include respond(2xl) {
font-size: 1.75rem;
}
}
.site-description {
font-size: 1.4rem;
}
}
}
.social-menu,
.menu {
margin-top: var(--sidebar-element-separation);
}
}
.right-sidebar {
width: 100%;
display: none;
flex-direction: column;
gap: var(--widget-separation);
&.sticky {
top: 0;
}
@include respond(lg) {
padding-top: var(--main-top-padding);
}
}
.sidebar header {
z-index: 1;
transition: box-shadow 0.5s ease;
display: flex;
flex-direction: column;
gap: var(--sidebar-element-separation);
@include respond(md) {
padding: 0;
}
.site-avatar {
position: relative;
margin: 0;
width: var(--sidebar-avatar-size);
height: var(--sidebar-avatar-size);
flex-shrink: 0;
.site-logo {
width: 100%;
height: 100%;
border-radius: 100%;
box-shadow: var(--shadow-l1);
}
.emoji {
position: absolute;
width: var(--emoji-size);
height: var(--emoji-size);
line-height: var(--emoji-size);
border-radius: 100%;
bottom: 0;
right: 0;
text-align: center;
font-size: var(--emoji-font-size);
background-color: var(--card-background);
box-shadow: var(--shadow-l2);
}
}
.site-meta {
display: flex;
flex-direction: column;
gap: 10px;
justify-content: center;
}
.site-name {
color: var(--accent-color);
margin: 0;
font-size: 1.6rem;
@include respond(2xl) {
font-size: 1.8rem;
}
}
.site-description {
color: var(--body-text-color);
font-weight: normal;
margin: 0;
font-size: 1.4rem;
@include respond(2xl) {
font-size: 1.6rem;
}
}
}
[data-scheme="dark"] {
#dark-mode-toggle {
color: var(--accent-color);
font-weight: 700;
.icon-tabler-toggle-left {
display: none;
}
.icon-tabler-toggle-right {
display: unset;
}
}
}
#dark-mode-toggle {
margin-top: auto;
color: var(--body-text-color);
display: flex;
align-items: center;
cursor: pointer;
gap: var(--menu-icon-separation);
.icon-tabler-toggle-right {
display: none;
}
}
#i18n-switch {
color: var(--body-text-color);
display: inline-flex;
align-content: center;
gap: var(--menu-icon-separation);
select {
border: 0;
background-color: transparent;
color: var(--body-text-color);
option {
color: var(--card-text-color-main);
background-color: var(--card-background);
}
}
}