Skip to content

Commit

Permalink
chore: added some more selectors of level 4
Browse files Browse the repository at this point in the history
  • Loading branch information
anikethsaha committed Jun 10, 2020
1 parent 2a8eb7d commit ad32f05
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/css-size/src/__tests__/index.js
Expand Up @@ -4,7 +4,7 @@ import path from 'path';
import colors from 'colors/safe';
import size, { table, numeric } from '../';

jest.setTimeout(15000);
jest.setTimeout(60000);

let noopProcessorPath = path.resolve(__dirname, '../../processors/noop.js');

Expand Down
2 changes: 2 additions & 0 deletions packages/cssnano/src/__tests__/postcss-merge-rules.js
@@ -1,5 +1,7 @@
import processCss, { passthrough } from './_processCss';

jest.setTimeout(60000);

test(
'should merge based on declarations',
processCss('h1{display:block}h2{display:block}', 'h1,h2{display:block}')
Expand Down
30 changes: 30 additions & 0 deletions packages/postcss-merge-rules/src/__tests__/index.js
Expand Up @@ -268,6 +268,36 @@ test(
)
);

test(
'should not merge pseudo which are not supported by the browsers - any link',
passthroughCSS(
'a:any-link { color: orange; } a:any-link { border: 1px solid blue;}',
{
env: 'not ie > 11',
}
)
);

test(
'should not merge pseudo which are not supported by the browsers - read-only',
passthroughCSS(
'p:read-only { color: orange; } p:read-only { border: 1px solid blue;}',
{
env: 'not ie > 11',
}
)
);

test(
'should not merge pseudo which are not supported by the browsers - read-write',
passthroughCSS(
'p:read-write { color: orange; } p:read-write { border: 1px solid blue;}',
{
env: 'not ie > 11',
}
)
);

test(
'should not merge mixed vendor prefixes',
passthroughCSS(
Expand Down
3 changes: 3 additions & 0 deletions packages/postcss-merge-rules/src/lib/ensureCompatibility.js
Expand Up @@ -57,6 +57,9 @@ export const pseudoElements = {
'::placeholder': 'css-placeholder',
'::selection': 'css-selection',
':visited': cssSel3,
':any-link': 'css-any-link',
':read-only': 'css-read-only-write',
':read-write': 'css-read-only-write',
};

function isCssMixin(selector) {
Expand Down

0 comments on commit ad32f05

Please sign in to comment.