tailwindcss 3.3.4 → 3.3.5

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 CHANGED
@@ -7,7 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- - Nothing yet!
10
+ ## [3.3.5] - 2023-10-25
11
+
12
+ ### Fixed
13
+
14
+ - Fix incorrect spaces around `-` in `calc()` expression ([#12283](https://github.com/tailwindlabs/tailwindcss/pull/12283))
11
15
 
12
16
  ## [3.3.4] - 2023-10-24
13
17
 
@@ -2283,7 +2287,8 @@ No release notes
2283
2287
 
2284
2288
  - Everything!
2285
2289
 
2286
- [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.4...HEAD
2290
+ [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.5...HEAD
2291
+ [3.3.5]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.4...v3.3.5
2287
2292
  [3.3.4]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.3...v3.3.4
2288
2293
  [3.3.3]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.2...v3.3.3
2289
2294
  [3.3.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.1...v3.3.2
@@ -122,6 +122,26 @@ function normalize(value, context = null, isRoot = true) {
122
122
  let preventFormattingInFunctions = [
123
123
  "theme"
124
124
  ];
125
+ let preventFormattingKeywords = [
126
+ "min-content",
127
+ "max-content",
128
+ "fit-content",
129
+ // Env
130
+ "safe-area-inset-top",
131
+ "safe-area-inset-right",
132
+ "safe-area-inset-bottom",
133
+ "safe-area-inset-left",
134
+ "titlebar-area-x",
135
+ "titlebar-area-y",
136
+ "titlebar-area-width",
137
+ "titlebar-area-height",
138
+ "keyboard-inset-top",
139
+ "keyboard-inset-right",
140
+ "keyboard-inset-bottom",
141
+ "keyboard-inset-left",
142
+ "keyboard-inset-width",
143
+ "keyboard-inset-height"
144
+ ];
125
145
  return value.replace(/(calc|min|max|clamp)\(.+\)/g, (match)=>{
126
146
  let result = "";
127
147
  function lastChar() {
@@ -158,6 +178,10 @@ function normalize(value, context = null, isRoot = true) {
158
178
  ")",
159
179
  ","
160
180
  ]);
181
+ } else if (preventFormattingKeywords.some((keyword)=>peek(keyword))) {
182
+ let keyword = preventFormattingKeywords.find((keyword)=>peek(keyword));
183
+ result += keyword;
184
+ i += keyword.length - 1;
161
185
  } else if (preventFormattingInFunctions.some((fn)=>peek(fn))) {
162
186
  result += consumeUntil([
163
187
  ")"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "3.3.4",
3
+ "version": "3.3.5",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -84,6 +84,29 @@ export function normalize(value, context = null, isRoot = true) {
84
84
  */
85
85
  function normalizeMathOperatorSpacing(value) {
86
86
  let preventFormattingInFunctions = ['theme']
87
+ let preventFormattingKeywords = [
88
+ 'min-content',
89
+ 'max-content',
90
+ 'fit-content',
91
+
92
+ // Env
93
+ 'safe-area-inset-top',
94
+ 'safe-area-inset-right',
95
+ 'safe-area-inset-bottom',
96
+ 'safe-area-inset-left',
97
+
98
+ 'titlebar-area-x',
99
+ 'titlebar-area-y',
100
+ 'titlebar-area-width',
101
+ 'titlebar-area-height',
102
+
103
+ 'keyboard-inset-top',
104
+ 'keyboard-inset-right',
105
+ 'keyboard-inset-bottom',
106
+ 'keyboard-inset-left',
107
+ 'keyboard-inset-width',
108
+ 'keyboard-inset-height',
109
+ ]
87
110
 
88
111
  return value.replace(/(calc|min|max|clamp)\(.+\)/g, (match) => {
89
112
  let result = ''
@@ -126,6 +149,13 @@ function normalizeMathOperatorSpacing(value) {
126
149
  result += consumeUntil([')', ','])
127
150
  }
128
151
 
152
+ // Skip formatting of known keywords
153
+ else if (preventFormattingKeywords.some((keyword) => peek(keyword))) {
154
+ let keyword = preventFormattingKeywords.find((keyword) => peek(keyword))
155
+ result += keyword
156
+ i += keyword.length - 1
157
+ }
158
+
129
159
  // Skip formatting inside known functions
130
160
  else if (preventFormattingInFunctions.some((fn) => peek(fn))) {
131
161
  result += consumeUntil([')'])