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

Commit c3ff544

Browse files
authored
Merge pull request #89 from tailwindlabs/outline-offsets
Fix handling of outline offsets
2 parents 3c16d43 + fa392d3 commit c3ff544

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
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/01-basic-usage.test.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,11 +553,11 @@
553553
}
554554
.outline-none {
555555
outline: 2px solid transparent;
556-
outline-offset: 0;
556+
outline-offset: 2px;
557557
}
558558
.outline-black {
559559
outline: 2px dotted black;
560-
outline-offset: 0;
560+
outline-offset: 2px;
561561
}
562562
.ring {
563563
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width)

0 commit comments

Comments
 (0)