Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1cfa750

Browse filesBrowse files
authored
Add styles to doc search (immutable-js#1628)
Follow up to immutable-js#1610
1 parent 2a52546 commit 1cfa750
Copy full SHA for 1cfa750

File tree

Expand file treeCollapse file tree

5 files changed

+37
-5
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+37
-5
lines changed

‎pages/src/docs/src/DocSearch.js

Copy file name to clipboardExpand all lines: pages/src/docs/src/DocSearch.js
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ var DocSearch = React.createClass({
2020
inputSelector: '#algolia-docsearch',
2121
});
2222
} else {
23-
console.warn('Search has failed to load and now is being disabled');
2423
this.setState({ enabled: false });
2524
}
2625
},
@@ -36,7 +35,14 @@ var DocSearch = React.createClass({
3635
firstLink.parentNode.insertBefore(link, firstLink);
3736
},
3837
render() {
39-
return this.state.enabled ? <input id="algolia-docsearch" /> : null;
38+
return this.state.enabled ? (
39+
<input
40+
id="algolia-docsearch"
41+
className="docSearch"
42+
type="search"
43+
placeholder="Search Immutable.js Documentation"
44+
/>
45+
) : null;
4046
},
4147
});
4248

‎pages/src/docs/src/SideBar.js

Copy file name to clipboardExpand all lines: pages/src/docs/src/SideBar.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ var React = require('react');
99
var Router = require('react-router');
1010
var { Map, Seq } = require('../../../../');
1111
var defs = require('../../../lib/getTypeDefs');
12-
var DocSearch = require('./DocSearch.js');
1312

1413
var SideBar = React.createClass({
1514
render() {
@@ -44,7 +43,6 @@ var SideBar = React.createClass({
4443
</div>
4544
</div>
4645
<div className="scrollContent">
47-
<DocSearch />
4846
<h4 className="groupTitle">API</h4>
4947
{Seq(type.module)
5048
.flatMap((t, name) => flattenSubmodules(Map(), t, name))

‎pages/src/docs/src/index.js

Copy file name to clipboardExpand all lines: pages/src/docs/src/index.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var React = require('react');
99
var assign = require('react/lib/Object.assign');
1010
var Router = require('react-router');
1111
var DocHeader = require('./DocHeader');
12+
var DocSearch = require('./DocSearch.js');
1213
var TypeDocumentation = require('./TypeDocumentation');
1314
var defs = require('../../../lib/getTypeDefs');
1415

@@ -23,6 +24,7 @@ var Documentation = React.createClass({
2324
<DocHeader />
2425
<div className="pageBody" id="body">
2526
<div className="contents">
27+
<DocSearch />
2628
<RouteHandler />
2729
</div>
2830
</div>

‎pages/src/docs/src/style.less

Copy file name to clipboardExpand all lines: pages/src/docs/src/style.less
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,29 @@
1919
position: relative;
2020
}
2121

22+
.docSearch {
23+
margin-bottom: 32px;
24+
padding: 8px 16px;
25+
border-radius: 20px;
26+
border: solid 1px #eee;
27+
box-shadow: inset 0 1px 1px rgba(0,0,0,0.15);
28+
width: 656px;
29+
position: relative;
30+
left: -16px;
31+
}
32+
33+
.docSearch:focus {
34+
outline: none;
35+
background: #f6f6f6;
36+
border-color: @link-color;
37+
}
38+
39+
@media only screen and (max-width: 680px) {
40+
.docSearch {
41+
width: ~"calc(100vw - 40px)";
42+
}
43+
}
44+
2245
.disclaimer {
2346
margin: 60px 0 0 0;
2447
border: solid 1px #eecccc;

‎pages/src/src/base.less

Copy file name to clipboardExpand all lines: pages/src/src/base.less
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ html, body {
1616
margin: 0;
1717
padding: 0;
1818
-webkit-font-smoothing: antialiased;
19+
}
20+
21+
body, input {
1922
color: @body-color;
2023
font-family: 'Fira Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
2124
font-size: 16px;
2225
line-height: 1.625;
2326
}
2427

2528
@media only screen and (max-width: 680px) {
26-
body {
29+
body, input {
2730
font-size: 14px;
2831
}
2932
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.