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

Commit

Permalink
Fix handling of outline offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Mar 17, 2021
1 parent 3c16d43 commit 6e2e2b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/corePlugins/outline.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
const nameClass = require('tailwindcss/lib/util/nameClass').default
const transformThemeValue = require('tailwindcss/lib/util/transformThemeValue').default

function isPlainObject(value) {
return typeof value === 'object' && value !== null
}

module.exports = function ({ matchUtilities, jit: { theme } }) {
matchUtilities({
outline: (modifier, { theme }) => {
let transformValue = transformThemeValue('outline')
let value = transformValue(theme.outline[modifier])
let value = theme.outline[modifier]

if (modifier === '' || value === undefined) {
if (value === undefined) {
return []
}

Expand Down
4 changes: 4 additions & 0 deletions tests/00-kitchen-sink.test.css
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ div {
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000),
var(--tw-shadow);
}
.outline-black {
outline: 2px dotted black;
outline-offset: 2px;
}
.filter-none {
filter: none;
}
Expand Down
1 change: 1 addition & 0 deletions tests/00-kitchen-sink.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<div class="test-apply-font-variant"></div>
<div class="mt-6"></div>
<div class="bg-black"></div>
<div class="outline-black"></div>
<div class="custom-util"></div>
<div class="hover:custom-util"></div>
<div class="group-hover:custom-util"></div>
Expand Down

0 comments on commit 6e2e2b8

Please sign in to comment.