Skip to content

Commit ccc9627

Browse files
Merge pull request #1923 from indirectlylit/style-guide-updates
Style guide updates 1
2 parents ad1df1c + c93a5fa commit ccc9627

File tree

9 files changed

+95
-183
lines changed

9 files changed

+95
-183
lines changed

kolibri/plugins/style_guide/assets/src/views/content/components/k-breadcrumbs-example.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,3 @@
3232
};
3333

3434
</script>
35-
36-
37-
<style lang="stylus" scoped></style>

kolibri/plugins/style_guide/assets/src/views/content/components/k-button-example.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,3 @@
1919
module.exports = {};
2020

2121
</script>
22-
23-
24-
<style lang="stylus" scoped></style>

kolibri/plugins/style_guide/assets/src/views/content/components/k-navbar-example.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,3 @@
2929
module.exports = {};
3030

3131
</script>
32-
33-
34-
<style lang="stylus" scoped></style>

kolibri/plugins/style_guide/assets/src/views/content/home/home-page.vue

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,4 @@
1515
</script>
1616

1717

18-
<style lang="stylus" scoped>
19-
20-
@require '../../../styles/style-guide.styl'
21-
22-
// TODO: dry up this shared styling
23-
.intro
24-
margin-left: $sidenav-width
25-
padding: 32px
26-
h1
27-
line-height: 1.7em
28-
29-
</style>
18+
<style lang="stylus" scoped></style>

kolibri/plugins/style_guide/assets/src/views/index.vue

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<div>
44
<sidenav/>
5-
<router-view/>
5+
<router-view class="content"/>
66
</div>
77

88
</template>
@@ -30,6 +30,17 @@
3030
</script>
3131

3232

33+
<style lang="stylus" scoped>
34+
35+
@require '../styles/style-guide.styl'
36+
37+
.content
38+
margin-left: $sidenav-width + 32
39+
margin-top: 24px
40+
41+
</style>
42+
43+
3344
<style lang="stylus">
3445
3546
// NOT SCOPED
@@ -45,4 +56,19 @@
4556
html
4657
overflow: initial
4758
59+
@require '~vuep/dist/vuep.css'
60+
61+
.vuep
62+
// TODO: vuep pullutes the font-family
63+
font-family: NotoSans
64+
display: initial
65+
height: initial
66+
67+
.vuep-preview, .vuep-editor
68+
width: 100%
69+
70+
.vuep-preview
71+
padding: 8px
72+
4873
</style>
74+

kolibri/plugins/style_guide/assets/src/views/shell/component-template.vue

Lines changed: 35 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77

88
<p>{{ api.description }}</p>
99

10-
10+
<!--
1111
<h2>Status</h2>
12-
1312
<p v-if="status === 'complete'" class="status-complete">Fully implemented</p>
1413
<p v-else class="status-incomplete">Not fully implemented</p>
15-
14+
-->
1615

1716
<h2 id="api">API</h2>
1817

@@ -159,82 +158,56 @@
159158
</script>
160159

161160

162-
<style lang="stylus">
163-
164-
// NOT SCOPED
165-
166-
@require '~vuep/dist/vuep.css'
167-
168-
.vuep
169-
// TODO: vuep pullutes the font-family
170-
font-family: NotoSans
171-
display: initial
172-
height: initial
173-
174-
.vuep-preview, .vuep-editor
175-
width: 100%
176-
177-
.vuep-preview
178-
padding: 8px
179-
180-
</style>
181-
182-
183161
<style lang="stylus" scoped>
184162
185163
@require '~kolibri.styles.definitions'
186164
@require '../../styles/style-guide.styl'
187165
188-
.component-template
189-
margin-left: $sidenav-width
190-
padding: 32px
191-
line-height: 1.3em
192-
193-
h1
194-
line-height: 1.7em
166+
h1
167+
line-height: 1.7em
195168
196-
h1, h2, h3
197-
color: #333
169+
h1, h2, h3
170+
color: #333
198171
199-
h2, h3
200-
margin-top: 2em
201-
margin-bottom: 0.5em
172+
h2, h3
173+
margin-top: 2em
174+
margin-bottom: 0.5em
202175
203-
h4
204-
margin-bottom: 0.5em
176+
h4
177+
margin-bottom: 0.5em
205178
206-
p
207-
margin-top: 0
208-
max-width: 50em
179+
p
180+
margin-top: 0
181+
max-width: 50em
209182
210-
ul
211-
margin-top: 0.5em
183+
ul
184+
margin-top: 0.5em
212185
213-
li
214-
margin-bottom: 0.3em
186+
li
187+
margin-bottom: 0.3em
215188
216189
217-
table, th, td
218-
border: 1px solid darkgray
219-
border-collapse: collapse
190+
table, th, td
191+
border: 1px solid darkgray
192+
border-collapse: collapse
220193
221-
th, td
222-
padding: 0.5em
194+
th, td
195+
padding: 0.5em
223196
224-
th
225-
background: #e0e0e0
226-
text-align: left
197+
th
198+
background: #e0e0e0
199+
text-align: left
227200
228-
code
229-
background: #fdf6e3
230-
color: #268bd2
231-
font-size: smaller
232-
padding: 4px
201+
code
202+
background: #fdf6e3
203+
color: #268bd2
204+
font-size: smaller
205+
padding: 4px
233206
234-
.status-complete
235-
color: $core-status-correct
207+
.status-complete
208+
color: $core-status-correct
236209
237-
.status-incomplete
238-
color: $core-status-wrong
210+
.status-incomplete
211+
color: $core-status-wrong
239212
240213
</style>

kolibri/plugins/style_guide/assets/src/views/shell/nav-menu.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ const homeRoute = [
2222
},
2323
];
2424

25-
const componentsMap = {
26-
kButton: 'k-button',
27-
kBreadcrumbs: 'k-breadcrumbs',
28-
kNavbar: 'k-navbar',
29-
};
30-
3125
// This data structure contains the navigational links pointing to all the
3226
// content pages in the style guide.
3327
// Notes: This is view-agnostic; it doesn't make assumption on how it will be
@@ -51,23 +45,23 @@ const navMenu = [
5145
sectionName: 'Components',
5246
sectionItems: sortSectionItems([
5347
{
54-
itemName: componentsMap.kButton,
48+
itemName: 'Buttons',
5549
itemRoute: {
56-
path: `/components/${componentsMap.kButton}`,
50+
path: `/components/buttons`,
5751
component: kButton,
5852
},
5953
},
6054
{
61-
itemName: componentsMap.kBreadcrumbs,
55+
itemName: 'Breadcrumbs',
6256
itemRoute: {
63-
path: `/components/${componentsMap.kBreadcrumbs}`,
57+
path: `/components/breadcrumbs`,
6458
component: kBreadcrumbs,
6559
},
6660
},
6761
{
68-
itemName: componentsMap.kNavbar,
62+
itemName: 'Horizontal Navbar',
6963
itemRoute: {
70-
path: `/components/${componentsMap.kNavbar}`,
64+
path: `/components/navbar`,
7165
component: kNavbar,
7266
},
7367
},
Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<template>
22

3-
<div class="sidenav">
3+
<nav class="sidenav">
44
<router-link :to="'/'" class="sidenav-heading">
5-
<h1>Kolibri Style Guide</h1>
5+
Kolibri Style Guide
66
</router-link>
77

8-
<nav class="sidenav-menu">
8+
<div>
99
<template v-for="section in navMenu">
10-
<h2>{{ section.sectionName }}</h2>
10+
<div class="section-heading">{{ section.sectionName }}</div>
1111
<ul>
1212
<li v-for="sectionItem in section.sectionItems">
13-
<router-link :to="sectionItem.itemRoute">
13+
<router-link :to="sectionItem.itemRoute" class="link">
1414
{{ sectionItem.itemName }}
1515
</router-link>
1616
</li>
1717
</ul>
1818
</template>
19-
</nav>
20-
</div>
19+
</div>
20+
</nav>
2121

2222
</template>
2323

@@ -53,34 +53,29 @@
5353
5454
.sidenav-heading
5555
display: block
56-
padding: 16px 24px
56+
padding: 32px 24px
5757
text-decoration: none
58-
h1
59-
margin: 0
60-
font-size: 1.25em
58+
font-size: 1.25em
6159
60+
.section-heading
61+
font-weight: bold
62+
margin-right: 24px
63+
margin-left: 24px
64+
margin-top: 24px
65+
margin-bottom: 12px
6266
63-
.sidenav-menu
64-
h2
65-
margin-right: 24px
66-
margin-left: 24px
67-
margin-top: 24px
68-
margin-bottom: 12px
67+
ul
68+
margin: 0
69+
padding: 0
70+
list-style-type: none
6971
70-
ul
71-
margin: 0
72-
padding: 0
73-
list-style-type: none
74-
75-
li
76-
77-
a
78-
display: block
79-
padding: 12px 24px
80-
text-decoration: none
72+
.link
73+
display: block
74+
padding: 12px 24px
75+
text-decoration: none
8176
82-
&.router-link-active
83-
font-weight: bold
84-
background-color: #E0E0E0
77+
&.router-link-active
78+
font-weight: bold
79+
background-color: #E0E0E0
8580
8681
</style>

0 commit comments

Comments
 (0)