Skip to content

Commit d3ca721

Browse files
authored
Merge pull request tailwindlabs#13 from tailwindlabs/node-12
make it node 12 compatible
2 parents 750bcc2 + ca6e47b commit d3ca721

File tree

3 files changed

+42
-4
lines changed

3 files changed

+42
-4
lines changed

.github/workflows/main.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
node-version: [12.x, 15.x]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Use Node ${{ matrix.node-version }}
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
21+
- name: Use cached node_modules
22+
id: cache
23+
uses: actions/cache@v2
24+
with:
25+
path: node_modules
26+
key: nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }}
27+
restore-keys: |
28+
nodeModules-
29+
30+
- name: Install dependencies
31+
if: steps.cache.outputs.cache-hit != 'true'
32+
run: npm install
33+
env:
34+
CI: true
35+
36+
- name: Test
37+
run: npm run test -- --coverage
38+
env:
39+
CI: true

src/corePlugins/ringWidth.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const dlv = require('dlv')
22
const nameClass = require('tailwindcss/lib/util/nameClass').default
3-
const transformThemeValue = require('tailwindcss/lib/util/transformThemeValue').default
43
const toRgba = require('tailwindcss/lib/util/withAlphaVariable').toRgba
54
const { asLength } = require('../pluginUtils')
65

@@ -20,8 +19,8 @@ module.exports = function ({ addBase, matchUtilities, addUtilities, jit: { theme
2019
let ringReset = {
2120
'*': {
2221
'--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
23-
'--tw-ring-offset-width': theme.ringOffsetWidth?.DEFAULT ?? '0px',
24-
'--tw-ring-offset-color': theme.ringOffsetColor?.DEFAULT ?? '#fff',
22+
'--tw-ring-offset-width': dlv(theme, ['ringOffsetWidth', 'DEFAULT'], '0px'),
23+
'--tw-ring-offset-color': dlv(theme, ['ringOffsetColor', 'DEFAULT'], '#fff'),
2524
'--tw-ring-color': ringColorDefault,
2625
'--tw-ring-offset-shadow': '0 0 #0000',
2726
'--tw-ring-shadow': '0 0 #0000',

src/lib/setupContext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function getTailwindConfig(configOrPath) {
153153

154154
if (userConfigPath !== null) {
155155
let [prevConfig, prevModified = -Infinity, prevConfigHash] =
156-
configPathCache.get(userConfigPath) ?? []
156+
configPathCache.get(userConfigPath) || []
157157
let modified = fs.statSync(userConfigPath).mtimeMs
158158

159159
// It hasn't changed (based on timestamp)

0 commit comments

Comments
 (0)