aboutsummaryrefslogtreecommitdiff
path: root/templates/@theme-base/pm-styles/_pm-sticky-header.scss
diff options
context:
space:
mode:
authorcristiano <[email protected]>2020-12-31 11:52:25 +0000
committerGitHub <[email protected]>2020-12-31 11:52:25 +0000
commit692a8cba26a388bafe7f4c7bd717bc42bd22c94f (patch)
tree3499401624e6445dade4c80a4ab08812a5672b05 /templates/@theme-base/pm-styles/_pm-sticky-header.scss
parent77953d96fd340f0ba53b2a293c69bcfcfb1ee7c1 (diff)
parent167fa2b153ac674f1c252f6041af30f4e3e59a22 (diff)
downloadprotonmail-themes-692a8cba26a388bafe7f4c7bd717bc42bd22c94f.tar.xz
protonmail-themes-692a8cba26a388bafe7f4c7bd717bc42bd22c94f.zip
Merge pull request #28 from csalmeida/themes-v4
Theme rewrite for ProtonMail v4
Diffstat (limited to 'templates/@theme-base/pm-styles/_pm-sticky-header.scss')
-rw-r--r--templates/@theme-base/pm-styles/_pm-sticky-header.scss62
1 files changed, 62 insertions, 0 deletions
diff --git a/templates/@theme-base/pm-styles/_pm-sticky-header.scss b/templates/@theme-base/pm-styles/_pm-sticky-header.scss
new file mode 100644
index 0000000..e5baac2
--- /dev/null
+++ b/templates/@theme-base/pm-styles/_pm-sticky-header.scss
@@ -0,0 +1,62 @@
+/*
+ * sticky header and container for sections
+ */
+
+$sticky-title-height: 10rem !default;
+.sticky-title {
+ position: -webkit-sticky;
+ position: sticky;
+ top: 0;
+ box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.1);
+ padding: .5em .75em;
+ background: inherit;
+ z-index: 11;
+}
+.sticky-title--onTop {
+ box-shadow: none;
+}
+.sticky-title--noPadding {
+ padding: 0;
+}
+
+.container-section-sticky {
+ padding: 3em 2em 0 2em;
+ max-width: 120ch; // avoid too long lines
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.container-section-sticky.pt0 { // 😓
+ padding-top: 0;
+}
+
+.container-section-sticky--fullwidth {
+ max-width: none;
+}
+
+.container-section-sticky-section {
+ margin-bottom: 8rem;
+}
+
+
+/* trick for fixing anchor links */
+.header-height-anchor {
+ position: absolute;
+ top: -#{$sticky-title-height};
+}
+
+// not sticky on mobile
+@include respond-to($breakpoint-small) {
+ .sticky-title:not(.onmobile-remain-sticky) {
+ position: static;
+ box-shadow: none;
+ }
+ .container-section-sticky-section {
+ margin-bottom: 8rem;
+ }
+ .header-height-anchor {
+ position: static;
+ top: 0;
+ }
+}
+