Skip to content

Commit

Permalink
remove more peculiar web language
Browse files Browse the repository at this point in the history
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 #12485

Differential Revision: D4608425

Pulled By: hramos

fbshipit-source-id: a346b1e65c9fc7b06634e529c1ef6f9e24794cca
  • Loading branch information
ryanflorence authored and facebook-github-bot committed Feb 24, 2017
1 parent 7aa9f21 commit c6d56d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/Text.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The `<Text>` 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 */
Expand All @@ -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 `<div>`. 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 `<Text>` component**; you cannot have a text node directly under a `<View>`.

Expand Down

0 comments on commit c6d56d9

Please sign in to comment.