Skip to content

Commit bc38499

Browse files
committed
删除 CSS 通用选择器
1 parent 7e2dd53 commit bc38499

7 files changed

Lines changed: 8 additions & 53 deletions

File tree

README.md

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,3 @@
1-
<p align="center">
2-
<a href="https://tailwindcss.com" target="_blank">
3-
<picture>
4-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tailwindlabs/tailwindcss/HEAD/.github/logo-dark.svg">
5-
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tailwindlabs/tailwindcss/HEAD/.github/logo-light.svg">
6-
<img alt="Tailwind CSS" src="https://raw.githubusercontent.com/tailwindlabs/tailwindcss/HEAD/.github/logo-light.svg" width="350" height="70" style="max-width: 100%;">
7-
</picture>
8-
</a>
9-
</p>
1+
# tailwindcss-mp
102

11-
<p align="center">
12-
A utility-first CSS framework for rapidly building custom user interfaces.
13-
</p>
14-
15-
<p align="center">
16-
<a href="https://github.com/tailwindlabs/tailwindcss/actions"><img src="https://img.shields.io/github/actions/workflow/status/tailwindlabs/tailwindcss/ci.yml?branch=main" alt="Build Status"></a>
17-
<a href="https://www.npmjs.com/package/tailwindcss"><img src="https://img.shields.io/npm/dt/tailwindcss.svg" alt="Total Downloads"></a>
18-
<a href="https://github.com/tailwindcss/tailwindcss/releases"><img src="https://img.shields.io/npm/v/tailwindcss.svg" alt="Latest Release"></a>
19-
<a href="https://github.com/tailwindcss/tailwindcss/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/tailwindcss.svg" alt="License"></a>
20-
</p>
21-
22-
---
23-
24-
## Documentation
25-
26-
For full documentation, visit [tailwindcss.com](https://tailwindcss.com/).
27-
28-
## Community
29-
30-
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
31-
32-
[Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions)
33-
34-
For casual chit-chat with others using the framework:
35-
36-
[Join the Tailwind CSS Discord Server](https://discord.gg/7NF8GNe)
37-
38-
## Contributing
39-
40-
If you're interested in contributing to Tailwind CSS, please read our [contributing docs](https://github.com/tailwindcss/tailwindcss/blob/main/.github/CONTRIBUTING.md) **before submitting a pull request**.
3+
支持小程序的 Tailwindcss

src/lib/resolveDefaultsAtRules.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ export default function resolveDefaultsAtRules({ tailwindConfig }) {
138138
}
139139
} else if (universals.size) {
140140
let universalRule = postcss.rule({
141-
selectors: ['*', '::before', '::after'],
141+
selectors: [
142+
// '*', 小程序不支持的选择器
143+
'::before',
144+
'::after',
145+
],
142146
})
143147

144148
for (let universal of universals) {

tests/basic-usage.test.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
*,
21
:before,
32
:after,
43
::backdrop {

tests/custom-plugins.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ test('important candidates discard rules with irrelevant selectors', async () =>
19441944
let result = await run('@tailwind base', config)
19451945

19461946
expect(result.css).toMatchInlineSnapshot(`
1947-
"*, ::before, ::after {
1947+
"::before, ::after {
19481948
--tw-border-spacing-x: 0;
19491949
--tw-border-spacing-y: 0;
19501950
--tw-translate-x: 0;

tests/resolve-defaults-at-rules.test.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ test('basic utilities', async () => {
1414

1515
return run(input, config).then((result) => {
1616
expect(result.css).toMatchFormattedCss(css`
17-
*,
1817
:before,
1918
:after,
2019
::backdrop {
@@ -64,7 +63,6 @@ test('with pseudo-class variants', async () => {
6463

6564
return run(input, config).then((result) => {
6665
expect(result.css).toMatchFormattedCss(css`
67-
*,
6866
:before,
6967
:after,
7068
::backdrop {
@@ -112,7 +110,6 @@ test('with pseudo-element variants', async () => {
112110

113111
return run(input, config).then((result) => {
114112
expect(result.css).toMatchFormattedCss(css`
115-
*,
116113
:before,
117114
:after,
118115
::backdrop {
@@ -156,7 +153,6 @@ test('with multi-class variants', async () => {
156153

157154
return run(input, config).then((result) => {
158155
expect(result.css).toMatchFormattedCss(css`
159-
*,
160156
:before,
161157
:after,
162158
::backdrop {
@@ -200,7 +196,6 @@ test('with multi-class pseudo-element variants', async () => {
200196

201197
return run(input, config).then((result) => {
202198
expect(result.css).toMatchFormattedCss(css`
203-
*,
204199
:before,
205200
:after,
206201
::backdrop {
@@ -250,7 +245,6 @@ test('with multi-class pseudo-element and pseudo-class variants', async () => {
250245

251246
return run(input, config).then((result) => {
252247
expect(result.css).toMatchFormattedCss(css`
253-
*,
254248
:before,
255249
:after,
256250
::backdrop {
@@ -336,7 +330,6 @@ test('with apply', async () => {
336330

337331
return run(input, config).then((result) => {
338332
expect(result.css).toMatchFormattedCss(css`
339-
*,
340333
:before,
341334
:after,
342335
::backdrop {
@@ -529,7 +522,6 @@ test('with shadows', async () => {
529522

530523
return run(input, config).then((result) => {
531524
expect(result.css).toMatchFormattedCss(css`
532-
*,
533525
:before,
534526
:after,
535527
::backdrop {
@@ -586,7 +578,6 @@ test('when no utilities that need the defaults are used', async () => {
586578

587579
return run(input, config).then((result) => {
588580
expect(result.css).toMatchFormattedCss(css`
589-
*,
590581
:before,
591582
:after,
592583
::backdrop {

tests/util/defaults.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { css } from './strings'
77
*/
88
export function defaults({ defaultRingColor = `#3b82f680` } = {}) {
99
return css`
10-
*,
1110
:before,
1211
:after,
1312
::backdrop {

tests/variants.test.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
*,
21
:before,
32
:after,
43
::backdrop {

0 commit comments

Comments
 (0)