From 9ff10df9ebb6b34d98c7d6b820887e540938eb03 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Tue, 8 Mar 2022 14:56:53 +0800 Subject: [PATCH] Fix #194 --- modules/__tests__/createPrefixer-test.js | 11 +++++++++++ modules/index.js | 2 -- modules/plugins/backgroundClip.js | 10 ---------- modules/plugins/index.js | 2 -- 4 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 modules/plugins/backgroundClip.js diff --git a/modules/__tests__/createPrefixer-test.js b/modules/__tests__/createPrefixer-test.js index a9e1b42..72c8a58 100644 --- a/modules/__tests__/createPrefixer-test.js +++ b/modules/__tests__/createPrefixer-test.js @@ -74,6 +74,17 @@ describe('Static Prefixer', () => { }) describe('Resolving special plugins', () => { + it('should prefix background-clips correctly (issue #194)', () => { + const input = { backgroundClip: 'text' } + const output = { + MozBackgroundClip: 'text', + WebkitBackgroundClip: 'text', + backgroundClip: 'text' + } + expect(prefix(input)).toEqual(output) + expect(prefix(input)).toEqual(output) + }) + it('should prefix calc expressions', () => { const input = { width: 'calc(30px)' } const output = { diff --git a/modules/index.js b/modules/index.js index 8ce646f..ab147f7 100644 --- a/modules/index.js +++ b/modules/index.js @@ -2,7 +2,6 @@ import createPrefixer from './createPrefixer' import data from './data' -import backgroundClip from './plugins/backgroundClip' import cursor from './plugins/cursor' import crossFade from './plugins/crossFade' import filter from './plugins/filter' @@ -17,7 +16,6 @@ import sizing from './plugins/sizing' import transition from './plugins/transition' const plugins = [ - backgroundClip, crossFade, cursor, filter, diff --git a/modules/plugins/backgroundClip.js b/modules/plugins/backgroundClip.js deleted file mode 100644 index 18bde94..0000000 --- a/modules/plugins/backgroundClip.js +++ /dev/null @@ -1,10 +0,0 @@ -/* @flow */ -// https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip#Browser_compatibility -export default function backgroundClip( - property: string, - value: any -): ?Array { - if (typeof value === 'string' && value === 'text') { - return ['-webkit-text', 'text'] - } -} diff --git a/modules/plugins/index.js b/modules/plugins/index.js index 14ab20c..e2089db 100644 --- a/modules/plugins/index.js +++ b/modules/plugins/index.js @@ -1,4 +1,3 @@ -import backgroundClip from './backgroundClip' import calc from './calc' import cursor from './cursor' import crossFade from './crossFade' @@ -15,7 +14,6 @@ import sizing from './sizing' import transition from './transition' export default [ - backgroundClip, calc, crossFade, cursor,