Skip to content

Commit 033dfc6

Browse files
committed
feat: add 'backface' utility and update README.md
Added a new utility 'backface' to the 'others' utilities and exported it through 'index.ts'. Updated README.md with usage examples for the new utility. Additionally, rearranged the export of 'letterSpacing' in 'index.ts' for better organization.
1 parent 55aa438 commit 033dfc6

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,12 @@ There are two types of utility classes, those that simplify the syntax of classe
567567
568568
<br />
569569
570+
- backface-{suffix}:
571+
- `<div class="backface-visible" />`.
572+
- `<div class="backface-hidden" />`.
573+
574+
<br />
575+
570576
- animate-skeleton:
571577
- Before: `<div class="animate-pulse bg-slate-200" />`
572578
- After: `<div class="animate-skeleton" />`.

src/utilities/others/backface.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import plugin from 'tailwindcss/plugin'
2+
3+
export const backface = plugin(({ addUtilities }) => {
4+
addUtilities({
5+
'.backface-visible': {
6+
'backface-visibility': 'visible',
7+
'-moz-backface-visibility': 'visible',
8+
'-webkit-backface-visibility': 'visible',
9+
'-ms-backface-visibility': 'visible'
10+
},
11+
'.backface-hidden': {
12+
'backface-visibility': 'hidden',
13+
'-moz-backface-visibility': 'hidden',
14+
'-webkit-backface-visibility': 'hidden',
15+
'-ms-backface-visibility': 'hidden'
16+
}
17+
})
18+
})

src/utilities/others/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
export { backgroundPosition } from './backgroundPosition'
2+
export { letterSpacing } from './letterSpacing'
23
export { scrollbarHide } from './scrollbarHide'
34
export { directional } from './directional'
45
export { lineHeight } from './lineHeight'
56
export { separator } from './separator'
7+
export { backface } from './backface'
68
export { ellipsis } from './ellipsis'
79
export { skeleton } from './skeleton'
810
export { overflow } from './overflow'
911
export { pseudo } from './pseudo'
1012
export { size } from './size'
1113
export { gap } from './gap'
12-
export { letterSpacing } from './letterSpacing'

0 commit comments

Comments
 (0)