tailwindcss 3.1.1 → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -1
- package/lib/cli.js +39 -38
- package/lib/corePlugins.js +16 -16
- package/lib/lib/defaultExtractor.js +44 -24
- package/lib/lib/evaluateTailwindFunctions.js +11 -4
- package/lib/lib/generateRules.js +18 -10
- package/lib/lib/setupContextUtils.js +3 -2
- package/lib/util/dataTypes.js +3 -5
- package/lib/util/removeAlphaVariables.js +18 -0
- package/package.json +7 -7
- package/peers/index.js +276 -118
- package/src/cli.js +43 -37
- package/src/corePlugins.js +19 -16
- package/src/lib/defaultExtractor.js +38 -28
- package/src/lib/evaluateTailwindFunctions.js +14 -6
- package/src/lib/generateRules.js +18 -10
- package/src/lib/setupContextUtils.js +5 -2
- package/src/util/dataTypes.js +3 -5
- package/src/util/removeAlphaVariables.js +24 -0
- package/types/config.d.ts +1 -1
package/peers/index.js
CHANGED
|
@@ -25862,6 +25862,155 @@ var require_main = __commonJS({
|
|
|
25862
25862
|
"background-attachment",
|
|
25863
25863
|
"background-color"
|
|
25864
25864
|
],
|
|
25865
|
+
"columns": [
|
|
25866
|
+
"column-width",
|
|
25867
|
+
"column-count"
|
|
25868
|
+
],
|
|
25869
|
+
"column-rule": [
|
|
25870
|
+
"column-rule-width",
|
|
25871
|
+
"column-rule-style",
|
|
25872
|
+
"column-rule-color"
|
|
25873
|
+
],
|
|
25874
|
+
"flex": [
|
|
25875
|
+
"flex-grow",
|
|
25876
|
+
"flex-shrink",
|
|
25877
|
+
"flex-basis"
|
|
25878
|
+
],
|
|
25879
|
+
"flex-flow": [
|
|
25880
|
+
"flex-direction",
|
|
25881
|
+
"flex-wrap"
|
|
25882
|
+
],
|
|
25883
|
+
"font": [
|
|
25884
|
+
"font-style",
|
|
25885
|
+
"font-variant",
|
|
25886
|
+
"font-weight",
|
|
25887
|
+
"font-stretch",
|
|
25888
|
+
"font-size",
|
|
25889
|
+
"font-family",
|
|
25890
|
+
"line-height"
|
|
25891
|
+
],
|
|
25892
|
+
"grid": [
|
|
25893
|
+
"grid-template-rows",
|
|
25894
|
+
"grid-template-columns",
|
|
25895
|
+
"grid-template-areas",
|
|
25896
|
+
"grid-auto-rows",
|
|
25897
|
+
"grid-auto-columns",
|
|
25898
|
+
"grid-auto-flow",
|
|
25899
|
+
"column-gap",
|
|
25900
|
+
"row-gap"
|
|
25901
|
+
],
|
|
25902
|
+
"grid-area": [
|
|
25903
|
+
"grid-row-start",
|
|
25904
|
+
"grid-column-start",
|
|
25905
|
+
"grid-row-end",
|
|
25906
|
+
"grid-column-end"
|
|
25907
|
+
],
|
|
25908
|
+
"grid-column": [
|
|
25909
|
+
"grid-column-start",
|
|
25910
|
+
"grid-column-end"
|
|
25911
|
+
],
|
|
25912
|
+
"grid-row": [
|
|
25913
|
+
"grid-row-start",
|
|
25914
|
+
"grid-row-end"
|
|
25915
|
+
],
|
|
25916
|
+
"grid-template": [
|
|
25917
|
+
"grid-template-columns",
|
|
25918
|
+
"grid-template-rows",
|
|
25919
|
+
"grid-template-areas"
|
|
25920
|
+
],
|
|
25921
|
+
"list-style": [
|
|
25922
|
+
"list-style-type",
|
|
25923
|
+
"list-style-position",
|
|
25924
|
+
"list-style-image"
|
|
25925
|
+
],
|
|
25926
|
+
"padding": [
|
|
25927
|
+
"padding-block",
|
|
25928
|
+
"padding-block-start",
|
|
25929
|
+
"padding-block-end",
|
|
25930
|
+
"padding-inline",
|
|
25931
|
+
"padding-inline-start",
|
|
25932
|
+
"padding-inline-end",
|
|
25933
|
+
"padding-top",
|
|
25934
|
+
"padding-right",
|
|
25935
|
+
"padding-bottom",
|
|
25936
|
+
"padding-left"
|
|
25937
|
+
],
|
|
25938
|
+
"padding-block": [
|
|
25939
|
+
"padding-block-start",
|
|
25940
|
+
"padding-block-end",
|
|
25941
|
+
"padding-top",
|
|
25942
|
+
"padding-right",
|
|
25943
|
+
"padding-bottom",
|
|
25944
|
+
"padding-left"
|
|
25945
|
+
],
|
|
25946
|
+
"padding-block-start": [
|
|
25947
|
+
"padding-top",
|
|
25948
|
+
"padding-right",
|
|
25949
|
+
"padding-left"
|
|
25950
|
+
],
|
|
25951
|
+
"padding-block-end": [
|
|
25952
|
+
"padding-right",
|
|
25953
|
+
"padding-bottom",
|
|
25954
|
+
"padding-left"
|
|
25955
|
+
],
|
|
25956
|
+
"padding-inline": [
|
|
25957
|
+
"padding-inline-start",
|
|
25958
|
+
"padding-inline-end",
|
|
25959
|
+
"padding-top",
|
|
25960
|
+
"padding-right",
|
|
25961
|
+
"padding-bottom",
|
|
25962
|
+
"padding-left"
|
|
25963
|
+
],
|
|
25964
|
+
"padding-inline-start": [
|
|
25965
|
+
"padding-top",
|
|
25966
|
+
"padding-right",
|
|
25967
|
+
"padding-left"
|
|
25968
|
+
],
|
|
25969
|
+
"padding-inline-end": [
|
|
25970
|
+
"padding-right",
|
|
25971
|
+
"padding-bottom",
|
|
25972
|
+
"padding-left"
|
|
25973
|
+
],
|
|
25974
|
+
"margin": [
|
|
25975
|
+
"margin-block",
|
|
25976
|
+
"margin-block-start",
|
|
25977
|
+
"margin-block-end",
|
|
25978
|
+
"margin-inline",
|
|
25979
|
+
"margin-inline-start",
|
|
25980
|
+
"margin-inline-end",
|
|
25981
|
+
"margin-top",
|
|
25982
|
+
"margin-right",
|
|
25983
|
+
"margin-bottom",
|
|
25984
|
+
"margin-left"
|
|
25985
|
+
],
|
|
25986
|
+
"margin-block": [
|
|
25987
|
+
"margin-block-start",
|
|
25988
|
+
"margin-block-end",
|
|
25989
|
+
"margin-top",
|
|
25990
|
+
"margin-right",
|
|
25991
|
+
"margin-bottom",
|
|
25992
|
+
"margin-left"
|
|
25993
|
+
],
|
|
25994
|
+
"margin-inline": [
|
|
25995
|
+
"margin-inline-start",
|
|
25996
|
+
"margin-inline-end",
|
|
25997
|
+
"margin-top",
|
|
25998
|
+
"margin-right",
|
|
25999
|
+
"margin-bottom",
|
|
26000
|
+
"margin-left"
|
|
26001
|
+
],
|
|
26002
|
+
"margin-inline-start": [
|
|
26003
|
+
"margin-top",
|
|
26004
|
+
"margin-right",
|
|
26005
|
+
"margin-bottom",
|
|
26006
|
+
"margin-left"
|
|
26007
|
+
],
|
|
26008
|
+
"margin-inline-end": [
|
|
26009
|
+
"margin-top",
|
|
26010
|
+
"margin-right",
|
|
26011
|
+
"margin-bottom",
|
|
26012
|
+
"margin-left"
|
|
26013
|
+
],
|
|
25865
26014
|
"border": [
|
|
25866
26015
|
"border-top",
|
|
25867
26016
|
"border-right",
|
|
@@ -25881,7 +26030,19 @@ var require_main = __commonJS({
|
|
|
25881
26030
|
"border-top-color",
|
|
25882
26031
|
"border-right-color",
|
|
25883
26032
|
"border-bottom-color",
|
|
25884
|
-
"border-left-color"
|
|
26033
|
+
"border-left-color",
|
|
26034
|
+
"border-block",
|
|
26035
|
+
"border-block-start",
|
|
26036
|
+
"border-block-end",
|
|
26037
|
+
"border-block-width",
|
|
26038
|
+
"border-block-style",
|
|
26039
|
+
"border-block-color",
|
|
26040
|
+
"border-inline",
|
|
26041
|
+
"border-inline-start",
|
|
26042
|
+
"border-inline-end",
|
|
26043
|
+
"border-inline-width",
|
|
26044
|
+
"border-inline-style",
|
|
26045
|
+
"border-inline-color"
|
|
25885
26046
|
],
|
|
25886
26047
|
"border-top": [
|
|
25887
26048
|
"border-width",
|
|
@@ -25939,99 +26100,64 @@ var require_main = __commonJS({
|
|
|
25939
26100
|
"border-bottom-right-radius",
|
|
25940
26101
|
"border-bottom-left-radius"
|
|
25941
26102
|
],
|
|
26103
|
+
"border-block": [
|
|
26104
|
+
"border-block-start",
|
|
26105
|
+
"border-block-end",
|
|
26106
|
+
"border-block-width",
|
|
26107
|
+
"border-width",
|
|
26108
|
+
"border-block-style",
|
|
26109
|
+
"border-style",
|
|
26110
|
+
"border-block-color",
|
|
26111
|
+
"border-color"
|
|
26112
|
+
],
|
|
25942
26113
|
"border-block-start": [
|
|
25943
26114
|
"border-block-start-width",
|
|
26115
|
+
"border-width",
|
|
25944
26116
|
"border-block-start-style",
|
|
25945
|
-
"border-
|
|
26117
|
+
"border-style",
|
|
26118
|
+
"border-block-start-color",
|
|
26119
|
+
"border-color"
|
|
25946
26120
|
],
|
|
25947
26121
|
"border-block-end": [
|
|
25948
26122
|
"border-block-end-width",
|
|
26123
|
+
"border-width",
|
|
25949
26124
|
"border-block-end-style",
|
|
25950
|
-
"border-
|
|
26125
|
+
"border-style",
|
|
26126
|
+
"border-block-end-color",
|
|
26127
|
+
"border-color"
|
|
25951
26128
|
],
|
|
25952
|
-
"border-
|
|
25953
|
-
"border-
|
|
25954
|
-
"border-
|
|
25955
|
-
"border-
|
|
25956
|
-
"border-
|
|
25957
|
-
"border-
|
|
26129
|
+
"border-inline": [
|
|
26130
|
+
"border-inline-start",
|
|
26131
|
+
"border-inline-end",
|
|
26132
|
+
"border-inline-width",
|
|
26133
|
+
"border-width",
|
|
26134
|
+
"border-inline-style",
|
|
26135
|
+
"border-style",
|
|
26136
|
+
"border-inline-color",
|
|
26137
|
+
"border-color"
|
|
25958
26138
|
],
|
|
25959
26139
|
"border-inline-start": [
|
|
25960
26140
|
"border-inline-start-width",
|
|
26141
|
+
"border-width",
|
|
25961
26142
|
"border-inline-start-style",
|
|
25962
|
-
"border-
|
|
26143
|
+
"border-style",
|
|
26144
|
+
"border-inline-start-color",
|
|
26145
|
+
"border-color"
|
|
25963
26146
|
],
|
|
25964
26147
|
"border-inline-end": [
|
|
25965
26148
|
"border-inline-end-width",
|
|
26149
|
+
"border-width",
|
|
25966
26150
|
"border-inline-end-style",
|
|
25967
|
-
"border-
|
|
25968
|
-
|
|
25969
|
-
|
|
25970
|
-
"column-width",
|
|
25971
|
-
"column-count"
|
|
25972
|
-
],
|
|
25973
|
-
"column-rule": [
|
|
25974
|
-
"column-rule-width",
|
|
25975
|
-
"column-rule-style",
|
|
25976
|
-
"column-rule-color"
|
|
25977
|
-
],
|
|
25978
|
-
"flex": [
|
|
25979
|
-
"flex-grow",
|
|
25980
|
-
"flex-shrink",
|
|
25981
|
-
"flex-basis"
|
|
25982
|
-
],
|
|
25983
|
-
"flex-flow": [
|
|
25984
|
-
"flex-direction",
|
|
25985
|
-
"flex-wrap"
|
|
25986
|
-
],
|
|
25987
|
-
"font": [
|
|
25988
|
-
"font-style",
|
|
25989
|
-
"font-variant",
|
|
25990
|
-
"font-weight",
|
|
25991
|
-
"font-stretch",
|
|
25992
|
-
"font-size",
|
|
25993
|
-
"font-family",
|
|
25994
|
-
"line-height"
|
|
25995
|
-
],
|
|
25996
|
-
"grid": [
|
|
25997
|
-
"grid-template-rows",
|
|
25998
|
-
"grid-template-columns",
|
|
25999
|
-
"grid-template-areas",
|
|
26000
|
-
"grid-auto-rows",
|
|
26001
|
-
"grid-auto-columns",
|
|
26002
|
-
"grid-auto-flow",
|
|
26003
|
-
"column-gap",
|
|
26004
|
-
"row-gap"
|
|
26005
|
-
],
|
|
26006
|
-
"grid-area": [
|
|
26007
|
-
"grid-row-start",
|
|
26008
|
-
"grid-column-start",
|
|
26009
|
-
"grid-row-end",
|
|
26010
|
-
"grid-column-end"
|
|
26011
|
-
],
|
|
26012
|
-
"grid-column": [
|
|
26013
|
-
"grid-column-start",
|
|
26014
|
-
"grid-column-end"
|
|
26015
|
-
],
|
|
26016
|
-
"grid-row": [
|
|
26017
|
-
"grid-row-start",
|
|
26018
|
-
"grid-row-end"
|
|
26019
|
-
],
|
|
26020
|
-
"grid-template": [
|
|
26021
|
-
"grid-template-columns",
|
|
26022
|
-
"grid-template-rows",
|
|
26023
|
-
"grid-template-areas"
|
|
26024
|
-
],
|
|
26025
|
-
"list-style": [
|
|
26026
|
-
"list-style-type",
|
|
26027
|
-
"list-style-position",
|
|
26028
|
-
"list-style-image"
|
|
26151
|
+
"border-style",
|
|
26152
|
+
"border-inline-end-color",
|
|
26153
|
+
"border-color"
|
|
26029
26154
|
],
|
|
26030
|
-
"
|
|
26031
|
-
"
|
|
26032
|
-
"
|
|
26033
|
-
"
|
|
26034
|
-
"
|
|
26155
|
+
"border-image": [
|
|
26156
|
+
"border-image-source",
|
|
26157
|
+
"border-image-slice",
|
|
26158
|
+
"border-image-width",
|
|
26159
|
+
"border-image-outset",
|
|
26160
|
+
"border-image-repeat"
|
|
26035
26161
|
],
|
|
26036
26162
|
"mask": [
|
|
26037
26163
|
"mask-image",
|
|
@@ -26043,6 +26169,50 @@ var require_main = __commonJS({
|
|
|
26043
26169
|
"mask-clip",
|
|
26044
26170
|
"mask-composite"
|
|
26045
26171
|
],
|
|
26172
|
+
"inline-size": [
|
|
26173
|
+
"width",
|
|
26174
|
+
"height"
|
|
26175
|
+
],
|
|
26176
|
+
"block-size": [
|
|
26177
|
+
"width",
|
|
26178
|
+
"height"
|
|
26179
|
+
],
|
|
26180
|
+
"max-inline-size": [
|
|
26181
|
+
"max-width",
|
|
26182
|
+
"max-height"
|
|
26183
|
+
],
|
|
26184
|
+
"max-block-size": [
|
|
26185
|
+
"max-width",
|
|
26186
|
+
"max-height"
|
|
26187
|
+
],
|
|
26188
|
+
"inset": [
|
|
26189
|
+
"inset-block",
|
|
26190
|
+
"inset-block-start",
|
|
26191
|
+
"inset-block-end",
|
|
26192
|
+
"inset-inline",
|
|
26193
|
+
"inset-inline-start",
|
|
26194
|
+
"inset-inline-end",
|
|
26195
|
+
"top",
|
|
26196
|
+
"right",
|
|
26197
|
+
"bottom",
|
|
26198
|
+
"left"
|
|
26199
|
+
],
|
|
26200
|
+
"inset-block": [
|
|
26201
|
+
"inset-block-start",
|
|
26202
|
+
"inset-block-end",
|
|
26203
|
+
"top",
|
|
26204
|
+
"right",
|
|
26205
|
+
"bottom",
|
|
26206
|
+
"left"
|
|
26207
|
+
],
|
|
26208
|
+
"inset-inline": [
|
|
26209
|
+
"inset-inline-start",
|
|
26210
|
+
"inset-inline-end",
|
|
26211
|
+
"top",
|
|
26212
|
+
"right",
|
|
26213
|
+
"bottom",
|
|
26214
|
+
"left"
|
|
26215
|
+
],
|
|
26046
26216
|
"outline": [
|
|
26047
26217
|
"outline-color",
|
|
26048
26218
|
"outline-style",
|
|
@@ -26052,28 +26222,6 @@ var require_main = __commonJS({
|
|
|
26052
26222
|
"overflow-x",
|
|
26053
26223
|
"overflow-y"
|
|
26054
26224
|
],
|
|
26055
|
-
"padding": [
|
|
26056
|
-
"padding-top",
|
|
26057
|
-
"padding-right",
|
|
26058
|
-
"padding-bottom",
|
|
26059
|
-
"padding-left"
|
|
26060
|
-
],
|
|
26061
|
-
"padding-inline": [
|
|
26062
|
-
"padding-inline-start",
|
|
26063
|
-
"padding-inline-end"
|
|
26064
|
-
],
|
|
26065
|
-
"padding-inline-start": [
|
|
26066
|
-
"padding-top",
|
|
26067
|
-
"padding-right",
|
|
26068
|
-
"padding-bottom",
|
|
26069
|
-
"padding-left"
|
|
26070
|
-
],
|
|
26071
|
-
"padding-inline-end": [
|
|
26072
|
-
"padding-top",
|
|
26073
|
-
"padding-right",
|
|
26074
|
-
"padding-bottom",
|
|
26075
|
-
"padding-left"
|
|
26076
|
-
],
|
|
26077
26225
|
"place-content": [
|
|
26078
26226
|
"align-content",
|
|
26079
26227
|
"justify-content"
|
|
@@ -26355,6 +26503,7 @@ var require_main = __commonJS({
|
|
|
26355
26503
|
"columns",
|
|
26356
26504
|
"contain",
|
|
26357
26505
|
"content",
|
|
26506
|
+
"content-visibility",
|
|
26358
26507
|
"counter-increment",
|
|
26359
26508
|
"counter-reset",
|
|
26360
26509
|
"counter-set",
|
|
@@ -26413,6 +26562,7 @@ var require_main = __commonJS({
|
|
|
26413
26562
|
"height",
|
|
26414
26563
|
"hyphenate-character",
|
|
26415
26564
|
"hyphens",
|
|
26565
|
+
"image-orientation",
|
|
26416
26566
|
"image-rendering",
|
|
26417
26567
|
"inline-size",
|
|
26418
26568
|
"inset",
|
|
@@ -26699,6 +26849,7 @@ var require_main = __commonJS({
|
|
|
26699
26849
|
"perspective-origin",
|
|
26700
26850
|
"appearance",
|
|
26701
26851
|
"visibility",
|
|
26852
|
+
"content-visibility",
|
|
26702
26853
|
"opacity",
|
|
26703
26854
|
"z-index",
|
|
26704
26855
|
"paint-order",
|
|
@@ -26853,6 +27004,7 @@ var require_main = __commonJS({
|
|
|
26853
27004
|
"padding-block",
|
|
26854
27005
|
"padding-block-start",
|
|
26855
27006
|
"padding-block-end",
|
|
27007
|
+
"image-orientation",
|
|
26856
27008
|
"image-rendering",
|
|
26857
27009
|
"aspect-ratio",
|
|
26858
27010
|
"width",
|
|
@@ -27004,6 +27156,7 @@ var require_main = __commonJS({
|
|
|
27004
27156
|
"display",
|
|
27005
27157
|
"appearance",
|
|
27006
27158
|
"visibility",
|
|
27159
|
+
"content-visibility",
|
|
27007
27160
|
"z-index",
|
|
27008
27161
|
"paint-order",
|
|
27009
27162
|
"position",
|
|
@@ -27303,6 +27456,7 @@ var require_main = __commonJS({
|
|
|
27303
27456
|
"cursor",
|
|
27304
27457
|
"empty-cells",
|
|
27305
27458
|
"filter",
|
|
27459
|
+
"image-orientation",
|
|
27306
27460
|
"image-rendering",
|
|
27307
27461
|
"mask",
|
|
27308
27462
|
"mask-border",
|
|
@@ -27484,7 +27638,7 @@ var require_src2 = __commonJS({
|
|
|
27484
27638
|
node.remove();
|
|
27485
27639
|
return;
|
|
27486
27640
|
}
|
|
27487
|
-
if (node.raws.between) {
|
|
27641
|
+
if (typeof node.raws.between === "string") {
|
|
27488
27642
|
node.raws.between = replaceComments(node.raws.between, list.space);
|
|
27489
27643
|
}
|
|
27490
27644
|
if (node.type === "decl") {
|
|
@@ -73219,7 +73373,7 @@ var require_src11 = __commonJS({
|
|
|
73219
73373
|
if (node.type !== "function") {
|
|
73220
73374
|
return false;
|
|
73221
73375
|
}
|
|
73222
|
-
return ["var", "env"].includes(node.value.toLowerCase());
|
|
73376
|
+
return ["var", "env", "constant"].includes(node.value.toLowerCase());
|
|
73223
73377
|
}
|
|
73224
73378
|
function shouldAbort(parsed) {
|
|
73225
73379
|
let abort = false;
|
|
@@ -73386,15 +73540,17 @@ var require_src12 = __commonJS({
|
|
|
73386
73540
|
}
|
|
73387
73541
|
return;
|
|
73388
73542
|
}
|
|
73389
|
-
const uniques = /* @__PURE__ */ new Set();
|
|
73390
73543
|
selector.walk((child) => {
|
|
73391
|
-
if (child.type === "selector") {
|
|
73392
|
-
const
|
|
73393
|
-
|
|
73394
|
-
|
|
73395
|
-
|
|
73396
|
-
|
|
73397
|
-
|
|
73544
|
+
if (child.type === "selector" && child.parent) {
|
|
73545
|
+
const uniques = /* @__PURE__ */ new Set();
|
|
73546
|
+
child.parent.each((sibling) => {
|
|
73547
|
+
const siblingStr = String(sibling);
|
|
73548
|
+
if (!uniques.has(siblingStr)) {
|
|
73549
|
+
uniques.add(siblingStr);
|
|
73550
|
+
} else {
|
|
73551
|
+
sibling.remove();
|
|
73552
|
+
}
|
|
73553
|
+
});
|
|
73398
73554
|
}
|
|
73399
73555
|
});
|
|
73400
73556
|
if (pseudoElements.has(value)) {
|
|
@@ -76531,7 +76687,7 @@ var require_src22 = __commonJS({
|
|
|
76531
76687
|
}
|
|
76532
76688
|
function intersect(a, b, not) {
|
|
76533
76689
|
return a.filter((c) => {
|
|
76534
|
-
const index =
|
|
76690
|
+
const index = indexOfDeclaration(b, c) !== -1;
|
|
76535
76691
|
return not ? !index : index;
|
|
76536
76692
|
});
|
|
76537
76693
|
}
|
|
@@ -76549,14 +76705,16 @@ var require_src22 = __commonJS({
|
|
|
76549
76705
|
return false;
|
|
76550
76706
|
}
|
|
76551
76707
|
const parent = sameParent(ruleA, ruleB);
|
|
76552
|
-
|
|
76553
|
-
if (parent && name && name.includes("keyframes")) {
|
|
76708
|
+
if (parent && ruleA.parent && ruleA.parent.type === "atrule" && ruleA.parent.name.includes("keyframes")) {
|
|
76554
76709
|
return false;
|
|
76555
76710
|
}
|
|
76556
76711
|
return parent && (selectors.every(noVendor) || sameVendor(a, b));
|
|
76557
76712
|
}
|
|
76713
|
+
function isDeclaration(node) {
|
|
76714
|
+
return node.type === "decl";
|
|
76715
|
+
}
|
|
76558
76716
|
function getDecls(rule) {
|
|
76559
|
-
return rule.nodes.filter(
|
|
76717
|
+
return rule.nodes.filter(isDeclaration);
|
|
76560
76718
|
}
|
|
76561
76719
|
var joinSelectors = (...rules) => rules.map((s) => s.selector).join();
|
|
76562
76720
|
function ruleLength(...rules) {
|
|
@@ -76673,7 +76831,7 @@ var require_src22 = __commonJS({
|
|
|
76673
76831
|
const secondClone = second.clone();
|
|
76674
76832
|
function moveDecl(callback) {
|
|
76675
76833
|
return (decl) => {
|
|
76676
|
-
if (
|
|
76834
|
+
if (indexOfDeclaration(intersection, decl) !== -1) {
|
|
76677
76835
|
callback.call(this, decl);
|
|
76678
76836
|
}
|
|
76679
76837
|
};
|
|
@@ -76722,12 +76880,12 @@ var require_src22 = __commonJS({
|
|
|
76722
76880
|
}
|
|
76723
76881
|
if (cache.selector === rule.selector) {
|
|
76724
76882
|
const cached = getDecls(cache);
|
|
76725
|
-
rule.walk((
|
|
76726
|
-
if (
|
|
76727
|
-
|
|
76883
|
+
rule.walk((node) => {
|
|
76884
|
+
if (node.type === "decl" && indexOfDeclaration(cached, node) !== -1) {
|
|
76885
|
+
node.remove();
|
|
76728
76886
|
return;
|
|
76729
76887
|
}
|
|
76730
|
-
cache.append(
|
|
76888
|
+
cache.append(node);
|
|
76731
76889
|
});
|
|
76732
76890
|
rule.remove();
|
|
76733
76891
|
return;
|
package/src/cli.js
CHANGED
|
@@ -484,6 +484,45 @@ async function build() {
|
|
|
484
484
|
return [beforePlugins, afterPlugins, config.options]
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
+
function loadBuiltinPostcssPlugins() {
|
|
488
|
+
let postcss = loadPostcss()
|
|
489
|
+
let IMPORT_COMMENT = '__TAILWIND_RESTORE_IMPORT__: '
|
|
490
|
+
return [
|
|
491
|
+
[
|
|
492
|
+
(root) => {
|
|
493
|
+
root.walkAtRules('import', (rule) => {
|
|
494
|
+
if (rule.params.slice(1).startsWith('tailwindcss/')) {
|
|
495
|
+
rule.after(postcss.comment({ text: IMPORT_COMMENT + rule.params }))
|
|
496
|
+
rule.remove()
|
|
497
|
+
}
|
|
498
|
+
})
|
|
499
|
+
},
|
|
500
|
+
(() => {
|
|
501
|
+
try {
|
|
502
|
+
return require('postcss-import')
|
|
503
|
+
} catch {}
|
|
504
|
+
|
|
505
|
+
return lazyPostcssImport()
|
|
506
|
+
})(),
|
|
507
|
+
(root) => {
|
|
508
|
+
root.walkComments((rule) => {
|
|
509
|
+
if (rule.text.startsWith(IMPORT_COMMENT)) {
|
|
510
|
+
rule.after(
|
|
511
|
+
postcss.atRule({
|
|
512
|
+
name: 'import',
|
|
513
|
+
params: rule.text.replace(IMPORT_COMMENT, ''),
|
|
514
|
+
})
|
|
515
|
+
)
|
|
516
|
+
rule.remove()
|
|
517
|
+
}
|
|
518
|
+
})
|
|
519
|
+
},
|
|
520
|
+
],
|
|
521
|
+
[],
|
|
522
|
+
{},
|
|
523
|
+
]
|
|
524
|
+
}
|
|
525
|
+
|
|
487
526
|
function resolveConfig() {
|
|
488
527
|
let config = configPath ? require(configPath) : {}
|
|
489
528
|
|
|
@@ -568,44 +607,9 @@ async function build() {
|
|
|
568
607
|
|
|
569
608
|
tailwindPlugin.postcss = true
|
|
570
609
|
|
|
571
|
-
let IMPORT_COMMENT = '__TAILWIND_RESTORE_IMPORT__: '
|
|
572
|
-
|
|
573
610
|
let [beforePlugins, afterPlugins, postcssOptions] = includePostCss
|
|
574
611
|
? await loadPostCssPlugins()
|
|
575
|
-
:
|
|
576
|
-
[
|
|
577
|
-
(root) => {
|
|
578
|
-
root.walkAtRules('import', (rule) => {
|
|
579
|
-
if (rule.params.slice(1).startsWith('tailwindcss/')) {
|
|
580
|
-
rule.after(postcss.comment({ text: IMPORT_COMMENT + rule.params }))
|
|
581
|
-
rule.remove()
|
|
582
|
-
}
|
|
583
|
-
})
|
|
584
|
-
},
|
|
585
|
-
(() => {
|
|
586
|
-
try {
|
|
587
|
-
return require('postcss-import')
|
|
588
|
-
} catch {}
|
|
589
|
-
|
|
590
|
-
return lazyPostcssImport()
|
|
591
|
-
})(),
|
|
592
|
-
(root) => {
|
|
593
|
-
root.walkComments((rule) => {
|
|
594
|
-
if (rule.text.startsWith(IMPORT_COMMENT)) {
|
|
595
|
-
rule.after(
|
|
596
|
-
postcss.atRule({
|
|
597
|
-
name: 'import',
|
|
598
|
-
params: rule.text.replace(IMPORT_COMMENT, ''),
|
|
599
|
-
})
|
|
600
|
-
)
|
|
601
|
-
rule.remove()
|
|
602
|
-
}
|
|
603
|
-
})
|
|
604
|
-
},
|
|
605
|
-
],
|
|
606
|
-
[],
|
|
607
|
-
{},
|
|
608
|
-
]
|
|
612
|
+
: loadBuiltinPostcssPlugins()
|
|
609
613
|
|
|
610
614
|
let plugins = [
|
|
611
615
|
...beforePlugins,
|
|
@@ -705,7 +709,9 @@ async function build() {
|
|
|
705
709
|
return resolveConfig()
|
|
706
710
|
}
|
|
707
711
|
|
|
708
|
-
let [beforePlugins, afterPlugins] = includePostCss
|
|
712
|
+
let [beforePlugins, afterPlugins] = includePostCss
|
|
713
|
+
? await loadPostCssPlugins()
|
|
714
|
+
: loadBuiltinPostcssPlugins()
|
|
709
715
|
|
|
710
716
|
let plugins = [
|
|
711
717
|
...beforePlugins,
|
package/src/corePlugins.js
CHANGED
|
@@ -14,6 +14,7 @@ import { version as tailwindVersion } from '../package.json'
|
|
|
14
14
|
import log from './util/log'
|
|
15
15
|
import { normalizeScreens } from './util/normalizeScreens'
|
|
16
16
|
import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
|
|
17
|
+
import { removeAlphaVariables } from './util/removeAlphaVariables'
|
|
17
18
|
import { flagEnabled } from './featureFlags'
|
|
18
19
|
|
|
19
20
|
export let variantPlugins = {
|
|
@@ -21,7 +22,19 @@ export let variantPlugins = {
|
|
|
21
22
|
addVariant('first-letter', '&::first-letter')
|
|
22
23
|
addVariant('first-line', '&::first-line')
|
|
23
24
|
|
|
24
|
-
addVariant('marker', [
|
|
25
|
+
addVariant('marker', [
|
|
26
|
+
({ container }) => {
|
|
27
|
+
removeAlphaVariables(container, ['--tw-text-opacity'])
|
|
28
|
+
|
|
29
|
+
return '& *::marker'
|
|
30
|
+
},
|
|
31
|
+
({ container }) => {
|
|
32
|
+
removeAlphaVariables(container, ['--tw-text-opacity'])
|
|
33
|
+
|
|
34
|
+
return '&::marker'
|
|
35
|
+
},
|
|
36
|
+
])
|
|
37
|
+
|
|
25
38
|
addVariant('selection', ['& *::selection', '&::selection'])
|
|
26
39
|
|
|
27
40
|
addVariant('file', '&::file-selector-button')
|
|
@@ -77,21 +90,11 @@ export let variantPlugins = {
|
|
|
77
90
|
[
|
|
78
91
|
'visited',
|
|
79
92
|
({ container }) => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
for (const varName of toRemove) {
|
|
90
|
-
if (decl.value.includes(`/ var(${varName})`)) {
|
|
91
|
-
decl.value = decl.value.replace(`/ var(${varName})`, '')
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
})
|
|
93
|
+
removeAlphaVariables(container, [
|
|
94
|
+
'--tw-text-opacity',
|
|
95
|
+
'--tw-border-opacity',
|
|
96
|
+
'--tw-bg-opacity',
|
|
97
|
+
])
|
|
95
98
|
|
|
96
99
|
return '&:visited'
|
|
97
100
|
},
|