question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default styling for all the text

See original GitHub issue

We got response in two format. Sometimes we got HTML tag within the response but sometimes we got plain string.

We do styling bases on the tags like given below. I want to apply the styling for all the text whether they are wrapped in HTML tag or not.

const webViewStyle = StyleSheet.create({ p: { color:"red", }, })

const body = "<p>Display Text</p>" const body = "Display Text"

<HTMLView style={styles.content} value={subHeader} stylesheet={webViewStyle} />

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
rajnikantsethiyacommented, Feb 15, 2017

Thanks for the reply @stefan-digital-chefs … But the solution is not working its not changing the colours for anything.😦

2reactions
Stefan-vscommented, Feb 24, 2017

Weird. This works for me, just putting an element around the content string. Like this: <HTMLView value={"<newCustomElement>"+subHeader+"</newCustomElement>"} stylesheet={webViewStyle} />} And then provide a style for that element, like this: const webViewStyle = StyleSheet.create({ newCustomElement: { color:"red" } });

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fundamental text and font styling - Learn web development
Default fonts. CSS defines five generic names for fonts: serif , sans-serif , monospace , cursive , and ...
Read more >
CSS Default Browser Values for HTML Elements - W3Schools
Element Default CSS Value Try it a:link:active color: (internal value) Try it » a:visited:active color: (internal value) Try it » abbr None.
Read more >
How To Style Text Elements with Font, Size, and Color in CSS
The default font sizes for elements are relatively sized based on the parent element, in this case the <body> element, using a percent...
Read more >
Basic CSS: Text Styling in CSS - GCFGlobal
Learn how to use CSS to style the text on a webpage by changing its size, font, boldness, and alignment.
Read more >
Default Styles for CSS | George Ornbo
Coding CSS can quickly run into difficulties with different ... same in every browser but you can help yourself by using a default...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found