Skip to content

Commit

Permalink
Add ring defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-rogerson committed Apr 23, 2021
1 parent 3f49c17 commit b0f443a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions __fixtures__/globalStyles/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ module.exports = {
400: 'grayish',
},
},
ringOffsetWidth: {
DEFAULT: '10px',
},
ringOffsetColor: {
DEFAULT: 'rainbow',
},
borderColor: {
// Tests the dynamic default border default color
DEFAULT: 'blueish',
Expand Down
5 changes: 2 additions & 3 deletions __snapshots__/plugin.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7837,8 +7837,8 @@ const _GlobalStyles = () => (
}
* {
--tw-ring-inset: var(--tw-empty, /*!*/ /*!*/);
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-offset-width: 10px;
--tw-ring-offset-color: rainbow;
--tw-ring-color: rgba(59, 130, 246, 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
Expand Down Expand Up @@ -12560,7 +12560,6 @@ tw\`z-auto\`
exports[`twin.macro pluginForms.js: pluginForms.js 1`] = `

import { GlobalStyles } from './macro'

;<GlobalStyles />

↓ ↓ ↓ ↓ ↓ ↓
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/ring.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const globalRingStyles = ({ theme }) => {

return `* {
--tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-offset-width: ${theme('ringOffsetWidth.DEFAULT') || '0px'};
--tw-ring-offset-color: ${theme('ringOffsetColor.DEFAULT') || '#fff'};
--tw-ring-color: ${ringColorDefault};
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
Expand Down

0 comments on commit b0f443a

Please sign in to comment.