Last active
November 11, 2019 11:39
-
-
Save CHH/dc25d4b6129fb92513acc44d618b44b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template functional> | |
<Component | |
:is="props.tag || ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'][props.level - 1]" | |
:ref="data.ref" | |
class="font-light leading-tight" | |
:class="{ | |
'text-3xl sm:text-4xl md:text-5xl': (props.size || props.level) === 1, | |
'text-2xl sm:text-3xl md:text-4xl': (props.size || props.level) === 2, | |
'text-1xl sm:text-2xl md:text-3xl': (props.size || props.level) === 3, | |
'text-xl sm:text-1xl md:text-2xl': (props.size || props.level) >= 4, | |
[data.class]: typeof data.class !== 'undefined', | |
[data.staticClass]: typeof data.staticClass !== 'undefined', | |
}" | |
:style="[ | |
data.style, | |
data.staticStyle, | |
]" | |
v-bind="data.attrs" | |
v-on="listeners" | |
> | |
<slot/> | |
</Component> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template functional> | |
<Component | |
:is="props.tag || ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'][props.level - 1]" | |
:ref="data.ref" | |
class="font-light leading-tight" | |
:class="[ | |
...((props.size || props.level) === 1 ? ['text-3xl sm:text-4xl md:text-5xl'] : []), | |
...((props.size || props.level) === 2 ? ['text-2xl sm:text-3xl md:text-4xl'] : []), | |
...((props.size || props.level) === 3 ? ['text-1xl sm:text-2xl md:text-3xl'] : []), | |
...((props.size || props.level) >= 4 ? ['text-xl sm:text-1xl md:text-2xl'] : []), | |
data.class, | |
data.staticClass, | |
]" | |
:style="[ | |
data.style, | |
data.staticStyle, | |
]" | |
v-bind="data.attrs" | |
v-on="listeners" | |
> | |
<slot/> | |
</Component> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment