Skip to content

Commit 2bdf720

Browse files
Merge pull request #1925 from indirectlylit/style-guide-updates-2
Style guide updates 2
2 parents a46cb6b + b97a415 commit 2bdf720

File tree

24 files changed

+363
-382
lines changed

24 files changed

+363
-382
lines changed

kolibri/core/assets/src/views/k-navbar/button/index.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
<script>
2626
2727
import uiIcon from 'keen-ui/src/UiIcon';
28+
29+
/**
30+
Buttons for use inside the k-navbar
31+
*/
2832
export default {
2933
name: 'k-navbar-button',
3034
props: {

kolibri/core/assets/src/views/k-navbar/link/index.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
2525
import ValidateLinkObject from 'kolibri.utils.validateLinkObject';
2626
import uiIcon from 'keen-ui/src/UiIcon';
27+
28+
/**
29+
Links for use inside the k-navbar
30+
*/
2731
export default {
2832
name: 'k-navbar-link',
2933
props: {

kolibri/plugins/style_guide/assets/src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import router from 'kolibri.coreVue.router';
55
import { navMenuRoutes } from './views/shell/nav-menu';
66
import Vuep from 'vuep';
77

8-
Vue.use(Vuep);
8+
Vue.use(Vuep, { lineNumbers: false });
99

1010
class StyleGuideModule extends KolibriModule {
1111
ready() {
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<template>
2+
3+
<page-template title="Breadcrumbs" :completed="false">
4+
5+
<h2><code>{{ kBreadcrumbsApi.name }}</code> API</h2>
6+
<component-docs :api="kBreadcrumbsApi" />
7+
8+
<h2>Code Example</h2>
9+
<vue-example :code="example" />
10+
11+
<h2>Guidelines</h2>
12+
13+
<h3>Usage</h3>
14+
<ul>
15+
<li>Should be used with any instance of the topic tree.</li>
16+
<li>Should be directly above the content intended to navigate through.</li>
17+
<li>Should include the current item/location, which does not require a link.</li>
18+
</ul>
19+
20+
<h3>Responsiveness</h3>
21+
<ul>
22+
<li>Items do not wrap to another line.</li>
23+
<li>The current item/location is always shown, and truncated if necessary.</li>
24+
<li>Items that do not fit within will pushed into the dropdown.</li>
25+
<li>Items within dropdown are orderd bottom up. Meaning, the highest level item will be at the bottom.</li>
26+
</ul>
27+
28+
</page-template>
29+
30+
</template>
31+
32+
33+
<script>
34+
35+
import componentDocs from '../../shell/component-docs';
36+
import vueExample from '../../shell/vue-example';
37+
import pageTemplate from '../../shell/page-template';
38+
39+
import example from 'raw-loader!./example.html';
40+
import kBreadcrumbsApi from '!vue-doc!kolibri.coreVue.components.kBreadcrumbs';
41+
42+
import FullVue from 'vue/dist/vue.common';
43+
import kBreadcrumbs from 'kolibri.coreVue.components.kBreadcrumbs';
44+
FullVue.component('k-breadcrumbs', kBreadcrumbs);
45+
46+
export default {
47+
components: {
48+
pageTemplate,
49+
componentDocs,
50+
vueExample,
51+
},
52+
data: () => ({
53+
kBreadcrumbsApi,
54+
example,
55+
}),
56+
};
57+
58+
</script>
59+
60+
61+
<style lang="stylus"></style>
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
<template>
2+
3+
<page-template title="Buttons" :completed="false">
4+
5+
<h2><code>{{ kButtonApi.name }}</code> API</h2>
6+
<component-docs :api="kButtonApi" />
7+
8+
<h2>Code Example</h2>
9+
<vue-example :code="example" />
10+
11+
<h2>Guidelines</h2>
12+
13+
<h3>Scope</h3>
14+
<p>
15+
This is meant to cover 90% of buttons. There will always be edge cases,
16+
and common sense always trumps rote rules. Maintain consistency as much as
17+
possible, but don’t make significant sacrifices in the UX for the sake of
18+
consistency.
19+
</p>
20+
21+
<h3>Types of buttons</h3>
22+
<p>
23+
There are 3 main types of buttons, each to map to a different level of
24+
visual hierarchy
25+
</p>
26+
<ul>
27+
<li>Raised buttons for more prominent actions</li>
28+
<li>Flat buttons for less prominent or actions that repeat in a list</li>
29+
<li>Hyperlink text for very deemphasized actions or in paragraphs.</li>
30+
</ul>
31+
32+
<h3>Dropdown buttons</h3>
33+
<p>
34+
In areas where multiple actions are necessary, raised or flat buttons
35+
can be made into dropdown buttons, which have multiple actions nested
36+
underneath them in a menu
37+
</p>
38+
<p>
39+
The label on a dropdown button is not an action itself, but rather
40+
should label the group of actions that are nested under the button
41+
</p>
42+
<p>
43+
If a single action is more important or prominent than the others, it
44+
can be brought out as its own individual button, next to the menu with
45+
more actions
46+
</p>
47+
48+
<h3>Language</h3>
49+
<p>
50+
Buttons should aim to have a single word in them, with two at most
51+
</p>
52+
<p>
53+
The buttons language should avoid any ambiguity, be specific to the
54+
action you are completing. For example, use 'Save' instead of 'OK'.
55+
</p>
56+
<p>
57+
Never use commas or other punctuation in buttons
58+
</p>
59+
60+
<h3>Color usage</h3>
61+
<p>
62+
Primary/affirmative actions should be purple
63+
</p>
64+
<p>
65+
Secondary/cancel actions should be grey
66+
</p>
67+
<p>
68+
Tertiary links should always use purple
69+
</p>
70+
71+
<h3>Button placement</h3>
72+
<p>
73+
Buttons should be right aligned in modals
74+
</p>
75+
<p>
76+
Global actions on tables should be put above the table and right aligned
77+
</p>
78+
<p>
79+
Deviates from these patterns are fine with common sense
80+
</p>
81+
82+
<h3>Iconography</h3>
83+
<p>
84+
Aside from the dropdown icon, there is no iconography in buttons
85+
</p>
86+
87+
<h3>Responsive</h3>
88+
<p>
89+
Buttons should be determined by the size of the text in them, with a min
90+
width. They should not generally transform based on the size of the
91+
page.
92+
</p>
93+
<p>
94+
Buttons should elide if you really really really have but pls don’t thx
95+
</p>
96+
97+
<h4>Language</h4>
98+
<ul>
99+
<li>Buttons should be specific to action</li>
100+
<li>Ideally 1 word, no more than 2 words</li>
101+
</ul>
102+
<h4>Color usage</h4>
103+
<ul>
104+
<li>Use fushia for primary actions #996189</li>
105+
<li>Grey for secondary action or cancel #EEEEEE</li>
106+
</ul>
107+
<h4>Iconography</h4>
108+
<ul>
109+
<li>No iconography aside from dropdown carrot</li>
110+
</ul>
111+
<h4>Placement on page</h4>
112+
<ul>
113+
<li>Right aligned on modals</li>
114+
<li>Top right for major creation actions</li>
115+
</ul>
116+
117+
</page-template>
118+
119+
</template>
120+
121+
122+
<script>
123+
124+
import componentDocs from '../../shell/component-docs';
125+
import vueExample from '../../shell/vue-example';
126+
import pageTemplate from '../../shell/page-template';
127+
128+
import example from 'raw-loader!./example.html';
129+
import kButtonApi from '!vue-doc!kolibri.coreVue.components.kButton';
130+
131+
import FullVue from 'vue/dist/vue.common';
132+
import kButton from 'kolibri.coreVue.components.kButton';
133+
FullVue.component('k-button', kButton);
134+
135+
export default {
136+
components: {
137+
pageTemplate,
138+
componentDocs,
139+
vueExample,
140+
},
141+
data: () => ({
142+
kButtonApi,
143+
example,
144+
}),
145+
};
146+
147+
</script>
148+
149+
150+
<style lang="stylus" scoped></style>

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

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)