Skip to content

Commit a1cb7af

Browse files
committed
Use glamor styles for home page
1 parent 1e6151e commit a1cb7af

File tree

1 file changed

+73
-103
lines changed

1 file changed

+73
-103
lines changed

src/pages/index.js

Lines changed: 73 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -146,36 +146,85 @@ class Home extends Component {
146146

147147
<Container>
148148
<div css={[sharedStyles.markdown, markdownStyles]}>
149-
<section className="home-section">
150-
<div className="marketing-row">
151-
<div className="marketing-col">
152-
<h3>Declarative</h3>
153-
<p>React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes.</p>
154-
<p>Declarative views make your code more predictable and easier to debug.</p>
155-
</div>
156-
<div className="marketing-col">
157-
<h3>Component-Based</h3>
158-
<p>Build encapsulated components that manage their own state, then compose them to make complex UIs.</p>
159-
<p>Since component logic is written in JavaScript instead of templates, you can easily pass rich data through your app and keep state out of the DOM.</p>
160-
</div>
161-
<div className="marketing-col">
162-
<h3>Learn Once, Write Anywhere</h3>
163-
<p>We don't make assumptions about the rest of your technology stack, so you can develop new features in React without rewriting existing code.</p>
164-
<p>React can also render on the server using Node and power mobile apps using <a href="https://facebook.github.io/react-native/">React Native</a>.</p>
165-
</div>
166-
</div>
167-
</section>
168-
<section className="home-section">
169-
<div className="marketing-row">
149+
<section className="home-section" css={{
150+
[media.lessThan('medium')]: {
151+
marginTop: 0,
152+
marginBottom: 0,
153+
overflowX: 'auto',
154+
paddingTop: 30,
155+
WebkitOverflowScrolling: 'touch',
156+
position: 'relative',
157+
maskImage:
158+
'linear-gradient(to right, transparent, white 10px, white 90%, transparent)',
159+
},
160+
}}>
161+
<div css={{
162+
display: 'flex',
163+
flexDirection: 'row',
164+
165+
[media.lessThan('medium')]: {
166+
display: 'block',
167+
whiteSpace: 'nowrap',
168+
},
169+
}}>
170170
{marketingColumns.map((column, index) =>
171-
<div className="marketing-col" key={index}>
172-
<h3>{column.title}</h3>
171+
<div key={index} css={{
172+
display: 'flex',
173+
flexDirection: 'column',
174+
flex: '0 1 33%',
175+
marginLeft: 40,
176+
177+
'&:first-of-type': {
178+
marginLeft: 0,
179+
180+
[media.lessThan('medium')]: {
181+
marginLeft: 10,
182+
},
183+
},
184+
185+
[media.lessThan('medium')]: {
186+
display: 'inline-block',
187+
verticalAlign: 'top',
188+
marginLeft: 0,
189+
whiteSpace: 'normal',
190+
width: '75%',
191+
marginRight: 20,
192+
paddingBottom: 40,
193+
194+
'&:first-of-type': {
195+
marginTop: 0,
196+
},
197+
},
198+
199+
'& p': {
200+
lineHeight: 1.7,
201+
},
202+
}}>
203+
<h3 css={{
204+
'&&': { // Make specificity higher than the site-wide h3 styles.
205+
color: colors.subtle,
206+
marginBottom: 20,
207+
paddingTop: 0,
208+
fontWeight: 300,
209+
fontSize: 20,
210+
211+
[media.greaterThan('xlarge')]: {
212+
fontSize: 24,
213+
fontWeight: 200,
214+
},
215+
},
216+
}}>{column.title}</h3>
173217
<div dangerouslySetInnerHTML={{__html: column.content}} />
174218
</div>
175219
)}
176220
</div>
177221
</section>
178-
<hr className="home-divider" />
222+
<hr css={{
223+
height: 1,
224+
marginBottom: -1,
225+
border: 'none',
226+
borderBottom: `1 solid ${colors.divider}`,
227+
}} />
179228
<section className="home-section">
180229
<div id="examples">
181230
<div className="example">
@@ -333,85 +382,6 @@ const markdownStyles = {
333382
},
334383
},
335384

336-
'& .home-section:first-child': {
337-
[media.lessThan('medium')]: {
338-
marginTop: 0,
339-
marginBottom: 0,
340-
overflowX: 'auto',
341-
paddingTop: 30,
342-
WebkitOverflowScrolling: 'touch',
343-
position: 'relative',
344-
maskImage:
345-
'linear-gradient(to right, transparent, white 10px, white 90%, transparent)',
346-
},
347-
},
348-
349-
'& .homeDivider': {
350-
height: 1,
351-
marginBottom: -1,
352-
border: 'none',
353-
borderBottom: `1 solid ${colors.divider}`,
354-
},
355-
356-
'& .marketing-row': {
357-
display: 'flex',
358-
flexDirection: 'row',
359-
360-
[media.lessThan('medium')]: {
361-
display: 'block',
362-
whiteSpace: 'nowrap',
363-
},
364-
},
365-
366-
'& .marketing-col': {
367-
display: 'flex',
368-
flexDirection: 'column',
369-
flex: '0 1 33%',
370-
marginLeft: 40,
371-
372-
'&:first-of-type': {
373-
marginLeft: 0,
374-
375-
[media.lessThan('medium')]: {
376-
marginLeft: 10,
377-
},
378-
},
379-
380-
[media.lessThan('medium')]: {
381-
display: 'inline-block',
382-
verticalAlign: 'top',
383-
marginLeft: 0,
384-
whiteSpace: 'normal',
385-
width: '75%',
386-
marginRight: 20,
387-
paddingBottom: 40,
388-
389-
'&:first-of-type': {
390-
marginTop: 0,
391-
},
392-
},
393-
394-
'& h3': {
395-
color: colors.subtle,
396-
paddingTop: 0,
397-
fontWeight: 300,
398-
fontSize: 20,
399-
400-
[media.greaterThan('xlarge')]: {
401-
fontSize: 24,
402-
fontWeight: 200,
403-
},
404-
},
405-
406-
'& p': {
407-
lineHeight: 1.7,
408-
},
409-
410-
'& h3 + p': {
411-
marginTop: 20,
412-
},
413-
},
414-
415385
'& .example': {
416386
marginTop: 40,
417387

0 commit comments

Comments
 (0)