From 26aa66091daa37fe28dacd9d5e6ce875bb637d23 Mon Sep 17 00:00:00 2001 From: Ryan Florence Date: Thu, 23 Feb 2017 16:28:24 -0800 Subject: [PATCH] remove more peculiar web language MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: I guess we could ask Håkon Wium Lie if indeed it was unintended to have a set of rules be inherited or not, but this paragraph is a little bit weird 🤷‍♀️ Closes https://github.com/facebook/react-native/pull/12485 Differential Revision: D4608425 Pulled By: hramos fbshipit-source-id: a346b1e65c9fc7b06634e529c1ef6f9e24794cca --- docs/Text.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Text.md b/docs/Text.md index dfed9b1459e..d1039fc74e1 100644 --- a/docs/Text.md +++ b/docs/Text.md @@ -83,7 +83,7 @@ The `` element is special relative to layout: everything inside is no long ## Limited Style Inheritance -On the web, the usual way to set a font family and size for the entire document is to write: +On the web, the usual way to set a font family and size for the entire document is to take advantage of inherited CSS properties like so: ```css /* CSS, *not* React Native */ @@ -94,7 +94,7 @@ html { } ``` -When the browser is trying to render a text node, it's going to go all the way up to the root element of the tree and find an element with a `font-size` attribute. An unexpected property of this system is that **any** node can have `font-size` attribute, including a `
`. This was designed for convenience, even though not really semantically correct. +All elements in the document will inherit this font unless they or one of their parents specifies a new rule. In React Native, we are more strict about it: **you must wrap all the text nodes inside of a `` component**; you cannot have a text node directly under a ``.