Skip to content

Commit 99b2cfe

Browse files
committed
#3414 webpage: migrate styling
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent 9722dcd commit 99b2cfe

File tree

5 files changed

+232
-165
lines changed

5 files changed

+232
-165
lines changed

webpage/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ If you run `npm run build` the webpage will be built in production mode in `webp
2828

2929
## Customization
3030

31-
- Styles are mainly stored in [index.styl](https://github.com/pbek/QOwnNotes/blob/main/webpage/src/.vuepress/styles/index.styl)
31+
- Styles are mainly stored in [index.scss](https://github.com/pbek/QOwnNotes/blob/main/webpage/src/.vuepress/styles/index.scss)
3232
- Menus and configuration is stored are [config.js](https://github.com/pbek/QOwnNotes/blob/main/webpage/src/.vuepress/config.js)
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
/**
2+
* Custom Styles here.
3+
*
4+
* ref: https://v2.vuepress.vuejs.org/reference/default-theme/styles.html
5+
*/
6+
7+
// .home .hero img {
8+
// max-width: 450px !important;
9+
// }
10+
11+
.home header.hero img {
12+
max-height: 380px;
13+
}
14+
15+
hr.v-divider {
16+
margin: 20px;
17+
}
18+
19+
// vuetify overrides * with margin 0
20+
p, ul, ol {
21+
margin: 16px 0;
22+
}
23+
24+
h2 {
25+
margin-bottom: 2em;
26+
}
27+
28+
ul ul, ol ol, ul ol, ol ul {
29+
margin: 0;
30+
}
31+
32+
kbd {
33+
white-space: nowrap;
34+
direction: ltr;
35+
}
36+
37+
.v-subheader.blog {
38+
padding: 0;
39+
}
40+
41+
code {
42+
direction: ltr;
43+
}
44+
45+
div.line-numbers-mode {
46+
/* fix the direction of the content in code blocks */
47+
direction: ltr;
48+
/* let the code not touch the right edge of the block */
49+
padding-right: 1rem;
50+
}
51+
52+
// add RTL styles
53+
// taken from: https://github.com/abbasifard/vuepress-rtl/blob/master/src/rtl.styl
54+
html[dir="rtl"] {
55+
ul, ol {
56+
padding-left: 0 !important;
57+
padding-right: 1.2em;
58+
}
59+
60+
div.line-numbers-wrapper {
61+
/* fix the placement of the line numbers */
62+
left: 0;
63+
}
64+
65+
.page-nav > .inner > .prev {
66+
float: right;
67+
}
68+
69+
.page-nav > .inner > .next {
70+
float: left;
71+
}
72+
73+
.page-nav > .inner > .prev:before {
74+
content: '';
75+
}
76+
77+
.page-nav > .inner > .next:after {
78+
content: '';
79+
}
80+
81+
a.sidebar-link {
82+
border-left: none;
83+
border-right: 0.25rem solid transparent;
84+
}
85+
86+
.sidebar .sidebar-sub-headers {
87+
padding-left: 0;
88+
padding-right: 1rem;
89+
}
90+
91+
a.sidebar-link {
92+
border-left: none;
93+
border-right: 0.25rem solid transparent;
94+
95+
&.active {
96+
border-left-color: #fff;
97+
border-right-color: var(--c-brand);
98+
}
99+
100+
.sidebar-group & {
101+
padding-left: 0;
102+
padding-right: 2rem;
103+
}
104+
105+
.sidebar-sub-headers & {
106+
border-left: none;
107+
border-right: none;
108+
}
109+
}
110+
111+
.custom-block {
112+
&.tip, &.warning, &.danger {
113+
border-left-width: 0;
114+
border-right-width: 0.5rem;
115+
border-left-style: none;
116+
border-right-style: solid;
117+
}
118+
}
119+
120+
.sidebar-heading {
121+
padding-left: 0;
122+
padding-right: 1.5rem;
123+
}
124+
125+
.sidebar {
126+
padding-left: 1.5rem;
127+
padding-right: 0;
128+
}
129+
130+
.sidebar-heading, .sidebar {
131+
.arrow {
132+
right: 0.35em;
133+
margin-right: 0.35em;
134+
}
135+
136+
.arrow.right {
137+
transform: rotate(180deg);
138+
}
139+
}
140+
141+
.nav-links {
142+
.nav-item {
143+
margin-left: 0;
144+
margin-right: 1.5rem;
145+
}
146+
147+
.repo-link {
148+
margin-left: 0;
149+
margin-right: 1.5rem;
150+
}
151+
}
152+
153+
.page-nav.content {
154+
.next {
155+
float: left;
156+
}
157+
}
158+
159+
.dropdown-wrapper {
160+
.dropdown-title {
161+
.arrow {
162+
margin-left: 0;
163+
margin-right: 0.4rem;
164+
}
165+
}
166+
}
167+
168+
.content pre, .content pre[class*="language-"] {
169+
direction: ltr;
170+
}
171+
172+
body {
173+
direction: rtl;
174+
}
175+
176+
.page {
177+
padding-left: 0 !important;
178+
padding-right: var(--sidebar-width);
179+
text-align: right;
180+
direction: rtl;
181+
}
182+
183+
.sidebar {
184+
left: auto !important;
185+
right: 0 !important;
186+
border-right: none;
187+
border-left: 1px solid var(--c-border);
188+
direction: rtl;
189+
transform: none;
190+
transition: right 0.5s linear;
191+
}
192+
193+
.theme-container.no-sidebar:not(.sidebar-open) .sidebar {
194+
right: -100vw !important;
195+
}
196+
197+
a.header-anchor {
198+
float: right !important;
199+
margin-left: 0 !important;
200+
margin-right: -0.87em;
201+
padding-right: 0 !important;
202+
padding-left: 0.23em;
203+
}
204+
205+
.search-box {
206+
margin-right: 0 !important;
207+
margin-left: 0.5rem;
208+
}
209+
210+
.navbar {
211+
.links {
212+
left: 1.5rem;
213+
right: auto;
214+
}
215+
}
216+
}
217+

webpage/src/.vuepress/styles/index.styl

Lines changed: 0 additions & 154 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Custom palette here.
3+
*
4+
* ref: https://v2.vuepress.vuejs.org/reference/default-theme/styles.html
5+
*/
6+
7+
:root {
8+
--c-brand: #3eaf7c;
9+
--c-brand-light: #4abf8a;
10+
--c-text: #2c3e50;
11+
--c-border: #eaecef;
12+
--code-bg-color: #282c34;
13+
}
14+

0 commit comments

Comments
 (0)