Skip to content

Commit e054f1b

Browse files
committed
feat: add mso-border utilities
1 parent acc35eb commit e054f1b

File tree

3 files changed

+597
-0
lines changed

3 files changed

+597
-0
lines changed

src/index.js

+127
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import plugin from 'tailwindcss/plugin'
22
import flattenColorPalette from 'tailwindcss/lib/util/flattenColorPalette'
3+
import {msoBorderColors} from './msoColors.js'
34

45
const tailwindCssMsoPlugin = plugin.withOptions(
56
function (options = {}) {
@@ -617,6 +618,132 @@ const tailwindCssMsoPlugin = plugin.withOptions(
617618
respectImportant,
618619
}
619620
)
621+
622+
// mso-border colors
623+
matchUtilities(
624+
{
625+
'mso-border-alt': value => ({
626+
'mso-border-alt': value
627+
}),
628+
'mso-border-between': value => ({
629+
'mso-border-between': value
630+
}),
631+
'mso-border-bottom-alt': value => ({
632+
'mso-border-bottom-alt': value
633+
}),
634+
'mso-border-left-alt': value => ({
635+
'mso-border-left-alt': value
636+
}),
637+
'mso-border-right-alt': value => ({
638+
'mso-border-right-alt': value
639+
}),
640+
'mso-border-top-alt': value => ({
641+
'mso-border-top-alt': value
642+
}),
643+
},
644+
{
645+
values: {
646+
...msoBorderColors,
647+
...flattenColorPalette(theme('colors')),
648+
649+
},
650+
respectImportant,
651+
}
652+
)
653+
654+
// mso-border widths
655+
matchUtilities(
656+
{
657+
'mso-border-between-width': value => ({
658+
'mso-border-between-width': value
659+
}),
660+
'mso-border-width-alt': value => ({
661+
'mso-border-width-alt': value
662+
}),
663+
'mso-border-bottom-width-alt': value => ({
664+
'mso-border-bottom-width-alt': value
665+
}),
666+
'mso-border-left-width-alt': value => ({
667+
'mso-border-left-width-alt': value
668+
}),
669+
'mso-border-right-width-alt': value => ({
670+
'mso-border-right-width-alt': value
671+
}),
672+
'mso-border-top-width-alt': value => ({
673+
'mso-border-top-width-alt': value
674+
}),
675+
},
676+
{
677+
values: {
678+
medium: 'medium',
679+
thick: 'thick',
680+
thin: 'thin',
681+
...theme('spacing'),
682+
},
683+
respectImportant,
684+
}
685+
)
686+
687+
// mso-border-*-source
688+
matchUtilities(
689+
{
690+
'mso-border-bottom-source': value => ({
691+
'mso-border-bottom-source': value
692+
}),
693+
'mso-border-left-source': value => ({
694+
'mso-border-left-source': value
695+
}),
696+
'mso-border-right-source': value => ({
697+
'mso-border-right-source': value
698+
}),
699+
'mso-border-top-source': value => ({
700+
'mso-border-top-source': value
701+
}),
702+
},
703+
{
704+
values: {
705+
auto: 'auto',
706+
background: 'background',
707+
foreground: 'foreground',
708+
709+
},
710+
respectImportant,
711+
}
712+
)
713+
714+
// mso-border-shadow
715+
matchUtilities(
716+
{
717+
'mso-border-shadow': value => ({
718+
'mso-border-shadow': value
719+
}),
720+
},
721+
{
722+
values: {
723+
no: 'no',
724+
yes: 'yes',
725+
726+
},
727+
respectImportant,
728+
}
729+
)
730+
731+
// mso-border-effect
732+
matchUtilities(
733+
{
734+
'mso-border-effect': value => ({
735+
'mso-border-effect': value
736+
}),
737+
},
738+
{
739+
values: {
740+
'3d': '3d',
741+
box: 'box',
742+
743+
},
744+
respectImportant,
745+
}
746+
)
620747
}
621748
}
622749
)

0 commit comments

Comments
 (0)