INNER CODE UNIT · TypeScript

fontSize

tachyons-css/react-native-style-tachyons · src/reactWrapper.ts:59

        const fontSize = _.find(_.keys(typeScale), (fSetting) => _.includes(splitted, fSetting))

        for (let i = 0; i < splitted.length; i++) {
            const cls: string = splitted[i]
            if (cls.length > 0) {
                if (_.has(this.styles, cls)) {
                    /* Style found */
                    newProps.style.push(this.styles[cls])
                } else if (cls.startsWith("lh_")) {
                    /* Get font style */
                    if (!_.isString(fontSize)) {
                        throw new Error(`setting '${cls}' needs explicit font-size`)
                    }

                    newProps.style.push({
                        lineHeight: lhStyles[cls.replace(/_/gu, "-")] * this.styles[fontSize]["fontSize"]
                    })
                } else if (cls.startsWith("bg_")) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…