Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Commit 6e2e2b8

Browse files
committed
Fix handling of outline offsets
1 parent 3c16d43 commit 6e2e2b8

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/corePlugins/outline.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
const nameClass = require('tailwindcss/lib/util/nameClass').default
2-
const transformThemeValue = require('tailwindcss/lib/util/transformThemeValue').default
3-
4-
function isPlainObject(value) {
5-
return typeof value === 'object' && value !== null
6-
}
72

83
module.exports = function ({ matchUtilities, jit: { theme } }) {
94
matchUtilities({
105
outline: (modifier, { theme }) => {
11-
let transformValue = transformThemeValue('outline')
12-
let value = transformValue(theme.outline[modifier])
6+
let value = theme.outline[modifier]
137

14-
if (modifier === '' || value === undefined) {
8+
if (value === undefined) {
159
return []
1610
}
1711

tests/00-kitchen-sink.test.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ div {
304304
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000),
305305
var(--tw-shadow);
306306
}
307+
.outline-black {
308+
outline: 2px dotted black;
309+
outline-offset: 2px;
310+
}
307311
.filter-none {
308312
filter: none;
309313
}

tests/00-kitchen-sink.test.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<div class="test-apply-font-variant"></div>
1717
<div class="mt-6"></div>
1818
<div class="bg-black"></div>
19+
<div class="outline-black"></div>
1920
<div class="custom-util"></div>
2021
<div class="hover:custom-util"></div>
2122
<div class="group-hover:custom-util"></div>

0 commit comments

Comments
 (0)