diff --git a/css/react-native.css b/css/react-native.css index 861a504fe4d..180661c750e 100644 --- a/css/react-native.css +++ b/css/react-native.css @@ -1,531 +1,778 @@ +/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */ +/* Document + ========================================================================== */ +/** + * 1. Change the default font family in all browsers (opinionated). + * 2. Correct the line height in all browsers. + * 3. Prevent adjustments of font size after orientation changes in + * IE on Windows Phone and in iOS. + */ +html { + font-family: sans-serif; + /* 1 */ + line-height: 1.15; + /* 2 */ + -ms-text-size-adjust: 100%; + /* 3 */ + -webkit-text-size-adjust: 100%; + /* 3 */ } + +/* Sections + ========================================================================== */ +/** + * Remove the margin in all browsers (opinionated). + */ +body { + margin: 0; } + +/** + * Add the correct display in IE 9-. + */ +article, +aside, +footer, +header, +nav, +section { + display: block; } + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ +h1 { + font-size: 2em; + margin: 0.67em 0; } + +/* Grouping content + ========================================================================== */ +/** + * Add the correct display in IE 9-. + * 1. Add the correct display in IE. + */ +figcaption, +figure, +main { + /* 1 */ + display: block; } + +/** + * Add the correct margin in IE 8. + */ +figure { + margin: 1em 40px; } + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ +hr { + box-sizing: content-box; + /* 1 */ + height: 0; + /* 1 */ + overflow: visible; + /* 2 */ } + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ +pre { + font-family: monospace, monospace; + /* 1 */ + font-size: 1em; + /* 2 */ } + +/* Text-level semantics + ========================================================================== */ +/** + * 1. Remove the gray background on active links in IE 10. + * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. + */ +a { + background-color: transparent; + /* 1 */ + -webkit-text-decoration-skip: objects; + /* 2 */ } + +/** + * Remove the outline on focused links when they are also active or hovered + * in all browsers (opinionated). + */ +a:active, +a:hover { + outline-width: 0; } + +/** + * 1. Remove the bottom border in Firefox 39-. + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ +abbr[title] { + border-bottom: none; + /* 1 */ + text-decoration: underline; + /* 2 */ + text-decoration: underline dotted; + /* 2 */ } + +/** + * Prevent the duplicate application of `bolder` by the next rule in Safari 6. + */ +b, +strong { + font-weight: inherit; } + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ +b, +strong { + font-weight: bolder; } + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ +code, +kbd, +samp { + font-family: monospace, monospace; + /* 1 */ + font-size: 1em; + /* 2 */ } + +/** + * Add the correct font style in Android 4.3-. + */ +dfn { + font-style: italic; } + +/** + * Add the correct background and color in IE 9-. + */ +mark { + background-color: #ff0; + color: #000; } + +/** + * Add the correct font size in all browsers. + */ +small { + font-size: 80%; } + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; } + +sub { + bottom: -0.25em; } + +sup { + top: -0.5em; } + +/* Embedded content + ========================================================================== */ +/** + * Add the correct display in IE 9-. + */ +audio, +video { + display: inline-block; } + +/** + * Add the correct display in iOS 4-7. + */ +audio:not([controls]) { + display: none; + height: 0; } + +/** + * Remove the border on images inside links in IE 10-. + */ +img { + border-style: none; } + +/** + * Hide the overflow in IE. + */ +svg:not(:root) { + overflow: hidden; } + +/* Forms + ========================================================================== */ +/** + * 1. Change the font styles in all browsers (opinionated). + * 2. Remove the margin in Firefox and Safari. + */ +button, +input, +optgroup, +select, +textarea { + font-family: sans-serif; + /* 1 */ + font-size: 100%; + /* 1 */ + line-height: 1.15; + /* 1 */ + margin: 0; + /* 2 */ } + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ +button, +input { + /* 1 */ + overflow: visible; } + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ +button, +select { + /* 1 */ + text-transform: none; } + +/** + * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` + * controls in Android 4. + * 2. Correct the inability to style clickable types in iOS and Safari. + */ +button, +html [type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; + /* 2 */ } + +/** + * Remove the inner border and padding in Firefox. + */ +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; } + +/** + * Restore the focus styles unset by the previous rule. + */ +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; } + +/** + * Change the border, margin, and padding in all browsers (opinionated). + */ +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; } + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ +legend { + box-sizing: border-box; + /* 1 */ + color: inherit; + /* 2 */ + display: table; + /* 1 */ + max-width: 100%; + /* 1 */ + padding: 0; + /* 3 */ + white-space: normal; + /* 1 */ } + +/** + * 1. Add the correct display in IE 9-. + * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ +progress { + display: inline-block; + /* 1 */ + vertical-align: baseline; + /* 2 */ } + +/** + * Remove the default vertical scrollbar in IE. + */ +textarea { + overflow: auto; } + +/** + * 1. Add the correct box sizing in IE 10-. + * 2. Remove the padding in IE 10-. + */ +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ } + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; } + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ +[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + outline-offset: -2px; + /* 2 */ } + +/** + * Remove the inner padding and cancel buttons in Chrome and Safari on macOS. + */ +[type="search"]::-webkit-search-cancel-button, +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; } + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ +::-webkit-file-upload-button { + -webkit-appearance: button; + /* 1 */ + font: inherit; + /* 2 */ } + +/* Interactive + ========================================================================== */ +/* + * Add the correct display in IE 9-. + * 1. Add the correct display in Edge, IE, and Firefox. + */ +details, +menu { + display: block; } + +/* + * Add the correct display in all browsers. + */ +summary { + display: list-item; } + +/* Scripting + ========================================================================== */ +/** + * Add the correct display in IE 9-. + */ +canvas { + display: inline-block; } + +/** + * Add the correct display in IE. + */ +template { + display: none; } + +/* Hidden + ========================================================================== */ +/** + * Add the correct display in IE 10-. + */ +[hidden] { + display: none; } + html { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: proxima-nova, "Helvetica Neue", Helvetica, Arial, sans-serif; color: #484848; - line-height: 1.28; -} + line-height: 1.28; } body { - background-color: #F5FCFF; -} + background-color: #F5FCFF; } + +* { + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + -o-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border: none; + margin: 0; + padding: 0; } p { - margin: 0 0 10px; -} + margin: 0 0 16px; + line-height: 1.4; } + +em { + font-style: italic; } + +h1, h2, h3, h4, h5, h6 { + margin: 10px 0; + font-family: inherit; + font-weight: 400; + line-height: 20px; + color: #025268; + text-rendering: optimizelegibility; } + +h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { + font-weight: normal; + color: #7b7b7b; } + +h1, h2, h3, h4 { + line-height: 40px; } + +h1 { + font-size: 39px; } + +h2 { + font-size: 31px; } + +h3 { + font-size: 23px; } + +h4 { + font-size: 17px; } + +h5 { + font-size: 14px; } + +h6 { + font-size: 11px; } + +h1 small { + font-size: 24px; } + +h2 small { + font-size: 18px; } + +h3 small { + font-size: 16px; } + +h4 small { + font-size: 14px; } + +img { + max-width: 100%; + height: auto; } + +ul, ol { + margin: 0 0 10px 25px; + padding: 0; } + +ul ul, ul ol, ol ol, ol ul { + margin-bottom: 0; } + +li { + line-height: 20px; } + +a { + color: #05A5D1; + text-decoration: none; } + +a:hover, a:focus { + color: #047e9f; + text-decoration: underline; } + +a:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; } + +.center { + text-align: center; } + +html * { + color-profile: sRGB; + rendering-intent: auto; } .subHeader { font-size: 21px; font-weight: 300; line-height: 30px; - margin-bottom: 10px; -} - -em { - font-style: italic; -} - -h1, h2, h3, h4, h5, h6 { - margin: 10px 0; - font-family: inherit; - font-weight: bold; - line-height: 20px; - color: inherit; - text-rendering: optimizelegibility; -} - -h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { - font-weight: normal; - color: #7b7b7b; -} - -h1, h2, h3, h4 { - line-height: 40px; -} - -h1 { - font-size: 39px; -} - -h2 { - font-size: 31px; -} - -h3 { - font-size: 23px; -} - -h4 { - font-size: 17px; -} - -h5 { - font-size: 14px; -} - -h6 { - font-size: 11px; -} - -h1 small { - font-size: 24px; -} - -h2 small { - font-size: 18px; -} - -h3 small { - font-size: 16px; -} - -h4 small { - font-size: 14px; -} - -img { - max-width: 100%; - height: auto; -} - -ul, ol { - margin: 0 0 10px 25px; - padding: 0; -} - -ul ul, ul ol, ol ol, ol ul { - margin-bottom: 0; -} - -li { - line-height: 20px; -} - -a { - color: #05A5D1; - text-decoration: none; -} - -a:hover, a:focus { - color: #0485A9; - text-decoration: underline; -} - -a:focus { - outline: thin dotted #333; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} - -.center { - text-align: center; -} - -html * { - color-profile: sRGB; - rendering-intent: auto; -} + margin-bottom: 10px; } .example-container { - position: relative; -} + position: relative; } .embedded-simulator, .embedded-simulator * { - box-sizing: border-box; -} + box-sizing: border-box; } .embedded-simulator p { text-align: center; - color: #999; -} + color: #999; } .embedded-simulator { width: 210px; position: absolute; right: -200px; - top: 0; -} + top: 0; } @media screen and (max-width: 680px) { .embedded-simulator { position: relative; - right: 0; - } -} - -.prism { - white-space: pre-wrap; - font-family: 'source-code-pro', Menlo, 'Courier New', Consolas, monospace; - font-size: 13px; - line-height: 20px; - border-left: 4px solid #05A5D1; - padding: 5px 10px; - background-color: rgba(5, 165, 209, 0.05); - overflow: auto; -} - -.prism + .prism { - margin-top: 10px; -} - -.token.keyword { - color: #1990B8; -} - -.token.string, .token.regex { - color: #2F9C0A; -} - -.token.boolean, .token.number { - color: #C92C2C; -} - -.token.comment { - color: #7D8B99; -} + right: 0; } } .side-by-side { - overflow: hidden; -} + overflow: hidden; } .side-by-side > div { width: 460; margin-left: 0; - float: left; -} - -* { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - border: none; - margin: 0; - padding: 0; -} + float: left; } .left { - float: left; -} + float: left; } .right { - float: right; -} + float: right; } .container { padding-top: 50px; - min-width: 1160px; -} + min-width: 1160px; } .wrap { max-width: 1260px; margin: 0 auto; - padding: 0 20px; -} + padding: 0 20px; } .skinnyWrap { width: 690px; margin-left: auto; margin-right: auto; padding-left: 20px; - padding-right: 20px; -} + padding-right: 20px; } hr { height: 0; border-top: 1px solid #ccc; - border-bottom: 1px solid #eee; -} + border-bottom: 1px solid #eee; } ul, li { - margin-left: 20px; -} + margin-left: 20px; } h1 .anchor, h2 .anchor, h3 .anchor, h4 .anchor, h5 .anchor, h6 .anchor { margin-top: -50px; - position: absolute; -} + position: absolute; } h1:hover .hash-link, h2:hover .hash-link, h3:hover .hash-link, h4:hover .hash-link, h5:hover .hash-link, h6:hover .hash-link { - visibility: visible; -} + visibility: visible; } .hash-link { color: #aaa; - visibility: hidden; -} + visibility: hidden; } .nav-main { *zoom: 1; - background: #3B3738; + background: #222; color: #fafafa; position: fixed; top: 0; min-height: 50px; - box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); width: 100%; z-index: 100; -} + box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); } .nav-main:before, .nav-main:after { content: " "; - display: table; -} + display: table; } .nav-main:after { - clear: both; -} + clear: both; } .nav-main a { color: #e9e9e9; - text-decoration: none; -} + text-decoration: none; } .nav-main .nav-site-wrapper { - display: inline; -} + display: inline; } .nav-main .nav-site-internal { - margin: 0 0 0 20px; -} + margin: 0 0 0 20px; } .nav-main .nav-site-external { float: right; - margin: 0 12px 0 0; -} + margin: 0 12px 0 0; } .nav-main .nav-site li { - margin: 0; -} + margin: 0; } .nav-main .nav-site a { box-sizing: content-box; padding: 0 10px; line-height: 50px; display: inline-block; - height: 50px; - color: #ddd; -} + height: 50px; } -.nav-main .nav-site a:hover { - color: #fff; -} +.nav-site-wrapper a:hover { + color: #fff; } -.nav-main .nav-site a.active { +.nav-site-wrapper a.active { color: #fff; border-bottom: 3px solid #05A5D1; - background: #333; -} + background-color: #2D2D2D; } .nav-main .nav-home { font-size: 24px; - line-height: 50px; -} + font-weight: 300; + line-height: 50px; } .nav-home img { vertical-align: -9px; margin-right: 8px; margin-left: 1px; - width: 34px; -} + width: 34px; } .nav-main a.nav-home { - color: white; -} + color: white; } .nav-main ul { display: inline-block; - vertical-align: top; -} + vertical-align: top; } .nav-main li { - display: inline; -} + display: inline; } .nav-main a.nav-version { font-size: 16px; - font-weight: 800; - color: #05A5D1; + font-weight: 300; margin-left: 8px; - text-decoration: underline; -} + text-decoration: underline; } @media screen and (max-width: 680px) { .nav-main .nav-home { - font-size: 20px; - } - + font-size: 20px; } .nav-main a.nav-version { - font-size: 14px; - } - + font-size: 14px; } .nav-main .nav-site-wrapper { display: block; - overflow: hidden; - } - + overflow: hidden; } .nav-main ul { display: -webkit-flex; display: flex; - overflow: hidden; - } - + overflow: hidden; } .nav-main li { -webkit-flex: 1; - flex: 1; - } - + flex: 1; } .nav-main .nav-site li a { width: 100%; padding: 0; text-align: center; - font-size: 14px; - } - + font-size: 14px; } .nav-main .nav-site a.active { color: #05A5D1; - font-weight: bold; - background-color: transparent; - } - + font-weight: 300; + background-color: transparent; } .nav-main .nav-site-internal { margin: 0; - width: 100%; - } - + width: 100%; } .nav-main .nav-site-external { position: absolute; top: 0; right: 0; - float: none; - } - + float: none; } .nav-main .nav-site-external li a { - padding: 0 6px; - } -} - -.hero { - background: #2D2D2D; - padding: 50px 0; - color: #FDF3E7; - font-weight: 300; -} - -.hero .text { - font-size: 64px; - text-align: center; -} - -.hero .minitext { - font-size: 16px; - text-align: center; - text-transform: uppercase; -} - -.hero strong { - font-weight: 400; -} - -.buttons-unit { - margin-top: 40px; - text-align: center; -} - -.buttons-unit a { - color: #FA6900; -} - -.buttons-unit .button { - font-size: 24px; - background: #05A5D1; - color: #fafafa; -} - -.buttons-unit .button:active { - background: #0485A9; -} - -.buttons-unit.downloads { - margin: 30px 0; -} + padding: 0 6px; } } .nav-docs { font-size: 14px; float: left; width: 210px; - margin: 5px 48px 0 0; -} + margin: 0 48px 0 0; } + .nav-docs ul { + list-style: none; + margin: 0; + margin-left: 1px; } + .nav-docs ul ul { + margin-left: 20px; } + .nav-docs li { + margin: 0; } + .nav-docs a:hover { + text-decoration: none; + color: #025268; } + .nav-docs a.active { + color: #05A5D1; + font-weight: bold; } -.nav-docs ul { - list-style: none; - margin: 0; - margin-left: 1px; -} - -.nav-docs ul ul { - margin-left: 20px; -} - -.nav-docs li { - margin: 0; -} - -.nav-docs h3 { - text-transform: uppercase; - font-size: 14px; -} - -.nav-docs a { - color: #666; - display: block; -} - -.nav-docs a:hover { - text-decoration: none; - color: #0485A9; -} - -.nav-docs a.active { - color: #0485A9; -} - -.nav-docs h3 { - line-height: 25px; - margin-top: 12px; - margin-bottom: 5px; -} - -.nav-docs .nav-docs-section:first-child h3 { - margin-top: 0; -} - -.nav-docs .nav-docs-section:first-child { - padding-top: 0; - border-top: 0; -} - -.nav-docs .nav-docs-section:last-child { - padding-bottom: 0; - border-bottom: 0; -} +.nav-docs-section { + background-color: rgba(59, 55, 56, 0.05); + padding-bottom: 0; } + .nav-docs-section h3 { + color: white; + font-size: 16px; + font-weight: 400; + line-height: 20px; + margin-top: 0; + margin-bottom: 5px; + padding: 10px; + background-color: #222; + text-transform: capitalize; } + .nav-docs-section ul { + display: block; + padding-bottom: 10px; + padding-top: 10px; } + .nav-docs-section a { + color: #025268; + display: block; + margin: 2px 10px 5px; } + .nav-docs-section .nav-docs-section:first-child h3 { + margin-top: 0; } + .nav-docs-section .nav-docs-section:first-child { + padding-top: 0; + border-top: 0; } + .nav-docs-section .nav-docs-section:last-child { + padding-bottom: 0; + border-bottom: 0; } @media only screen and (max-device-width: 1024px) { @-webkit-keyframes slide-in { - 0% { top: -30px; opacity: 0; } - 100% { top: 0; opacity: 1; } - } + 0% { + top: -30px; + opacity: 0; } + 100% { + top: 0; + opacity: 1; } } @-moz-keyframes slide-in { - 0% { top: -30px; opacity: 0; } - 100% { top: 0; opacity: 1; } - } + 0% { + top: -30px; + opacity: 0; } + 100% { + top: 0; + opacity: 1; } } @-o-keyframes slide-in { - 0% { top: -30px; opacity: 0; } - 100% { top: 0; opacity: 1; } - } + 0% { + top: -30px; + opacity: 0; } + 100% { + top: 0; + opacity: 1; } } @keyframes slide-in { - 0% { top: -30px; opacity: 0; } - 100% { top: 0; opacity: 1; } - } - + 0% { + top: -30px; + opacity: 0; } + 100% { + top: 0; + opacity: 1; } } .nav-docs { position: fixed; z-index: 90; @@ -535,405 +782,312 @@ h1:hover .hash-link, h2:hover .hash-link, h3:hover .hash-link, h4:hover .hash-li height: 100%; margin: 0; padding: 53px 0 0 0; - background: #3B3738; - } - + background: #3B3738; } .nav-docs-viewport { - border-top: 1px solid rgb(5, 165, 209); + border-top: 1px solid #05a5d1; padding: 25px; overflow: scroll; -webkit-overflow-scrolling: touch; position: relative; width: 100%; - height: 100%; - } - + height: 100%; } /* Active state */ .nav-docs.in { top: 0; - -webkit-animation: slide-in 0.3s forwards; -moz-animation: slide-in 0.3s forwards; + -ms-animation: slide-in 0.3s forwards; -o-animation: slide-in 0.3s forwards; - animation: slide-in 0.3s forwards; - } - + -webkit-animation: slide-in 0.3s forwards; + animation: slide-in 0.3s forwards; } .nav-docs * { - -webkit-font-smoothing: antialiased; - } - + -webkit-font-smoothing: antialiased; } .nav-docs-section + .nav-docs-section { - margin-top: 50px; - } - + margin-top: 50px; } .nav-docs-section li { - margin: 5px 0; - } - + margin: 5px 0; } .nav-docs-section h3, .nav-docs-section a { - color: white; - } - + color: white; } .nav-docs-section h3 { border-bottom: 1px solid white; margin-bottom: 10px; - opacity: 0.3; - } - + opacity: 0.3; } .nav-docs-section a { margin-right: 25px; font-size: 120%; - padding: 5px 0; - } - + padding: 5px 0; } .nav-docs-section a.active { border-bottom-style: solid; border-bottom-width: 1px; - color: rgb(5, 165, 209); - } -} + color: #05A5D1; } } /** * Multicolumn layout for phone (landscape only) & tablet (regardless its screen orientation)/ */ -@media only screen and (min-device-width : 375px) and (max-device-width : 1024px) { +@media only screen and (min-device-width: 375px) and (max-device-width: 1024px) { .nav-docs-section ul { display: flex; - flex-wrap: wrap; - } - + flex-wrap: wrap; } .nav-docs-section li { - width: 100%; - } -} + width: 100%; } } /* 2 columns layout */ -@media - /*Phone, landscape screen orientation*/ - only screen and (min-device-width : 375px) and (max-device-width : 1024px) and (orientation : landscape), - /*Tablet, portrait screen orientation*/ - only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) { +@media only screen and (min-device-width: 375px) and (max-device-width: 1024px) and (orientation: landscape), only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: portrait) { .nav-docs-section li { - width: 50%; - } -} + width: 50%; } } /* 3 columns layout on tablet (landscape screen orientation) */ -@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { +@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) { .nav-docs-section li { - width: 33%; - } -} + width: 33%; } } .home-section { - margin: 50px 0; -} + margin: 50px 0; } .home-section ol { - margin-left: 0; -} + margin-left: 0; } .home-divider { border-top-color: #bbb; margin: 0 auto; - width: 400px; -} + width: 400px; } .marketing-row { *zoom: 1; - margin: 50px 0; -} + margin: 50px 0; } .marketing-row:before, .marketing-row:after { content: " "; - display: table; -} + display: table; } .marketing-row:after { - clear: both; -} + clear: both; } .marketing-col { float: left; margin-left: 40px; - width: 280px; -} + width: 280px; } .marketing-col h3 { color: #2d2d2d; font-size: 24px; font-weight: normal; - text-transform: uppercase; -} + text-transform: uppercase; } .marketing-col p { - font-size: 16px; -} + font-size: 16px; } .marketing-col:first-child { - margin-left: 0; -} + margin-left: 0; } .tutorial-mock { - text-align: center; -} + text-align: center; } + .tutorial-mock img { border: 1px solid #ccc; - box-shadow: 5px 5px 5px #888888; -} + box-shadow: 5px 5px 5px #888888; } #examples h3, .home-presentation h3 { color: #2d2d2d; font-size: 24px; font-weight: normal; - margin-bottom: 5px; -} + margin-bottom: 5px; } #examples p { margin: 0 0 25px 0; - max-width: 600px; -} + max-width: 600px; } #examples .example { - margin-top: 60px; -} + margin-top: 60px; } #examples #todoExample { - font-size: 14px; -} + font-size: 14px; } #examples #todoExample ul { list-style-type: square; - margin: 0 0 10px 0; -} + margin: 0 0 10px 0; } #examples #todoExample input { border: 1px solid #ccc; - font: 14px proxima-nova, "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; padding: 3px; - width: 150px; -} + width: 150px; } #examples #todoExample button { - font: 14px proxima-nova, "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; margin-left: 5px; - padding: 4px 10px; -} + padding: 4px 10px; } #examples #markdownExample textarea { border: 1px solid #ccc; - font: 14px proxima-nova, "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; margin-bottom: 10px; - padding: 5px; -} + padding: 5px; } -.home-bottom-section { - margin-bottom: 100px; -} +.home-get-started-section { + margin-bottom: 60px; } .docs-nextprev { - *zoom: 1; -} + *zoom: 1; } .docs-nextprev:before, .docs-nextprev:after { content: " "; - display: table; -} + display: table; } .docs-nextprev:after { - clear: both; -} + clear: both; } .docs-prev { - float: left; -} + float: left; } .docs-next { - float: right; -} + float: right; } section.black content { - padding-bottom: 18px; -} + padding-bottom: 18px; } .blogContent { *zoom: 1; - padding-top: 20px; -} + padding-top: 20px; } .blogContent:before, .blogContent:after { content: " "; - display: table; -} + display: table; } .blogContent:after { - clear: both; -} + clear: both; } .blogContent blockquote { padding: 5px 15px; margin: 20px 0; background-color: #f8f5ec; - border-left: 5px solid #f7ebc6; -} + border-left: 5px solid #f7ebc6; } .documentationContent { *zoom: 1; padding-top: 20px; - padding-bottom: 80px; -} + padding-bottom: 80px; } .documentationContent:before, .documentationContent:after { content: " "; - display: table; -} + display: table; } .documentationContent:after { - clear: both; -} + clear: both; } .documentationContent .subHeader { - font-size: 24px; -} + font-size: 24px; } h2 { - margin-top: 30px; -} + margin-top: 30px; } .documentationContent blockquote { padding: 15px 30px 15px 15px; margin: 20px 0; background-color: rgba(248, 245, 236, 0.1); - border-left: 5px solid rgba(191, 87, 73, 0.2); -} + border-left: 5px solid rgba(191, 87, 73, 0.2); } .documentationContent blockquote h4 { - margin-top: 0; -} + margin-top: 0; } .documentationContent blockquote p { - margin-bottom: 0; -} + margin-bottom: 0; } .documentationContent blockquote p:first-child { font-size: 14px; line-height: 20px; margin-top: 0; - text-rendering: optimizelegibility; -} + text-rendering: optimizelegibility; } .docs-prevnext { min-width: 320px; max-width: 640px; margin: 0 auto 40px; - padding-bottom: 20px; -} + padding-bottom: 20px; } .button { - background: -webkit-linear-gradient( #9a9a9a, #646464); - background: linear-gradient( #9a9a9a, #646464); + background: -webkit-linear-gradient(#9a9a9a, #646464); + background: linear-gradient(#9a9a9a, #646464); border-radius: 4px; padding: 8px 16px; font-size: 18px; - font-weight: 400; + font-weight: 300; margin: 0 12px; display: inline-block; color: #fafafa; text-decoration: none; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - text-decoration: none; -} + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } .button:hover { - text-decoration: none; -} + text-decoration: none; } .button:active { - box-shadow: none; -} + box-shadow: none; } .hero .button { - box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.3); -} + box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.3); } .button.blue { - background: -webkit-linear-gradient( #77a3d2, #4783c2); - background: linear-gradient( #77a3d2, #4783c2); -} + background: -webkit-linear-gradient(#77a3d2, #4783c2); + background: linear-gradient(#77a3d2, #4783c2); } .row { - padding-bottom: 4px; -} + padding-bottom: 4px; } .row .span4 { width: 33.33%; - display: table-cell; -} + display: table-cell; } .row .span8 { width: 66.66%; - display: table-cell; -} + display: table-cell; } .row .span6 { width: 50%; - display: table-cell; -} + display: table-cell; } p { - margin: 10px 0; -} + margin: 10px 0; } .highlight { padding: 10px; - margin-bottom: 20px; -} + margin-bottom: 20px; } figure { - text-align: center; -} + text-align: center; } .inner-content { float: left; - width: 650px; -} + width: 650px; } .showcaseSection .inner-content { - width: 800px; -} + width: 800px; } .helpSection .inner-content { - width: 800px; -} + width: 800px; } .nosidebar .inner-content { float: none; - margin: 0 auto; -} + margin: 0 auto; } -.post-list-item+.post-list-item { - margin-top: 60px; -} +.post-list-item + .post-list-item { + margin-top: 60px; } small code, li code, p code { color: #555; background-color: rgba(0, 0, 0, 0.04); - padding: 1px 3px; -} + padding: 1px 3px; } .playground { - *zoom: 1; -} + *zoom: 1; } .playground:before, .playground:after { content: " "; - display: table; -} + display: table; } .playground:after { - clear: both; -} + clear: both; } .playground-tab { border-bottom: none !important; @@ -944,41 +1098,34 @@ small code, li code, p code { color: #c2c0bc; background-color: #f1ede4; display: inline-block; - cursor: pointer; -} + cursor: pointer; } .playgroundCode, .playground-tab, .playgroundPreview { - border: 1px solid rgba(16, 16, 16, 0.1); -} + border: 1px solid rgba(16, 16, 16, 0.1); } .playground-tab-active { - color: #222; -} + color: #222; } .playgroundCode { border-radius: 0 3px 3px 3px; float: left; overflow: hidden; - width: 600px; -} + width: 600px; } .playgroundPreview { background-color: white; border-radius: 3px; float: right; padding: 15px 20px; - width: 280px; -} + width: 280px; } .playgroundError { color: #c5695c; - font-size: 15px; -} + font-size: 15px; } .MarkdownEditor textarea { width: 100%; - height: 100px; -} + height: 100px; } .hll { background-color: #f7ebc6; @@ -986,13 +1133,11 @@ small code, li code, p code { display: block; margin-left: -14px; margin-right: -14px; - padding-left: 9px; -} + padding-left: 9px; } .highlight .javascript .err { background-color: transparent; - color: inherit; -} + color: inherit; } .highlight { position: relative; @@ -1000,22 +1145,19 @@ small code, li code, p code { padding: 30px 14px 14px; border: none; border-radius: 0; - overflow: auto; -} + overflow: auto; } .highlight pre { padding: 0; margin-top: 0; margin-bottom: 0; background-color: transparent; - border: 0; -} + border: 0; } .highlight pre code { background: none; font-size: inherit; - padding: 0; -} + padding: 0; } .highlight pre .lineno { display: inline-block; @@ -1023,8 +1165,7 @@ small code, li code, p code { padding-right: 5px; margin-right: 10px; color: #bebec5; - text-align: right; -} + text-align: right; } .highlight:after { position: absolute; @@ -1036,22 +1177,19 @@ small code, li code, p code { font-weight: bold; color: #c2c0bc; background-color: #f1ede4; - content: "Code"; -} + content: "Code"; } .downloadCenter { text-align: center; margin-top: 20px; - margin-bottom: 25px; -} + margin-bottom: 25px; } .downloadSection:hover { - text-decoration: none !important; -} + text-decoration: none !important; } /* Modal */ .modal-backdrop { - background: rgba(0,0,0,.4); + background: rgba(0, 0, 0, 0.4); display: none; height: 100%; left: 0; @@ -1059,13 +1197,12 @@ small code, li code, p code { position: fixed; top: 0; width: 100%; - z-index: 9900; -} + z-index: 9900; } .modal { background: #F6F6F6; bottom: 0; - box-shadow: 2px 2px 4px 0 rgba(0,0,0,.11); + box-shadow: 2px 2px 4px 0 rgba(0, 0, 0, 0.11); display: none; border-radius: 10px; height: 95%; @@ -1078,28 +1215,27 @@ small code, li code, p code { right: 0; top: 0; width: 80%; - z-index: 9999; -} + z-index: 9999; } -.modal-open { display: block; } +.modal-open { + display: block; } .modal-content { padding: 40px 24px 8px 24px; - position: relative; -} + position: relative; } -.modal-content iframe { margin: 0 auto; } +.modal-content iframe { + margin: 0 auto; } .modal-button-open { cursor: pointer; - text-align: center; -} + text-align: center; } .modal-button-open-img { - height: 358px; -} + height: 358px; } -.modal-button-open-img:hover img { opacity: 0.9; } +.modal-button-open-img:hover img { + opacity: 0.9; } .modal-button-close { background: transparent; @@ -1113,182 +1249,147 @@ small code, li code, p code { padding: 0 12px; position: absolute; right: 0; - top: 0; -} + top: 0; } .modal-button-close:active, .modal-button-close:focus, .modal-button-close:hover { background: #EAF8FD; - outline: none; -} + outline: none; } @media screen and (max-width: 680px) { .container { - padding-top: 100px; - } - + padding-top: 100px; } .nav-docs { - padding-top: 103px; - } -} + padding-top: 103px; } } .post { - margin-bottom: 30px; -} + margin-bottom: 30px; } .pagination { margin-bottom: 30px; width: 100%; - overflow: hidden; -} + overflow: hidden; } .pagination .next { - float: right; -} + float: right; } div[data-twttr-id] iframe { - margin: 10px auto !important; -} + margin: 10px auto !important; } .three-column { - *zoom: 1; -} + *zoom: 1; } .three-column:before, .three-column:after { content: " "; - display: table; -} + display: table; } .three-column:after { - clear: both; -} + clear: both; } -.three-column>ul { +.three-column > ul { float: left; margin-left: 30px; - width: 190px; -} + width: 190px; } .three-column > ul:first-child { - margin-left: 20px; -} + margin-left: 20px; } .home-why { - margin-top: 25px; -} + margin-top: 25px; } .home-why h3 { - text-align: center; -} + text-align: center; } .home-why .blurb { margin-bottom: 20px; - text-align: center; -} + text-align: center; } .home-why .list { margin: 0 auto; - max-width: 460px; -} + max-width: 460px; } .home-getting-started { width: 500px; - margin: 20px auto 40px auto; -} + margin: 20px auto 40px auto; } .home-getting-started h3 { - text-align: center; -} - + text-align: center; } .props { - background-color: hsl(198, 100%, 96%); -} + background-color: #ebf9ff; } .compactProps { - border-left: 2px solid hsl(198, 100%, 94%); + border-left: 2px solid #e0f6ff; margin-left: 20px; - padding-left: 5px; -} + padding-left: 5px; } .props > .prop:nth-child(2n) { - background-color: hsl(198, 100%, 94%); -} + background-color: #e0f6ff; } .propTitle { font-weight: bold; - font-size: 16px; -} + font-size: 16px; } .compactProps .propTitle { font-size: 14px; margin-bottom: 0; - margin-top: 0; -} + margin-top: 0; } .compactProps .propTitle div { font-weight: normal; - margin-left: 20px; -} + margin-left: 20px; } .methodTitle { font-weight: bold; font-size: 24px; - color: #2F9C0A; -} + color: #025268; } .compactProps .methodTitle { font-size: 14px; margin-bottom: 0; - margin-top: 0; -} + margin-top: 0; } .compactProps .methodTitle div { font-weight: normal; - margin-left: 20px; -} + margin-left: 20px; } .prop { - padding: 5px 10px; -} + padding: 5px 10px; } .compactProps .prop { - padding: 3px 10px; -} + padding: 3px 10px; } .propType { + font-family: 'source-code-pro', Menlo, 'Courier New', Consolas, monospace; font-weight: normal; font-size: 15px; - white-space: pre-wrap; -} + white-space: pre-wrap; } .compactProps .propType { font-weight: normal; - font-size: 13px; -} + font-size: 13px; } .methodType { font-weight: normal; - font-size: 24px; -} + font-size: 24px; } .compactProps .methodType { font-weight: normal; - font-size: 13px; -} + font-size: 13px; } .platform { - background-color: hsl(198, 100%, 87%); + background-color: #bdebff; border-radius: 5px; margin-right: 5px; padding: 0 5px; font-size: 13px; font-weight: normal; - -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -} + -o-user-select: none; + -webkit-user-select: none; + user-select: none; } .color { display: inline-block; @@ -1296,8 +1397,7 @@ div[data-twttr-id] iframe { height: 20px; margin-right: 5px; position: relative; - top: 5px; -} + top: 5px; } .color::before { content: ''; @@ -1307,292 +1407,97 @@ div[data-twttr-id] iframe { left: 0; right: 0; bottom: 0; - border: 1px solid rgba(0, 0, 0, 0.2); -} + border: 1px solid rgba(0, 0, 0, 0.2); } .deprecated { - margin-bottom: 24px; -} + margin-bottom: 24px; } .deprecatedTitle { margin-bottom: 6px; line-height: 18px; font-weight: bold; - color: #ffa500; -} + color: #ffa500; } .deprecatedIcon { width: 18px; height: 18px; margin-right: 8px; - vertical-align: top; -} + vertical-align: top; } .deprecatedMessage { - margin-left: 26px; -} + margin-left: 26px; } #content { - display: none; -} + display: none; } - -/** Showcase **/ - -.home-showcase-section { - max-width: 800px; - margin: 20px auto 40px auto; - text-align: center; -} - -.home-showcase-section p { - max-width: 540px; - margin: 0 auto; -} - -.footnote { - font-size: 12px; - color: rgba(0, 0, 0, 0.4); -} - -.home-showcase-section .showcase img { - width: 110px; - border-radius: 20px; -} - -.showcaseHeader { - padding-bottom: 15px; - padding-top: 15px; - text-align: center; -} - -.showcase { - margin: 30px auto 30px auto; - width: 100%; - display: inline-block; - text-align: center; - vertical-align: top; -} - -@media only screen - and (min-device-width: 768px) - and (max-device-width: 1024px) { - .showcase { - width: 50%; - } -} - -@media only screen - and (min-device-width: 1024px) { - .showcase { - width: 25%; - } -} - -.showcase h3 { - margin-bottom: 0px; - line-height: 20px; - padding-left: 5px; - padding-right: 5px; - font-size: 16px; -} - -.showcase p { - margin-top: 5px; - font-weight: normal; -} - -.showcase a { - font-weight: bold; -} - -.showcase h3, .showcase p { - color: rgb(72, 72, 72); -} - -.showcase img { - width: 100px; - border-radius: 20px; -} - -.pinned img { - width: 150px; - border-radius: 20px; -} - -table.versions { - width: 60%; -} +table.versions { + width: 60%; } .versions th { - width: 20%; -} + width: 20%; } .versions td, .versions th { - padding: 2px 5px; -} + padding: 2px 5px; } .versions tr:nth-child(2n+1) { - background-color: hsl(198, 100%, 94%); -} + background-color: #e0f6ff; } -@media only screen - and (max-device-width: 1024px) { +@media only screen and (max-device-width: 1024px) { #content { - display: inline; - } - + display: inline; } .container { min-width: 0; - overflow: auto; - } + overflow: auto; } .wrap { - width: auto; - } + width: auto; } .home-getting-started { - width: auto; - } + width: auto; } .inner-content { width: auto; - float: none; - } + float: none; } .marketing-col { margin-left: 0; float: none; margin-bottom: 30px; - text-align: center; - } + text-align: center; } .home-section, .marketing-row { - margin: 0; - } + margin: 0; } .nav-main .nav-site a { - padding: 0 8px; - } + padding: 0 8px; } .nav-main .nav-home { - margin-left: 8px; - } + margin-left: 8px; } .nav-main .wrap { - padding: 0; - } + padding: 0; } .home-divider { - display: none; - } + display: none; } .hero { - padding: 10px 0 30px 0; - } + padding: 10px 0 30px 0; } .prism { padding: 4px 8px; margin-left: -12px; - font-size: 11px; - } + font-size: 11px; } .nav-docs .nav-docs-section { border: none; - padding: 0; - } + padding: 0; } h1 { font-size: 30px; - line-height: 30px; - } + line-height: 30px; } ol { - margin: 0; - } -} - + margin: 0; } } @media only screen and (max-device-width: 840px) { .showcaseSection .inner-content { - width: 100%; - } - + width: 100%; } .helpSection .inner-content { - width: 100%; - } -} - -/** Algolia Doc Search **/ - - -div.algolia-search-wrapper { - display: inline-block; - vertical-align: top; - margin-left: 15px; -} - -.algolia-autocomplete .aa-dropdown-menu { - margin-left: -210px; - margin-top: -4px; -} - -@media screen and (max-width: 960px) { - div.algolia-search-wrapper { - display: none; - } -} - -input#algolia-doc-search { - background: transparent url('../img/search.png') no-repeat 10px center; - background-size: 16px 16px; - - padding: 0 10px; - padding-left: 35px; - margin-top: 10px; - height: 30px; - font-size: 16px; - line-height: 20px; - background-color: #555; - border-radius: 4px; - color: white; - outline: none; - border: none; - width: 170px; - transition: .5s width ease; - -webkit-transition: .5s width ease; - -moz-transition: .5s width ease; - -o-transition: .5s width ease; -} - -input#algolia-doc-search:focus { - width: 220px; -} - -.algolia-autocomplete { - vertical-align: top; - height: 53px; -} - -.algolia-docsearch-suggestion--category-header { - background-color: #3B3738; -} -.algolia-docsearch-suggestion--highlight { - color: #05A5D1; -} -.algolia-docsearch-suggestion--category-header .algolia-docsearch-suggestion--highlight { - background-color: #05A5D1; -} -.aa-cursor .algolia-docsearch-suggestion--content { - color: #05A5D1; -} -.aa-cursor .algolia-docsearch-suggestion { - background: hsl(198, 100%, 96%); -} -.algolia-docsearch-suggestion { - border-bottom-color: hsl(198, 100%, 94%); -} -.algolia-docsearch-suggestion--subcategory-column { - border-right-color: hsl(198, 100%, 94%); - background-color: hsl(198, 100%, 96%); - color: #3B3738; -} + width: 100%; } } .params, .props { border-spacing: 0; border: 0; - border-collapse: collapse; -} + border-collapse: collapse; } .params .name, .props .name, .name code { - color: #4D4E53; -} + color: #4D4E53; } .params td, .params th, .props td, .props th { border: 1px solid #ddd; @@ -1600,33 +1505,31 @@ input#algolia-doc-search:focus { text-align: left; vertical-align: top; padding: 4px 6px; - display: table-cell; -} + display: table-cell; } .params thead tr, .props thead tr { - background-color: hsl(198, 75%, 88%); - font-weight: bold; -} + background-color: #c9eaf7; + font-weight: bold; } .params .params thead tr, .props .props thead tr { background-color: #fff; - font-weight: bold; -} + font-weight: bold; } -.params th, .props th { border-right: 1px solid #aaa; } -.params thead .last, .props thead .last { border-right: 1px solid #ddd; } +.params th, .props th { + border-right: 1px solid #aaa; } + +.params thead .last, .props thead .last { + border-right: 1px solid #ddd; } .params td.description > div > p:first-child, .props td.description > div > p:first-child { margin-top: 0; - padding-top: 0; -} + padding-top: 0; } .params td.description > p:last-child, .props td.description > p:last-child { margin-bottom: 0; - padding-bottom: 0; -} + padding-bottom: 0; } .edit-page-block { padding: 5px; @@ -1634,73 +1537,311 @@ input#algolia-doc-search:focus { font-size: 12px; color: #887766; text-align: center; + background-color: rgba(5, 165, 209, 0.05); } + +.banner-crna-ejected { + border: 1px solid #05A5D1; + border-radius: 3px; + margin-bottom: 40px; } + .banner-crna-ejected h3 { + font-size: 16px; + margin: 0; + padding: 0 10px; + background-color: #05A5D1; + color: white; } + .banner-crna-ejected p { + padding: 10px; + margin: 2px; + text-decoration: none !important; + background-color: white; } + +.prism { + white-space: pre-wrap; + font-family: 'source-code-pro', Menlo, 'Courier New', Consolas, monospace; + font-size: 13px; + line-height: 20px; + border-left: 4px solid #05A5D1; + padding: 5px 10px; background-color: rgba(5, 165, 209, 0.05); -} + overflow: auto; } + +.prism + .prism { + margin-top: 10px; } + +.token.keyword { + color: #1990B8; } + +.token.string, .token.regex { + color: #2F9C0A; } + +.token.boolean, .token.number { + color: #C92C2C; } + +.token.comment { + color: #7D8B99; } + +/** Algolia Doc Search **/ +div.algolia-search-wrapper { + display: inline-block; + vertical-align: top; + margin-left: 15px; } + +@media screen and (max-width: 960px) { + div.algolia-search-wrapper { + display: none; } } + +input#algolia-doc-search { + background: transparent url("../img/search.png") no-repeat 10px center; + background-size: 16px 16px; + font-family: inherit; + padding: 0 10px; + padding-left: 35px; + margin-top: 10px; + height: 30px; + font-size: 16px; + line-height: 20px; + background-color: #2f2f2f; + border-radius: 4px; + color: inherit; + outline: none; + border: none; + width: 170px; + -moz-transition: 0.5s width ease; + -ms-transition: 0.5s width ease; + -o-transition: 0.5s width ease; + -webkit-transition: 0.5s width ease; + transition: 0.5s width ease; } + +input#algolia-doc-search::placeholder { + color: rgba(255, 255, 255, 0.8); } + +input#algolia-doc-search::-moz-placeholder { + color: rgba(255, 255, 255, 0.8); } + +input#algolia-doc-search:-ms-input-placeholder { + color: rgba(255, 255, 255, 0.8); } + +input#algolia-doc-search::-webkit-input-placeholder { + color: rgba(255, 255, 255, 0.8); } + +input#algolia-doc-search:focus { + width: 220px; } + +.algolia-autocomplete { + vertical-align: top; + height: 53px; } + .algolia-autocomplete .aa-dropdown-menu { + margin-left: -210px; + margin-top: -4px; } + +.algolia-docsearch-suggestion--category-header .algolia-docsearch-suggestion--highlight { + background-color: #05A5D1; } + +.aa-cursor .algolia-docsearch-suggestion--content { + color: #05A5D1; } + +.aa-cursor .algolia-docsearch-suggestion { + background: #ebf9ff; } + +.algolia-docsearch-suggestion { + border-bottom-color: #e0f6ff; } + .algolia-docsearch-suggestion--category-header { + background-color: #3B3738; } + .algolia-docsearch-suggestion--highlight { + color: #05A5D1; } + .algolia-docsearch-suggestion--subcategory-column { + border-right-color: #e0f6ff; + background-color: #ebf9ff; + color: #3B3738; } + +.hero { + background: #2D2D2D; + padding: 50px 0; + color: #FDF3E7; + font-weight: 300; } + +.hero .text { + font-size: 300%; + text-align: center; } + +.hero .minitext { + font-size: 24px; + text-align: center; } + +.buttons-unit { + margin-top: 40px; + text-align: center; } + +.buttons-unit a { + color: #FA6900; } + +.buttons-unit .button { + font-size: 24px; + background: #05A5D1; + color: #fafafa; } + +.buttons-unit .button:active { + background: #0485A9; } + +.buttons-unit.downloads { + margin: 30px 0; } + +/** Showcase **/ +.home-showcase-section { + max-width: 800px; + margin: 20px auto 100px auto; + text-align: center; } + +.home-showcase-section p { + max-width: 540px; + margin: 0 auto; } + +.footnote { + font-size: 12px; + color: rgba(0, 0, 0, 0.4); } + +.home-showcase-section .showcase img { + width: 110px; + border-radius: 20px; } + +.showcaseHeader { + padding-bottom: 15px; + padding-top: 15px; + text-align: center; } + +.showcase { + margin: 30px auto 30px auto; + width: 100%; + display: inline-block; + text-align: center; + vertical-align: top; } + +@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { + .showcase { + width: 50%; } } + +@media only screen and (min-device-width: 1024px) { + .showcase { + width: 25%; } } + +.showcase h3 { + margin-bottom: 0px; + line-height: 20px; + padding-left: 5px; + padding-right: 5px; + font-size: 16px; } + +.showcase p { + margin-top: 5px; } + +.showcase h3, .showcase p { + color: #484848; } + +.showcase img { + width: 100px; + height: 100px; + border-radius: 20px; } + +.pinned img { + width: 150px; + border-radius: 20px; } /** Web player **/ - .web-player > iframe, .web-player > .prism { - display: none; -} + display: none; } .web-player.desktop > iframe { - display: block; -} + display: block; } .web-player.mobile > .prism { - display: block; -} + display: block; } + +/** Help **/ +.helpSection h2 { + font-size: 24px; } + +.help-row { + margin: 50px 0; } + +.help-row:after { + content: ""; + display: table; + clear: both; } + +.help-col { + float: left; } + +.help-col p { + font-size: 16px; } + +.help-col h3 { + color: #2d2d2d; + font-size: 18px; + line-height: 28px; + font-weight: normal; } + +@media (min-width: 600px) { + .help-col { + float: left; + margin-left: 40px; + width: 240px; } + .help-col:first-child { + margin-left: 0; } } + +.help-list { + padding: 0; + list-style: none; + margin: 1.25em 0 1em 0; } + +.entry ul, li { + margin: 0; } + +.help-list .help-list-entry { + padding: 16px 0; + border-top: 1px solid #f1eff0; } /** Blog **/ - .entry-header { - margin: 0; -} + margin: 0; } .entry-header h1 { margin: 0; font-size: 33px; line-height: 36px; -} + line-height: 1; } .entry-header h4 { margin: 0 0 10px; line-height: 16px; font-size: 14px; -} + line-height: 1; } .entry-header .author { color: #5A6b77; - font-weight: 700; -} + font-weight: 700; } .entry-header .date { - color: rgba(102,99,122,.5); -} + color: rgba(102, 99, 122, 0.5); } .entry-readmore { - margin: 12px 0 0; -} + margin: 12px 0 0; } .entry-share { padding: 36px 0; display: block; - text-align: left; -} + text-align: left; } .entry-excerpt { min-width: 320px; max-width: 640px; margin: 0 auto 40px; padding-bottom: 40px; - border-bottom: 1px solid #EDEDED; -} + border-bottom: 1px solid #EDEDED; } .entry-body { min-width: 320px; max-width: 640px; - margin: 0 auto; -} + margin: 0 auto; } .small-title { font-size: 10px; @@ -1708,40 +1849,32 @@ input#algolia-doc-search:focus { letter-spacing: .4rem; text-transform: uppercase; font-weight: 400; - line-height: 12px; -} + line-height: 12px; } .entry-share .small-title { float: left; - width: 50%; -} + width: 50%; } .social-buttons { padding-top: 7px; float: left; - width: 50%; -} + width: 50%; } article { - margin: 0 0 40px 0; - line-height: 1.7; -} + margin: 0 0 40px 0; } article h2 { font-size: 26px; - line-height: 30px; -} + line-height: 1; } article li { - line-height: 28px; -} + line-height: 28px; } .author-info { margin-top: 26px; text-align: center; border-bottom: 1px solid #f1f1f1; - padding-bottom: 20px -} + padding-bottom: 20px; } .the-image { position: relative; @@ -1752,12 +1885,10 @@ article li { border-radius: 50%; background-position: center center; background-color: #fff; - background-size: cover; -} + background-size: cover; } .author-image { - position: relative; -} + position: relative; } .author-image:before { content: ""; @@ -1767,51 +1898,43 @@ article li { height: 1px; top: 50%; left: 0; - background-color: #F1F1F1; -} + background-color: #F1F1F1; } .posted-on { font-size: 12px; - color: rgba(102,99,122,.29); + color: rgba(102, 99, 122, 0.29); margin-bottom: 0; - margin-top: 15px; -} + margin-top: 15px; } .name-title { margin-top: 2px; font-size: 22px; font-weight: 400; margin: 3px 0 5px; - color: #5A6B77; -} + color: #5A6B77; } .name-title a { - color: #5A6B77; -} + color: #5A6B77; } .name-title .title { - color: rgba(102,99,122,.44); -} + color: rgba(102, 99, 122, 0.44); } .btn { - background: 0 0; - color: #05A5D1; - min-width: 0; - border: 1px solid #05A5D1; - display: inline-block; - padding: 9px 18px; - border-radius: 4px; - text-align: center; - font-size: 12px; -} + background: 0 0; + color: #05A5D1; + min-width: 0; + border: 1px solid #05A5D1; + display: inline-block; + padding: 9px 18px; + border-radius: 4px; + text-align: center; + font-size: 12px; } .btn a { - text-decoration: none !important; -} + text-decoration: none !important; } .btn:hover { - text-decoration: none !important; -} + text-decoration: none !important; } .video-container { border-radius: 4px; @@ -1823,79 +1946,17 @@ article li { background-position: center center; position: relative; height: 0; - overflow: hidden; -} + overflow: hidden; } @media (min-width: 760px) { .video-container { - height: 345px; - } -} + height: 345px; } } #mc_embed_signup { - clear:left; - width:100%; -} - -/** Help **/ -.helpSection h2 { - font-size: 24px; -} - -.help-row { - margin: 50px 0; -} - -.help-row:after { - content: ""; - display: table; - clear: both; -} - -.help-col { - float: left; -} - -.help-col p { - font-size: 16px; -} - -.help-col h3 { - color: #2d2d2d; - font-size: 18px; - line-height: 28px; - font-weight: normal; -} - -@media (min-width: 600px) { - .help-col { - float: left; - margin-left: 40px; - width: 240px; - } - - .help-col:first-child { - margin-left: 0; - } -} - -.help-list { - padding: 0; - list-style: none; - margin: 1.25em 0 1em 0; -} - -.entry ul, li { - margin: 0; -} - -.help-list .help-list-entry { - padding: 16px 0; - border-top: 1px solid #f1eff0; -} + clear: left; + width: 100%; } /** Footer **/ - footer.nav-footer { box-sizing: border-box; border: none; @@ -1903,22 +1964,22 @@ footer.nav-footer { color: #202020; font-size: 15px; line-height: 24px; - background: #2D2D2D; - box-shadow: inset 0 10px 10px -5px #0d1116; + background: #012129; + box-shadow: inset 0 10px 10px -5px rgba(0, 0, 0, 0.2); padding-top: 2em; padding-bottom: 2em; -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} + -moz-osx-font-smoothing: grayscale; } + footer .sitemap { display: flex; justify-content: space-between; max-width: 1080px; - margin: 0 auto 1em; -} + margin: 0 auto 1em; } + footer .sitemap div { - flex: 1; -} + flex: 1; } + footer .sitemap .nav-home { display: table; margin: -12px 20px 0 0; @@ -1926,79 +1987,71 @@ footer .sitemap .nav-home { width: 50px; height: 50px; opacity: 0.4; - transition: opacity 0.15s ease-in-out; -} + transition: opacity 0.15s ease-in-out; } + footer .sitemap .nav-home:hover, footer .sitemap .nav-home:focus { - opacity: 1.0; -} + opacity: 1.0; } + @media screen and (max-width: 768px) { footer .sitemap { - display: none; - } - + display: none; } footer .newsletter { - display: none; - } - + display: none; } #mc_embed_signup { - display: none; - } -} + display: none; } } footer .sitemap a { color: white; display: table; margin: 2px -10px; - padding: 3px 10px; -} + padding: 3px 10px; } + footer .sitemap a:hover, footer .sitemap a:focus { color: #05A5D1; - text-decoration: none; -} + text-decoration: none; } + footer .sitemap h5 > a:hover, footer .sitemap h5 > a:focus { color: white; - text-decoration: none; -} + text-decoration: none; } + footer .sitemap h5, footer .sitemap h6 { - margin: 0 0 10px; -} + margin: 0 0 10px; } + footer .sitemap h5, footer .sitemap h6, footer .sitemap h5 > a, footer .sitemap h6 > a { color: #05A5D1; -} + font-weight: 900; } + footer .sitemap h5 > a, footer .sitemap h6 > a { - margin: 0 -10px; -} + margin: 0 -10px; } + footer .fbOpenSource { display: block; margin: 1em auto; opacity: 0.4; transition: opacity 0.15s ease-in-out; - width: 170px; -} + width: 170px; } + footer .fbOpenSource:hover { - opacity: 1.0; -} + opacity: 1.0; } + footer .copyright { color: rgba(255, 255, 255, 0.4); - text-align: center; -} + text-align: center; } footer .newsletter { display: flex; justify-content: space-between; max-width: 640px; - margin: 0 auto 1em; -} + margin: 0 auto 1em; } footer .newsletter h5 { color: #05A5D1; - margin: 0 0 10px; -} + margin: 0 0 10px; } diff --git a/docs/accessibility.html b/docs/accessibility.html index 0a60db36506..0ea85cef8ed 100644 --- a/docs/accessibility.html +++ b/docs/accessibility.html @@ -1,4 +1,4 @@ -
Both iOS and Android provide APIs for making apps accessible to people with disabilities. In addition, both platforms provide bundled assistive technologies, like the screen readers VoiceOver (iOS) and TalkBack (Android) for the visually impaired. Similarly, in React Native we have included APIs designed to provide developers with support for making apps more accessible. Take note, iOS and Android differ slightly in their approaches, and thus the React Native implementations may vary by platform.
When true, indicates that the view is an accessibility element. When a view is an accessibility element, it groups its children into a single selectable component. By default, all touchable elements are accessible.
On Android, ‘accessible={true}’ property for a react-native View will be translated into native ‘focusable={true}’.
Both iOS and Android provide APIs for making apps accessible to people with disabilities. In addition, both platforms provide bundled assistive technologies, like the screen readers VoiceOver (iOS) and TalkBack (Android) for the visually impaired. Similarly, in React Native we have included APIs designed to provide developers with support for making apps more accessible. Take note, iOS and Android differ slightly in their approaches, and thus the React Native implementations may vary by platform.
When true, indicates that the view is an accessibility element. When a view is an accessibility element, it groups its children into a single selectable component. By default, all touchable elements are accessible.
On Android, ‘accessible={true}’ property for a react-native View will be translated into native ‘focusable={true}’.
In the above example, we can't get accessibility focus separately on 'text one' and 'text two'. Instead we get focus on a parent view with 'accessible' property.
When a view is marked as accessible, it is a good practice to set an accessibilityLabel on the view, so that people who use VoiceOver know what element they have selected. VoiceOver will read this string when a user selects the associated element.
To use, set the accessibilityLabel property to a custom string on your View:
In the above example we've created a custom radio button that now behaves like a native one. More specifically, TalkBack now correctly announces changes to the radio button selection.
To enable VoiceOver, go to the Settings app on your iOS device. Tap General, then Accessibility. There you will find many tools that people use to use to make their devices more usable, such as bolder text, increased contrast, and VoiceOver.
To enable VoiceOver, tap on VoiceOver under "Vision" and toggle the switch that appears at the top.
At the very bottom of the Accessibility settings, there is an "Accessibility Shortcut". You can use this to toggle VoiceOver by triple clicking the Home button.
You can edit the content above on GitHub and send us a pull request!
Display an iOS action sheet. The options object must contain one or more
+
Display an iOS action sheet. The options object must contain one or more
of:
options (array of strings) - a list of button titles (required)cancelButtonIndex (int) - index of cancel button in optionsdestructiveButtonIndex (int) - index of destructive button in optionstitle (string) - a title to show above the action sheetmessage (string) - a message to show below the titleDisplay the iOS share sheet. The options object should contain
one or both of message and url and can additionally have
a subject or excludedActivityTypes:
url (string) - a URL to sharemessage (string) - a message to sharesubject (string) - a subject for the messageexcludedActivityTypes (array) - the activities to exclude from the ActionSheetNOTE: if url points to a local file, or is a base64-encoded
@@ -204,7 +204,7 @@ exports.examples return <ShareScreenshotExample />;
}
}
-];
Displays a circular loading indicator.
Whether to show the indicator (true, the default) or hide it (false).
Size of the indicator (default is 'small'). -Passing a number to the size prop is only supported on Android.
Whether the indicator should hide when not animating (true by default).
You can edit the content above on GitHub and send us a pull request!
Examples # | Edit on GitHub |
Displays a circular loading indicator.
Whether to show the indicator (true, the default) or hide it (false).
Size of the indicator (default is 'small'). +Passing a number to the size prop is only supported on Android.
Whether the indicator should hide when not animating (true by default).
You can edit the content above on GitHub and send us a pull request!
Examples # | Edit on GitHub |
You can edit the content above on GitHub and send us a pull request!
Examples # | Edit on GitHub |
You can edit the content above on GitHub and send us a pull request!
Examples # | Edit on GitHub |
Launches an alert dialog with the specified title and message.
Optionally provide a list of buttons. Tapping any button will fire the +
Launches an alert dialog with the specified title and message.
Optionally provide a list of buttons. Tapping any button will fire the respective onPress callback and dismiss the alert. By default, the only button will be an 'OK' button.
This is an API that works both on iOS and Android and can show static alerts. To show an alert that prompts the user to enter some information, @@ -151,7 +151,7 @@ class AlertExample extends .exports = { AlertExample, SimpleAlertExampleBlock, -};
AlertIOS provides functionality to create an iOS alert dialog with a
+
AlertIOS provides functionality to create an iOS alert dialog with a
message or create a prompt for user input.
Creating an iOS alert:
Creating an iOS alert:
We recommend using the Alert.alert method for
-cross-platform support if you don't need to create iOS-only prompts.
Create and display a popup alert.
| Name and Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| title string | The dialog's title. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [message] string | An optional message that appears below +cross-platform support if you don't need to create iOS-only prompts. Methods #static alert(title: string, message?: string, callbackOrButtons?: ?(() => void), ButtonsArray, type?: AlertType) #Create and display a popup alert. Parameters:
'use strict';
+when using the minDate and maxDate options.static dateSetAction() #A date has been selected. static dismissedAction() #The dialog has been dismissed. You can edit the content above on GitHub and send us a pull request!
'use strict';
var React = require('react');
var ReactNative = require('react-native');
@@ -144,7 +144,7 @@ class DatePickerAndroidExample extends DatePickerIOS #Use DatePickerIOS #Use Props #date Date #The currently selected date. maximumDate Date #Maximum date. Restricts the range of possible date/time values. minimumDate Date #Minimum date. Restricts the range of possible date/time values. minuteInterval enum(1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30) #The interval at which minutes can be selected. mode enum('date', 'time', 'datetime') #The date picker mode. onDateChange function #Date change handler. This is called when the user changes the date or time in the UI. +source of truth. Props #date: Date #The currently selected date. maximumDate?: Date #Maximum date. Restricts the range of possible date/time values. minimumDate?: Date #Minimum date. Restricts the range of possible date/time values. minuteInterval?: enum(1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30) #The interval at which minutes can be selected. mode?: enum('date', 'time', 'datetime') #The date picker mode. onDateChange: function #Date change handler. This is called when the user changes the date or time in the UI. The first and only argument is a Date object representing the new -date and time. timeZoneOffsetInMinutes number #Timezone offset in minutes. By default, the date picker will use the device's timezone. With this +date and time. timeZoneOffsetInMinutes?: number #Timezone offset in minutes. By default, the date picker will use the device's timezone. With this parameter, it is possible to force a certain timezone offset. For instance, to show times in Pacific Standard Time, pass -7 * 60. You can edit the content above on GitHub and send us a pull request!
'use strict';
@@ -155,7 +155,7 @@ exports.examples : '500',
fontSize: 14,
},
-}); Debugging #Accessing the In-App Developer Menu #You can access the developer menu by shaking your device or by selecting "Shake Gesture" inside the Hardware menu in the iOS Simulator. You can also use the
Reloading JavaScript #Instead of recompiling your app every time you make a change, you can reload your app's JavaScript code instantly. To do so, select "Reload" from the Developer Menu. You can also press
Automatic reloading #You can speed up your development times by having your app reload automatically any time your code changes. Automatic reloading can be enabled by selecting "Enable Live Reload" from the Developer Menu. You may even go a step further and keep your app running as new versions of your files are injected into the JavaScript bundle automatically by enabling Hot Reloading from the Developer Menu. This will allow you to persist the app's state through reloads.
You will need to rebuild your app for changes to take effect in certain situations:
In-app Errors and Warnings #Errors and warnings are displayed inside your app in development builds. Errors #In-app errors are displayed in a full screen alert with a red background inside your app. This screen is known as a RedBox. You can use Warnings #Warnings will be displayed on screen with a yellow background. These alerts are known as YellowBoxes. Click on the alerts to show more information or to dismiss them. As with a RedBox, you can use YellowBoxes can be disabled during development by using In CI/Xcode, YellowBoxes can also be disabled by setting the
Accessing console logs #You can display the console logs for an iOS or Android app by using the following commands in a terminal while the app is running: $ react-native log-ios
+ Debugging #Accessing the In-App Developer Menu #You can access the developer menu by shaking your device or by selecting "Shake Gesture" inside the Hardware menu in the iOS Simulator. You can also use the
Reloading JavaScript #Instead of recompiling your app every time you make a change, you can reload your app's JavaScript code instantly. To do so, select "Reload" from the Developer Menu. You can also press
Automatic reloading #You can speed up your development times by having your app reload automatically any time your code changes. Automatic reloading can be enabled by selecting "Enable Live Reload" from the Developer Menu. You may even go a step further and keep your app running as new versions of your files are injected into the JavaScript bundle automatically by enabling Hot Reloading from the Developer Menu. This will allow you to persist the app's state through reloads.
You will need to rebuild your app for changes to take effect in certain situations:
In-app Errors and Warnings #Errors and warnings are displayed inside your app in development builds. Errors #In-app errors are displayed in a full screen alert with a red background inside your app. This screen is known as a RedBox. You can use Warnings #Warnings will be displayed on screen with a yellow background. These alerts are known as YellowBoxes. Click on the alerts to show more information or to dismiss them. As with a RedBox, you can use YellowBoxes can be disabled during development by using In CI/Xcode, YellowBoxes can also be disabled by setting the
Accessing console logs #You can display the console logs for an iOS or Android app by using the following commands in a terminal while the app is running: $ react-native log-ios
$ react-native log-android You may also access these through Chrome Developer Tools #To debug the JavaScript code in Chrome, select "Debug JS Remotely" from the Developer Menu. This will open a new tab at http://localhost:8081/debugger-ui. Select
Debugging on a device with Chrome Developer Tools #On iOS devices, open the file On Android 5.0+ devices connected via USB, you can use the
Alternatively, select "Dev Settings" from the Developer Menu, then update the "Debug server host for device" setting to match the IP address of your computer.
Debugging using a custom JavaScript debugger #To use a custom JavaScript debugger in place of Chrome Developer Tools, set the The debugger will receive a list of all project roots, separated by a space. For example, if you set
Debugging with Stetho on Android #
Debugging native code #When working with native code (e.g. when writing native modules) you can launch the app from Android Studio or Xcode and take advantage of the debugging features (setup breakpoints, etc.) as you would in case of building a standard native app. Performance Monitor #You can enable a performance overlay to help you debug performance problems by selecting "Perf Monitor" in the Developer Menu. You can edit the content above on GitHub and send us a pull request! Dimensions #Methods #static set(dims) #This should only be called from native code by sending the + Dimensions #Methods #static set(dims) #This should only be called from native code by sending the didUpdateDimensions event. @param {object} dims Simple string-keyed object of dimensions to set static get(dim) #Initial dimensions are set before Note: Although dimensions are available immediately, they may change (e.g
due to device rotation) so any rendering logic or styles that depend on
these constants should try to call this function on every render, rather
than caching the value (for example, using inline styles rather than
setting a value in a Example: @param {string} dim Name of dimension as defined when calling You can edit the content above on GitHub and send us a pull request! Direct Manipulation #It is sometimes necessary to make changes directly to a component + Direct Manipulation #It is sometimes necessary to make changes directly to a component
without using state/props to trigger a re-render of the entire subtree.
When using React in the browser for example, you sometimes need to
directly modify a DOM node, and the same is true for views in mobile
@@ -136,7 +136,7 @@ the jerky animation each 250ms when You can edit the content above on GitHub and send us a pull request! DrawerLayoutAndroid #React component that wraps the platform DrawerLayoutAndroid #React component that wraps the platform Example: /View>
</DrawerLayoutAndroid>
);
-}, Props #drawerBackgroundColor color #Specifies the background color of the drawer. The default value is white. +}, Props #drawerBackgroundColor?: color #Specifies the background color of the drawer. The default value is white. If you want to set the opacity of the drawer, use rgba. Example: return (
<DrawerLayoutAndroid drawerBackgroundColor="rgba(0,0,0,0.5)">
</DrawerLayoutAndroid>
-); drawerLockMode enum('unlocked', 'locked-closed', 'locked-open') #Specifies the lock mode of the drawer. The drawer can be locked in 3 states: +); drawerLockMode?: enum('unlocked', 'locked-closed', 'locked-open') #Specifies the lock mode of the drawer. The drawer can be locked in 3 states:
- unlocked (default), meaning that the drawer will respond (open/close) to touch gestures.
- locked-closed, meaning that the drawer will stay closed and not respond to gestures.
- locked-open, meaning that the drawer will stay opened and not respond to gestures.
-The drawer may still be opened and closed programmatically ( drawerPosition enum(DrawerConsts.DrawerPosition.Left, DrawerConsts.DrawerPosition.Right) #Specifies the side of the screen from which the drawer will slide in. drawerWidth number #Specifies the width of the drawer, more precisely the width of the view that be pulled in -from the edge of the window. keyboardDismissMode enum('none', 'on-drag') #Determines whether the keyboard gets dismissed in response to a drag.
+The drawer may still be opened and closed programmatically ( drawerPosition?: enum(DrawerConsts.DrawerPosition.Left, DrawerConsts.DrawerPosition.Right) #Specifies the side of the screen from which the drawer will slide in. drawerWidth?: number #Specifies the width of the drawer, more precisely the width of the view that be pulled in +from the edge of the window. keyboardDismissMode?: enum('none', 'on-drag') #Determines whether the keyboard gets dismissed in response to a drag. - 'none' (the default), drags do not dismiss the keyboard. - - 'on-drag', the keyboard is dismissed when a drag begins. onDrawerClose function #Function called whenever the navigation view has been closed. onDrawerOpen function #Function called whenever the navigation view has been opened. onDrawerSlide function #Function called whenever there is an interaction with the navigation view. onDrawerStateChanged function #Function called when the drawer state has changed. The drawer can be in 3 states: + - 'on-drag', the keyboard is dismissed when a drag begins. onDrawerClose?: function #Function called whenever the navigation view has been closed. onDrawerOpen?: function #Function called whenever the navigation view has been opened. onDrawerSlide?: function #Function called whenever there is an interaction with the navigation view. onDrawerStateChanged?: function #Function called when the drawer state has changed. The drawer can be in 3 states: - idle, meaning there is no interaction with the navigation view happening at the time - dragging, meaning there is currently an interaction with the navigation view - settling, meaning that there was an interaction with the navigation view, and the -navigation view is now finishing its closing or opening animation renderNavigationView function #The navigation view that will be rendered to the side of the screen and can be pulled in. statusBarBackgroundColor color #Make the drawer take the entire screen and draw the background of the +navigation view is now finishing its closing or opening animation renderNavigationView: function #The navigation view that will be rendered to the side of the screen and can be pulled in. Methods #You can edit the content above on GitHub and send us a pull request! Easing #This class implements common easing functions. The math is pretty obscure, + Easing #This class implements common easing functions. The math is pretty obscure, but this cool website has nice visual illustrations of what they represent: http://xaedes.de/dev/transitions/ Methods #static step0(n) #static step1(n) #static linear(t) #static ease(t) #static quad(t) #static cubic(t) #static poly(n) #static sin(t) #static circle(t) #static exp(t) #static elastic(bounciness) #A simple elastic interaction, similar to a spring. Default bounciness is 1, which overshoots a little bit once. 0 bounciness doesn't overshoot at all, and bounciness of N > 1 will overshoot about N times. Wolfram Plots: http://tiny.cc/elastic_b_1 (default bounciness = 1) - http://tiny.cc/elastic_b_3 (bounciness = 3) static back(s) #static bounce(t) #static bezier(x1, y1, x2, y2) #static in(easing) #static out(easing) #Runs an easing function backwards. static inOut(easing) #Makes any easing function symmetrical. You can edit the content above on GitHub and send us a pull request! Layout with Flexbox #A component can specify the layout of its children using the flexbox algorithm. Flexbox is designed to provide a consistent layout on different screen sizes. You will normally use a combination of
Flex Direction #Adding import React, { Component } from 'react';
+ Layout with Flexbox #A component can specify the layout of its children using the flexbox algorithm. Flexbox is designed to provide a consistent layout on different screen sizes. You will normally use a combination of
Flex Direction #Adding import React, { Component } from 'react';
import { AppRegistry, View } from 'react-native';
class FlexDirectionBasics extends Component {
@@ -58,7 +58,7 @@ class AlignItemsBasics extends }
};
-AppRegistry.registerComponent('AwesomeProject', () => AlignItemsBasics); Going Deeper #We've covered the basics, but there are many other styles you may need for layouts. The full list of props that control layout is documented here. We're getting close to being able to build a real application. One thing we are still missing is a way to take user input, so let's move on to learn how to handle text input with the TextInput component. You can edit the content above on GitHub and send us a pull request! Geolocation #The Geolocation API extends the web spec: + Geolocation #The Geolocation API extends the web spec: https://developer.mozilla.org/en-US/docs/Web/API/Geolocation As a browser polyfill, this API is available through the iOS #You need to include the
|
Examples # | Edit on GitHub |
You can edit the content above on GitHub and send us a pull request!
Examples # | Edit on GitHub |
The gesture responder system manages the lifecycle of gestures in your app. A touch can go through several phases as the app determines what the user's intention is. For example, the app needs to determine if the touch is scrolling, sliding on a widget, or tapping. This can even change during the duration of a touch. There can also be multiple simultaneous touches.
The touch responder system is needed to allow components to negotiate these touch interactions without any additional knowledge about their parent or child components. This system is implemented in ResponderEventPlugin.js, which contains further details and documentation.
To make your app feel great, every action should have the following attributes:
These features make users more comfortable while using an app, because it allows people to experiment and interact without fear of making mistakes.
The responder system can be complicated to use. So we have provided an abstract Touchable implementation for things that should be "tappable". This uses the responder system and allows you to easily configure tap interactions declaratively. Use TouchableHighlight anywhere where you would use a button or link on web.
A view can become the touch responder by implementing the correct negotiation methods. There are two methods to ask the view if it wants to become responder:
View.props.onStartShouldSetResponder: (evt) => true, - Does this view want to become responder on the start of a touch?View.props.onMoveShouldSetResponder: (evt) => true, - Called for every touch move on the View when it is not the responder: does this view want to "claim" touch responsiveness?If the View returns true and attempts to become the responder, one of the following will happen:
View.props.onResponderGrant: (evt) => {} - The View is now responding for touch events. This is the time to highlight and show the user what is happeningView.props.onResponderReject: (evt) => {} - Something else is the responder right now and will not release itIf the view is responding, the following handlers can be called:
View.props.onResponderMove: (evt) => {} - The user is moving their fingerView.props.onResponderRelease: (evt) => {} - Fired at the end of the touch, ie "touchUp"View.props.onResponderTerminationRequest: (evt) => true - Something else wants to become responder. Should this view release the responder? Returning true allows releaseView.props.onResponderTerminate: (evt) => {} - The responder has been taken from the View. Might be taken by other views after a call to onResponderTerminationRequest, or might be taken by the OS without asking (happens with control center/ notification center on iOS)evt is a synthetic touch event with the following form:
nativeEventchangedTouches - Array of all touch events that have changed since the last eventidentifier - The ID of the touchlocationX - The X position of the touch, relative to the elementlocationY - The Y position of the touch, relative to the elementpageX - The X position of the touch, relative to the root elementpageY - The Y position of the touch, relative to the root elementtarget - The node id of the element receiving the touch eventtimestamp - A time identifier for the touch, useful for velocity calculationtouches - Array of all current touches on the screenonStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern, where the deepest node is called first. That means that the deepest component will become responder when multiple Views return true for *ShouldSetResponder handlers. This is desirable in most cases, because it makes sure all controls and buttons are usable.
However, sometimes a parent will want to make sure that it becomes responder. This can be handled by using the capture phase. Before the responder system bubbles up from the deepest component, it will do a capture phase, firing on*ShouldSetResponderCapture. So if a parent View wants to prevent the child from becoming responder on a touch start, it should have a onStartShouldSetResponderCapture handler which returns true.
View.props.onStartShouldSetResponderCapture: (evt) => true,View.props.onMoveShouldSetResponderCapture: (evt) => true,For higher-level gesture interpretation, check out PanResponder.
You can edit the content above on GitHub and send us a pull request!
The gesture responder system manages the lifecycle of gestures in your app. A touch can go through several phases as the app determines what the user's intention is. For example, the app needs to determine if the touch is scrolling, sliding on a widget, or tapping. This can even change during the duration of a touch. There can also be multiple simultaneous touches.
The touch responder system is needed to allow components to negotiate these touch interactions without any additional knowledge about their parent or child components. This system is implemented in ResponderEventPlugin.js, which contains further details and documentation.
To make your app feel great, every action should have the following attributes:
These features make users more comfortable while using an app, because it allows people to experiment and interact without fear of making mistakes.
The responder system can be complicated to use. So we have provided an abstract Touchable implementation for things that should be "tappable". This uses the responder system and allows you to easily configure tap interactions declaratively. Use TouchableHighlight anywhere where you would use a button or link on web.
A view can become the touch responder by implementing the correct negotiation methods. There are two methods to ask the view if it wants to become responder:
View.props.onStartShouldSetResponder: (evt) => true, - Does this view want to become responder on the start of a touch?View.props.onMoveShouldSetResponder: (evt) => true, - Called for every touch move on the View when it is not the responder: does this view want to "claim" touch responsiveness?If the View returns true and attempts to become the responder, one of the following will happen:
View.props.onResponderGrant: (evt) => {} - The View is now responding for touch events. This is the time to highlight and show the user what is happeningView.props.onResponderReject: (evt) => {} - Something else is the responder right now and will not release itIf the view is responding, the following handlers can be called:
View.props.onResponderMove: (evt) => {} - The user is moving their fingerView.props.onResponderRelease: (evt) => {} - Fired at the end of the touch, ie "touchUp"View.props.onResponderTerminationRequest: (evt) => true - Something else wants to become responder. Should this view release the responder? Returning true allows releaseView.props.onResponderTerminate: (evt) => {} - The responder has been taken from the View. Might be taken by other views after a call to onResponderTerminationRequest, or might be taken by the OS without asking (happens with control center/ notification center on iOS)evt is a synthetic touch event with the following form:
nativeEventchangedTouches - Array of all touch events that have changed since the last eventidentifier - The ID of the touchlocationX - The X position of the touch, relative to the elementlocationY - The Y position of the touch, relative to the elementpageX - The X position of the touch, relative to the root elementpageY - The Y position of the touch, relative to the root elementtarget - The node id of the element receiving the touch eventtimestamp - A time identifier for the touch, useful for velocity calculationtouches - Array of all current touches on the screenonStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern, where the deepest node is called first. That means that the deepest component will become responder when multiple Views return true for *ShouldSetResponder handlers. This is desirable in most cases, because it makes sure all controls and buttons are usable.
However, sometimes a parent will want to make sure that it becomes responder. This can be handled by using the capture phase. Before the responder system bubbles up from the deepest component, it will do a capture phase, firing on*ShouldSetResponderCapture. So if a parent View wants to prevent the child from becoming responder on a touch start, it should have a onStartShouldSetResponderCapture handler which returns true.
View.props.onStartShouldSetResponderCapture: (evt) => true,View.props.onMoveShouldSetResponderCapture: (evt) => true,For higher-level gesture interpretation, check out PanResponder.
You can edit the content above on GitHub and send us a pull request!
Welcome to React Native! This page will help you install React Native on +
Welcome to React Native! This page will help you install React Native on your system, so that you can build apps with it right away. If you already have React Native installed, you can skip ahead to the Tutorial.
The instructions are a bit different depending on your development operating system, and whether you want to start developing for iOS or Android. If you @@ -214,7 +214,7 @@ if (!foundHash) { display('platform', isMac ? 'ios' : 'android'); } -
You can edit the content above on GitHub and send us a pull request!
TextInput is a basic component that allows the user to enter text. It has an onChangeText prop that takes
+
TextInput is a basic component that allows the user to enter text. It has an onChangeText prop that takes
a function to be called every time the text changed, and an onSubmitEditing prop that takes a function to be called when the text is submitted.
For example, let's say that as the user types, you're translating their words into a different language. In this new language, every single word is written the same way: 🍕. So the sentence "Hello there Bob" would be translated as "🍕🍕🍕".
In this example, we store text in the state, because it changes over time.
There are a lot more things you might want to do with a text input. For example, you could validate the text inside while the user types. For more detailed examples, see the React docs on controlled components, or the reference docs for TextInput.
Text input is probably the simplest example of a component whose state naturally changes over time. Next, let's look at another type of component like this one that controls layout, and learn about the ScrollView.
You can edit the content above on GitHub and send us a pull request!
Users interact with mobile apps mainly through touch. They can use a combination of gestures, such as tapping on a button, scrolling a list, or zooming on a map.
React Native provides components to handle common gestures, such as taps and swipes, as well as a comprehensive gesture responder system to allow for more advanced gesture recognition.
You can use "Touchable" components when you want to capture a tapping gesture. They take a function through the onPress props which will be called when the touch begins and ends within the bounds of the component.
Example:
Users interact with mobile apps mainly through touch. They can use a combination of gestures, such as tapping on a button, scrolling a list, or zooming on a map.
React Native provides components to handle common gestures, such as taps and swipes, as well as a comprehensive gesture responder system to allow for more advanced gesture recognition.
You can use "Touchable" components when you want to capture a tapping gesture. They take a function through the onPress props which will be called when the touch begins and ends within the bounds of the component.
Example:
Tappable components should provide feedback that show the user what is handling their touch, and what will happen when they lift their finger. The user should also be able to cancel a tap by dragging their finger away.
Which component you use will depend on what kind of feedback you want to provide:
Generally, you can use TouchableHighlight anywhere you would use a button or link on web. The view's background will be darkened when the user presses down on the button.
You may consider using TouchableNativeFeedback on Android to display ink surface reaction ripples that respond to the user's touch.
TouchableOpacity can be used to provide feedback by reducing the opacity of the button, allowing the background to be seen through while the user is pressing down.
If you need to handle a tap gesture but you don't want any feedback to be displayed, use TouchableWithoutFeedback.
In some cases, you may want to detect when a user presses and holds a view for a set amount of time. These long presses can be handled by passing a function to the onLongPress props of any of the touchable components listed above.
A common pattern to many mobile apps is the scrollable list of items. Users interact with these using panning or swiping gestures. The ScrollView component displays a list of items that can be scrolled using these gestures.
ScrollViews can scroll vertically or horizontally, and can be configured to allow paging through views using swiping gestures by using the pagingEnabled props. Swiping horizontally between views can also be implemented on Android using the ViewPagerAndroid component.
A ListView is a special kind of ScrollView that is best suited for displaying long vertical lists of items. It can also display section headers and footers, similar to UITableViews on iOS.
A ScrollView with a single item can be used to allow the user to zoom content. Set up the maximumZoomScale and minimumZoomScale props and your user will be able to use pinch and expand gestures to zoom in and out.
If you want to allow a user to drag a view around the screen, or you want to implement your own custom pan/drag gesture, take a look at the PanResponder API or the gesture responder system docs.
You can edit the content above on GitHub and send us a pull request!
Headless JS is a way to run tasks in JavaScript while your app is in the background. It can be used, for example, to sync fresh data, handle push notifications, or play music.
A task is a simple async function that you register on AppRegistry, similar to registering React applications:
Then, in SomeTaskName.js:
Headless JS is a way to run tasks in JavaScript while your app is in the background. It can be used, for example, to sync fresh data, handle push notifications, or play music.
A task is a simple async function that you register on AppRegistry, similar to registering React applications:
Then, in SomeTaskName.js:
You can do anything in your task as long as it doesn't touch UI: network requests, timers and so on. Once your task completes (i.e. the promise is resolved), React Native will go into "paused" mode (unless there are other tasks running, or there is a foreground app).
Yes, this does still require some native code, but it's pretty thin. You need to extend HeadlessJsTaskService and override getTaskConfig, e.g.:
Now, whenever you start your service, e.g. as a periodic task or in response to some system event / broadcast, JS will spin up, run your task, then spin down.
BroadcastReceiver, make sure to call HeadlessJsTaskService.acquireWakelockNow() before returning from onReceive().You can edit the content above on GitHub and send us a pull request!
A component's height and width determine its size on the screen.
The simplest way to set the dimensions of a component is by adding a fixed width and height to style. All dimensions in React Native are unitless, and represent density-independent pixels.
A component's height and width determine its size on the screen.
The simplest way to set the dimensions of a component is by adding a fixed width and height to style. All dimensions in React Native are unitless, and represent density-independent pixels.
After you can control a component's size, the next step is to learn how to lay it out on the screen.
You can edit the content above on GitHub and send us a pull request!
A React component for displaying different types of images, +
A React component for displaying different types of images, including network images, static resources, temporary local images, and images from local disk, such as the camera roll.
This example shows both fetching and displaying an image from local storage as well as one from network.
Also, if you use GIF with ProGuard, you will need to add this rule in proguard-rules.pro :
Invoked on load error with {nativeEvent: {error}}.
Invoked on mount and layout changes with
-{nativeEvent: {layout: {x, y, width, height}}}.
Invoked when load completes successfully.
Invoked when load either succeeds or fails.
Invoked on load start.
e.g., onLoadStart={(e) => this.setState({loading: true})}
Determines how to resize the image when the frame doesn't match the raw +}
Invoked on load error with {nativeEvent: {error}}.
Invoked on mount and layout changes with
+{nativeEvent: {layout: {x, y, width, height}}}.
Invoked when load completes successfully.
Invoked when load either succeeds or fails.
Invoked on load start.
e.g., onLoadStart={(e) => this.setState({loading: true})}
Determines how to resize the image when the frame doesn't match the raw image dimensions.
cover: Scale the image uniformly (maintain the image's aspect ratio)
so that both dimensions (width and height) of the image will be equal
to or larger than the corresponding dimension of the view (minus padding).
contain: Scale the image uniformly (maintain the image's aspect ratio)
so that both dimensions (width and height) of the image will be equal to
or less than the corresponding dimension of the view (minus padding).
stretch: Scale width and height independently, This may change the
aspect ratio of the src.
repeat: Repeat the image to cover the frame of the view. The
-image will keep it's size and aspect ratio. (iOS only)
The image source (either a remote URL or a local file resource).
This prop can also contain several remote URLs, specified together with +image will keep it's size and aspect ratio. (iOS only)
The image source (either a remote URL or a local file resource).
This prop can also contain several remote URLs, specified together with
their width and height and potentially with scale/other URI arguments.
The native side will then choose the best uri to display based on the
measured size of the image container. A cache property can be added to
-control how networked request interacts with the local cache.
Changes the color of all the non-transparent pixels to the tintColor.
When the image has rounded corners, specifying an overlayColor will +control how networked request interacts with the local cache.
Changes the color of all the non-transparent pixels to the tintColor.
When the image has rounded corners, specifying an overlayColor will
cause the remaining space in the corners to be filled with a solid color.
This is useful in cases which are not supported by the Android
implementation of rounded corners:
@@ -85,25 +85,25 @@ background and setting the overlayColor to the same color
as the background.
For details of how this works under the hood, see http://frescolib.org/docs/rounded-corners-and-circles.html
ImageResizeModeis anEnumfor different image resizing modes, set via theresizeModestyle property onImagecomponents. The values arecontain,cover, -stretch,center,repeat.
A unique identifier for this element to be used in UI Automation -testing scripts.
The mechanism that should be used to resize the image when the image's dimensions
+stretch, center, repeat.
A unique identifier for this element to be used in UI Automation +testing scripts.
The mechanism that should be used to resize the image when the image's dimensions
differ from the image view's dimensions. Defaults to auto.
auto: Use heuristics to pick between resize and scale.
resize: A software operation which changes the encoded image in memory before it
gets decoded. This should be used instead of scale when the image is much larger
than the view.
scale: The image gets drawn downscaled or upscaled. Compared to resize, scale is
faster (usually hardware accelerated) and produces higher quality images. This
should be used if the image is smaller than the view. It should also be used if the
-image is slightly bigger than the view.
More details about resize and scale can be found at http://frescolib.org/docs/resizing-rotating.html.
The text that's read by the screen reader when the user interacts with -the image.
When true, indicates the image is an accessibility element.
blurRadius: the blur radius of the blur filter added to the image
When the image is resized, the corners of the size specified +image is slightly bigger than the view.
More details about resize and scale can be found at http://frescolib.org/docs/resizing-rotating.html.
The text that's read by the screen reader when the user interacts with +the image.
When true, indicates the image is an accessibility element.
blurRadius: the blur radius of the blur filter added to the image
When the image is resized, the corners of the size specified
by capInsets will stay a fixed size, but the center content and borders
of the image will be stretched. This is useful for creating resizable
rounded buttons, shadows, and other resizable assets. More info in the
-official Apple documentation.
A static image to display while loading the image source.
uri - a string representing the resource identifier for the image, which
+official Apple documentation.A static image to display while loading the image source.
uri - a string representing the resource identifier for the image, which
should be either a local file path or the name of a static image resource
(which should be wrapped in the require('./path/to/image.png') function).width, height - can be specified if known at build time, in which case
these will be used to set the default <Image/> component dimensions.scale - used to indicate the scale factor of the image. Defaults to 1.0 if
-unspecified, meaning that one image pixel equates to one display point / DIP.number - Opaque type returned by something like require('./image.jpg').Invoked when a partial load of the image is complete. The definition of +unspecified, meaning that one image pixel equates to one display point / DIP.
number - Opaque type returned by something like require('./image.jpg').Invoked when a partial load of the image is complete. The definition of what constitutes a "partial load" is loader specific though this is meant -for progressive JPEG loads.
Invoked on download progress with {nativeEvent: {loaded, total}}.
Retrieve the width and height (in pixels) of an image prior to displaying it. +for progressive JPEG loads.
Invoked on download progress with {nativeEvent: {loaded, total}}.
Retrieve the width and height (in pixels) of an image prior to displaying it. This method can fail if the image cannot be found, or fails to download.
In order to retrieve the image dimensions, the image may first need to be loaded or downloaded, after which it will be cached. This means that in principle you could use this method to preload images, however it is not @@ -111,7 +111,7 @@ optimized for that purpose, and may in future be implemented in a way that does not fully load/download the image data. A proper, supported way to preload images will be provided as a separate API.
| Name and Type | Description |
|---|---|
| uri string | The location of the image. |
| success function | The function that will be called if the image was successfully found and width and height retrieved. |
| failure function | The function that will be called if there was an error, such as failing to -to retrieve the image. |
Prefetches a remote image for later use by downloading it to the disk +to retrieve the image.
Prefetches a remote image for later use by downloading it to the disk cache
| Name and Type | Description |
|---|---|
| url string | The remote location of the image. |
You can edit the content above on GitHub and send us a pull request!
Examples # | Edit on GitHub |
Crop the image specified by the URI param. If URI points to a remote +
Crop the image specified by the URI param. If URI points to a remote image, it will be downloaded automatically. If the image cannot be loaded/downloaded, the failure callback will be called.
If the cropping process is successful, the resultant cropped image will be stored in the ImageStore, and the URI returned in the success callback will point to the image in the store. Remember to delete the -cropped image from the ImageStore when you are done with it.
You can edit the content above on GitHub and send us a pull request!
React Native provides a unified way of managing images and other media assets in your iOS and Android apps. To add a static image to your app, place it somewhere in your source code tree and reference it like this:
The image name is resolved the same way JS modules are resolved. In the example above, the packager will look for my-icon.png in the same folder as the component that requires it. Also, if you have my-icon.ios.png and my-icon.android.png, the packager will pick the correct file for the platform.
You can also use the @2x and @3x suffixes to provide images for different screen densities. If you have the following file structure:
React Native provides a unified way of managing images and other media assets in your iOS and Android apps. To add a static image to your app, place it somewhere in your source code tree and reference it like this:
The image name is resolved the same way JS modules are resolved. In the example above, the packager will look for my-icon.png in the same folder as the component that requires it. Also, if you have my-icon.ios.png and my-icon.android.png, the packager will pick the correct file for the platform.
You can also use the @2x and @3x suffixes to provide images for different screen densities. If you have the following file structure:
Images.xcassets.Please note that the following corner specific, border radius style properties are currently ignored by iOS's image component:
borderTopLeftRadiusborderTopRightRadiusborderBottomLeftRadiusborderBottomRightRadiusImage decoding can take more than a frame-worth of time. This is one of the major sources of frame drops on the web because decoding is done in the main thread. In React Native, image decoding is done in a different thread. In practice, you already need to handle the case when the image is not downloaded yet, so displaying the placeholder for a few more frames while it is decoding does not require any code change.
You can edit the content above on GitHub and send us a pull request!
Check if the ImageStore contains image data for the specified URI. +
Check if the ImageStore contains image data for the specified URI. @platform ios
Delete an image from the ImageStore. Images are stored in memory and must be manually removed when you are finished with them, otherwise they will continue to use up RAM until the app is terminated. It is safe to @@ -16,7 +16,7 @@ will be called.
Note that it is very inefficient to transfer large quantit
data between JS and native code, so you should avoid calling this more
than necessary. To display an image in the ImageStore, you can just pass
the URI to an <Image/> component; there is no need to retrieve the
-base64 data.
You can edit the content above on GitHub and send us a pull request!