Skip to content

Commit 0f1e0d2

Browse files
committed
Merge branch 'master' of github.com:ionic-team/ionic-docs
# Conflicts: # src/components/menu/templates/main.tsx # src/pages/building/migration.md # src/pages/installation/cdn.md # src/pages/layout/css-utilities.md
2 parents 0647243 + e19a652 commit 0f1e0d2

File tree

39 files changed

+740
-257
lines changed

39 files changed

+740
-257
lines changed

app.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"addons": [
3+
"papertrail"
4+
],
5+
"buildpacks": [
6+
{
7+
"url": "heroku/nodejs"
8+
}
9+
],
10+
"env": {
11+
"NODE_ENV": {
12+
"required": true
13+
},
14+
"NODEMODULESCACHE": {
15+
"required": true
16+
},
17+
"NPM_CONFIG_PRODUCTION": {
18+
"required": true
19+
},
20+
"PORT": {
21+
"required": true
22+
},
23+
"PROD": {
24+
"required": true
25+
}
26+
},
27+
"formation": {
28+
"web": {
29+
"quantity": 1
30+
}
31+
},
32+
"name": "ionic-docs",
33+
"scripts": {
34+
},
35+
"stack": "heroku-18"
36+
}

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"watch-pages": "ts-node -P scripts/tsconfig.json scripts/watch-pages"
1919
},
2020
"dependencies": {
21-
"@ionic/core": "^4.1.1",
22-
"@ionic/docs": "^4.1.1",
21+
"@ionic/core": "^4.1.2",
22+
"@ionic/docs": "^4.1.2",
2323
"@stencil/core": "^0.18.0",
2424
"@stencil/router": "^0.3.3",
2525
"express": "^4.16.4"

src/components.d.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,14 @@ export namespace Components {
157157
}
158158

159159
interface DocsDropdown {
160+
'align': 'left' | 'right' | 'center';
160161
'close': () => void;
161162
'label': string;
162163
'open': () => void;
163164
'toggle': () => void;
164165
}
165166
interface DocsDropdownAttributes extends StencilHTMLAttributes {
167+
'align'?: 'left' | 'right' | 'center';
166168
'label'?: string;
167169
}
168170

@@ -250,9 +252,6 @@ export namespace Components {
250252
interface DocsSearch {}
251253
interface DocsSearchAttributes extends StencilHTMLAttributes {}
252254

253-
interface DocsSectionNav {}
254-
interface DocsSectionNavAttributes extends StencilHTMLAttributes {}
255-
256255
interface SmsForm {}
257256
interface SmsFormAttributes extends StencilHTMLAttributes {}
258257

@@ -321,7 +320,6 @@ declare global {
321320
'DocsReference': Components.DocsReference;
322321
'DocsRoot': Components.DocsRoot;
323322
'DocsSearch': Components.DocsSearch;
324-
'DocsSectionNav': Components.DocsSectionNav;
325323
'SmsForm': Components.SmsForm;
326324
'SteppedColorGenerator': Components.SteppedColorGenerator;
327325
'DocsTableOfContents': Components.DocsTableOfContents;
@@ -362,7 +360,6 @@ declare global {
362360
'docs-reference': Components.DocsReferenceAttributes;
363361
'docs-root': Components.DocsRootAttributes;
364362
'docs-search': Components.DocsSearchAttributes;
365-
'docs-section-nav': Components.DocsSectionNavAttributes;
366363
'sms-form': Components.SmsFormAttributes;
367364
'stepped-color-generator': Components.SteppedColorGeneratorAttributes;
368365
'docs-table-of-contents': Components.DocsTableOfContentsAttributes;
@@ -563,12 +560,6 @@ declare global {
563560
new (): HTMLDocsSearchElement;
564561
};
565562

566-
interface HTMLDocsSectionNavElement extends Components.DocsSectionNav, HTMLStencilElement {}
567-
var HTMLDocsSectionNavElement: {
568-
prototype: HTMLDocsSectionNavElement;
569-
new (): HTMLDocsSectionNavElement;
570-
};
571-
572563
interface HTMLSmsFormElement extends Components.SmsForm, HTMLStencilElement {}
573564
var HTMLSmsFormElement: {
574565
prototype: HTMLSmsFormElement;
@@ -632,7 +623,6 @@ declare global {
632623
'docs-reference': HTMLDocsReferenceElement
633624
'docs-root': HTMLDocsRootElement
634625
'docs-search': HTMLDocsSearchElement
635-
'docs-section-nav': HTMLDocsSectionNavElement
636626
'sms-form': HTMLSmsFormElement
637627
'stepped-color-generator': HTMLSteppedColorGeneratorElement
638628
'docs-table-of-contents': HTMLDocsTableOfContentsElement
@@ -673,7 +663,6 @@ declare global {
673663
'docs-reference': HTMLDocsReferenceElement;
674664
'docs-root': HTMLDocsRootElement;
675665
'docs-search': HTMLDocsSearchElement;
676-
'docs-section-nav': HTMLDocsSectionNavElement;
677666
'sms-form': HTMLSmsFormElement;
678667
'stepped-color-generator': HTMLSteppedColorGeneratorElement;
679668
'docs-table-of-contents': HTMLDocsTableOfContentsElement;

src/components/dropdown/dropdown.css

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626

2727
.Dropdown-button > svg {
2828
fill: currentColor;
29-
height: 1em;
30-
margin-bottom: -0.15em;
31-
width: 1em;
29+
height: 0.8em;
30+
margin-bottom: -0.0875em;
31+
width: 0.8em;
3232
}
3333

3434
.Dropdown.is-open .Dropdown-button > svg {
@@ -37,11 +37,10 @@
3737

3838
.Dropdown-panel {
3939
background-color: var(--background);
40-
border-radius: 4px;
40+
border-radius: 6px;
4141
border: solid 1px var(--line-rule-color);
4242
box-shadow: 4px 4px 12px 4px rgba(0,0,0,0.025);
43-
left: 0;
44-
min-width: 120%;
43+
min-width: 100%;
4544
overflow: hidden;
4645
pointer-events: none;
4746
position: absolute;
@@ -53,3 +52,35 @@
5352
pointer-events: auto;
5453
visibility: visible;
5554
}
55+
56+
.Dropdown--left .Dropdown-panel {
57+
left: 0;
58+
}
59+
60+
.Dropdown--right .Dropdown-panel {
61+
right: 0;
62+
}
63+
64+
.Dropdown--center .Dropdown-panel {
65+
left: 50%;
66+
transform: translateX(-50%);
67+
}
68+
69+
.Dropdown-panel a {
70+
display: block;
71+
padding: 0.5em 1em;
72+
}
73+
74+
@media (hover: hover) {
75+
.Dropdown-panel a:hover {
76+
background-color: rgba(0, 0, 0, 0.025);
77+
}
78+
}
79+
80+
.Dropdown-panel > section {
81+
padding: 0.5em 0;
82+
}
83+
84+
.Dropdown-panel > section:not(:last-child) {
85+
border-bottom: solid 1px var(--line-rule-color);
86+
}

src/components/dropdown/dropdown.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
import { Component, Listen, Method, Prop, State } from '@stencil/core';
1+
import { Component, Element, Listen, Method, Prop, State } from '@stencil/core';
22
import { DownArrow } from '../../icons';
33

44
@Component({
55
tag: 'docs-dropdown',
66
styleUrl: 'dropdown.css'
77
})
88
export class DocsDropdown {
9+
@Prop() align: 'left' | 'right' | 'center' = 'left';
910
@Prop() label: string;
1011
@State() isOpen = false;
12+
@Element() element: HTMLElement;
1113

12-
@Listen('click')
14+
@Listen('window:click')
1315
handleClick(event: MouseEvent) {
14-
event.stopPropagation();
16+
const isNode = event.target instanceof Node;
17+
const isOurs = isNode && this.element.contains(event.target as Node);
18+
19+
if (!isOurs) {
20+
this.close();
21+
}
1522
}
1623

17-
@Listen('window:click')
1824
@Method()
1925
close() {
2026
this.isOpen = false;
@@ -34,6 +40,7 @@ export class DocsDropdown {
3440
return {
3541
class: {
3642
'Dropdown': true,
43+
[`Dropdown--${this.align}`]: true,
3744
'is-open': this.isOpen
3845
}
3946
};
@@ -43,13 +50,17 @@ export class DocsDropdown {
4350
const button = (
4451
<button
4552
class="Dropdown-button"
53+
aria-haspopup="menu"
54+
aria-expanded={this.isOpen ? 'true' : 'false'}
4655
onClick={this.toggle.bind(this)}>
4756
{this.label} <DownArrow/>
4857
</button>
4958
);
5059

5160
const panel = (
52-
<div class="Dropdown-panel">
61+
<div
62+
role="menu"
63+
class="Dropdown-panel">
5364
<slot/>
5465
</div>
5566
);

src/components/header/header.css

Lines changed: 89 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,10 @@ docs-header {
3030
}
3131

3232
docs-header header {
33-
height: var(--header-height);
34-
padding: 0 1.4rem 0 0.8rem;
35-
}
36-
37-
docs-header header,
38-
docs-header nav {
3933
align-items: center;
4034
display: flex;
41-
}
42-
43-
docs-header header > *:not(:last-child),
44-
docs-header nav > *:not(:last-child) {
45-
margin-right: 1em;
35+
height: var(--header-height);
36+
padding: 0 1.4rem 0 0.8rem;
4637
}
4738

4839
docs-header a {
@@ -62,15 +53,102 @@ docs-header .link-active {
6253

6354
docs-header docs-menu-toggle {
6455
flex: none;
56+
margin-right: 0.75em;
6557
}
6658

6759
.HeaderLogo {
6860
color: var(--text-color--dark);
6961
font-family: var(--heading-font-family);
7062
height: 25px;
63+
margin-right: 0.125em;
64+
}
65+
66+
.SectionNav stencil-route {
67+
display: flex;
68+
}
69+
70+
.SectionNav .Dropdown {
71+
align-self: center;
72+
color: var(--text-color);
73+
margin-right: 0.75em;
74+
}
75+
76+
.SectionNav .Dropdown-button {
77+
border: solid 1px transparent;
78+
border-radius: 6px;
79+
color: var(--text-color--dark);
80+
padding: 10px;
81+
transition: border-color 100ms ease;
82+
}
83+
84+
.SectionNav .Dropdown.is-open .Dropdown-button {
85+
border-color: var(--line-rule-color);
86+
}
87+
88+
@media (hover: hover) {
89+
.SectionNav .Dropdown-button:hover {
90+
border-color: var(--line-rule-color);
91+
}
92+
}
93+
94+
.SectionNav .Dropdown-panel {
95+
min-width: 180px;
96+
}
97+
98+
.SectionNav .Dropdown-panel a {
99+
display: flex;
100+
justify-content: space-between;
101+
}
102+
103+
.SectionNav .Dropdown-panel svg {
104+
height: 1em;
105+
width: 1em;
106+
}
107+
108+
.SectionNav-tabs > * {
109+
align-items: center;
110+
display: inline-flex;
111+
height: var(--header-height);
112+
margin-right: 1em;
113+
position: relative;
114+
}
115+
116+
.SectionNav-tabs .link-active:after {
117+
background-color: currentColor;
118+
bottom: 0;
119+
content: "";
120+
display: block;
121+
height: 2px;
122+
left: 0;
123+
position: absolute;
124+
width: 100%;
71125
}
72126

73127
.UtilNav {
128+
align-items: center;
129+
display: flex;
74130
font-size: 12px;
75131
margin-left: auto;
76132
}
133+
134+
.UtilNav > * {
135+
margin-left: 1em;
136+
}
137+
138+
.UtilNav .Dropdown.is-open {
139+
color: var(--text-color);
140+
}
141+
142+
.UtilNav .Dropdown-button {
143+
padding: 10px 0;
144+
}
145+
146+
@media (hover: hover) {
147+
.UtilNav .Dropdown-button:hover {
148+
color: var(--text-color);
149+
}
150+
}
151+
152+
.UtilNav .Dropdown-panel {
153+
font-size: 14px;
154+
}

0 commit comments

Comments
 (0)