Skip to content

Commit

Permalink
Add support for border opacity
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Demedes committed May 17, 2020
1 parent 210951b commit cda704d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const supportedUtilities = [
/^bg-(transparent|black|white|gray|red|orange|yellow|green|teal|blue|indigo|purple|pink)/,
// Background opacity
/^bg-opacity-/,
// Border color, style, width, radius
// Border color, style, width, radius, opacity
/^(border|rounded)/,
// Opacity
/^opacity-/,
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ tailwind('pt-12 items-center');
### Borders

- [Border Color](https://tailwindcss.com/docs/border-color)
- [Border Opacity](https://tailwindcss.com/docs/border-opacity)
- [Border Style](https://tailwindcss.com/docs/border-style) (all except `border-current`)
- [Border Width](https://tailwindcss.com/docs/border-width)
- [Border Radius](https://tailwindcss.com/docs/border-radius)
Expand Down
10 changes: 8 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ test('ignore unknown classes', t => {

test('support color opacity', t => {
t.deepEqual(
tailwind('text-blue-500 text-opacity-50 bg-blue-100 bg-opacity-50'),
tailwind(
'text-blue-500 text-opacity-50 bg-blue-100 bg-opacity-50 border-blue-100 border-opacity-50'
),
{
color: 'rgba(66, 153, 225, 0.5)',
backgroundColor: 'rgba(235, 248, 255, 0.5)'
backgroundColor: 'rgba(235, 248, 255, 0.5)',
borderTopColor: 'rgba(235, 248, 255, 0.5)',
borderRightColor: 'rgba(235, 248, 255, 0.5)',
borderBottomColor: 'rgba(235, 248, 255, 0.5)',
borderLeftColor: 'rgba(235, 248, 255, 0.5)'
}
);
});
Expand Down

0 comments on commit cda704d

Please sign in to comment.