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

make it node 12 compatible #13

Merged
merged 2 commits into from
Mar 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 15.x]

steps:
- uses: actions/checkout@v2

- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Use cached node_modules
id: cache
uses: actions/cache@v2
with:
path: node_modules
key: nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }}
restore-keys: |
nodeModules-

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm install
env:
CI: true

- name: Test
run: npm run test -- --coverage
env:
CI: true
5 changes: 2 additions & 3 deletions src/corePlugins/ringWidth.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const dlv = require('dlv')
const nameClass = require('tailwindcss/lib/util/nameClass').default
const transformThemeValue = require('tailwindcss/lib/util/transformThemeValue').default
const toRgba = require('tailwindcss/lib/util/withAlphaVariable').toRgba
const { asLength } = require('../pluginUtils')

Expand All @@ -20,8 +19,8 @@ module.exports = function ({ addBase, matchUtilities, addUtilities, jit: { theme
let ringReset = {
'*': {
'--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)',
'--tw-ring-offset-width': theme.ringOffsetWidth?.DEFAULT ?? '0px',
'--tw-ring-offset-color': theme.ringOffsetColor?.DEFAULT ?? '#fff',
'--tw-ring-offset-width': dlv(theme, ['ringOffsetWidth', 'DEFAULT'], '0px'),
'--tw-ring-offset-color': dlv(theme, ['ringOffsetColor', 'DEFAULT'], '#fff'),
'--tw-ring-color': ringColorDefault,
'--tw-ring-offset-shadow': '0 0 #0000',
'--tw-ring-shadow': '0 0 #0000',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/setupContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function getTailwindConfig(configOrPath) {

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

// It hasn't changed (based on timestamp)
Expand Down