10 examples of 'react fontsize' in JavaScript

Every line of 'react fontsize' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
109get fontSize() {
110 return this._label.fontSize;
111}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

39value: function _getFontSize() {
40 var single = this.props.single;
41
42 return single ? this.props.size / 1.7 : (this.props.size - 5) / 2;
43}
22onChange(e) {
23 var sliderVal = e.target.value,
24 fraction = sliderVal / 100,
25 fontSize;
26
27 if (fraction < 0.1) {
28 fontSize = 49;
29 }
30 else {
31 fontSize = 100 * fraction;
32 }
33
34 this.setState({fontSize: fontSize});
35}
85function getFontSizeValue({ theme, value }) {
86 const size = fontSize(value)({ theme });
87 if (size) {
88 return `${size}em`;
89 }
90 return value;
91}
11export function styleTypographyFontSize({ v, device, state }) {
12 const fontSize = defaultValueValue({
13 v,
14 key: "fontSize",
15 device,
16 state
17 });
18
19 return fontSize;
20}
61public get fontSize(): Size {
62 return this._fontSize;
63}
20getFontSize() {
21 return Math.max(10, this.options.value.fontSize);
22}
51getFontSize(){
52 return this.style.fontSize;
53}
85export function setFontSize(value, button) {
86 if (value) {
87 document.documentElement.style.setProperty('font-size', value);
88 setStorageItem('fontsize', value);
89 } else {
90 document.documentElement.style.removeProperty('font-size');
91 removeStorageItem('fontsize');
92 }
93 if (button) {
94 button.setAttribute('aria-pressed', value ? 'true' : 'false');
95 }
96}
50getFontSize(element) {
51 let fontSizeString = window.getComputedStyle(element).fontSize;
52 let fontSize = parseFloat(fontSizeString);
53 return fontSize;
54}

Related snippets