From 52b77413d4d57d3660e5eca47c720be03c3d6225 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 2 Nov 2023 12:35:01 +0800 Subject: [PATCH 1/3] Use the default font-feature-settings for mono --- src/css/preflight.css | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/css/preflight.css b/src/css/preflight.css index d223cc6c265d..b4cb52b01288 100644 --- a/src/css/preflight.css +++ b/src/css/preflight.css @@ -102,8 +102,10 @@ strong { } /* -1. Use the user's configured `mono` font family by default. -2. Correct the odd `em` font sizing in all browsers. +1. Use the user's configured `mono` font-family by default. +2. Use the user's configured `mono` font-feature-settings by default. +3. Use the user's configured `mono` font-variation-settings by default. +4. Correct the odd `em` font sizing in all browsers. */ code, @@ -111,7 +113,9 @@ kbd, samp, pre { font-family: theme('fontFamily.mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); /* 1 */ - font-size: 1em; /* 2 */ + font-feature-settings: theme('fontFamily.mono[1].fontFeatureSettings', normal); /* 2 */ + font-variation-settings: theme('fontFamily.mono[1].fontVariationSettings', normal); /* 3 */ + font-size: 1em; /* 4 */ } /* From e4c6fb517a8178b67f60dd05ddc139ba5c4dbd6a Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 2 Nov 2023 12:42:48 +0800 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 121dc7500e1d..83695cd8bf22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [Oxide] Fix source maps issue resulting in a crash ([#11319](https://github.com/tailwindlabs/tailwindcss/pull/11319)) - [Oxide] Fallback to RegEx based parser when using custom transformers or extractors ([#11335](https://github.com/tailwindlabs/tailwindcss/pull/11335)) - [Oxide] Bump `lightningcss` and reflect related improvements in tests ([#11550](https://github.com/tailwindlabs/tailwindcss/pull/11550)) +- Ensure configured `font-feature-settings` for `mono` are included in Preflight ([#12342](https://github.com/tailwindlabs/tailwindcss/pull/12342)) ### Added From f6b96f1b84a214e6e0ee92acdfce6717e0e5a47c Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Thu, 2 Nov 2023 10:46:10 -0400 Subject: [PATCH 3/3] Update tests --- .../__snapshots__/preflight.test.js.snap | 4 + tests/source-maps.test.js | 414 +++++++++--------- 2 files changed, 212 insertions(+), 206 deletions(-) diff --git a/tests/plugins/__snapshots__/preflight.test.js.snap b/tests/plugins/__snapshots__/preflight.test.js.snap index 400cb24f31bb..f57ab0ec5eed 100644 --- a/tests/plugins/__snapshots__/preflight.test.js.snap +++ b/tests/plugins/__snapshots__/preflight.test.js.snap @@ -53,6 +53,8 @@ b, strong { } code, kbd, samp, pre { + font-feature-settings: normal; + font-variation-settings: normal; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace; font-size: 1em; } @@ -251,6 +253,8 @@ b, strong { } code, kbd, samp, pre { + font-feature-settings: normal; + font-variation-settings: normal; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace; font-size: 1em; } diff --git a/tests/source-maps.test.js b/tests/source-maps.test.js index 3e31dda2f2d6..52af46aa2572 100644 --- a/tests/source-maps.test.js +++ b/tests/source-maps.test.js @@ -128,266 +128,268 @@ test('preflight + base have source maps', async () => { "49:2-21 -> 49:2-21", "50:0 -> 50:0", "52:0 -> 52:0", - "53:2-109 -> 53:2-109", - "54:2-16 -> 54:2-16", - "55:0 -> 55:0", + "53:2-31 -> 53:2-31", + "54:2-33 -> 54:2-33", + "55:2-109 -> 55:2-109", + "56:2-16 -> 56:2-16", "57:0 -> 57:0", - "58:2-16 -> 58:2-16", "59:0 -> 59:0", + "60:2-16 -> 60:2-16", "61:0 -> 61:0", - "62:2-26 -> 62:2-26", - "63:2-16 -> 63:2-16", - "64:2-16 -> 64:2-16", - "65:2-20 -> 65:2-20", - "66:0 -> 66:0", + "63:0 -> 63:0", + "64:2-26 -> 64:2-26", + "65:2-16 -> 65:2-16", + "66:2-16 -> 66:2-16", + "67:2-20 -> 67:2-20", "68:0 -> 68:0", - "69:2-16 -> 69:2-16", "70:0 -> 70:0", + "71:2-16 -> 71:2-16", "72:0 -> 72:0", - "73:2-12 -> 73:2-12", "74:0 -> 74:0", + "75:2-12 -> 75:2-12", "76:0 -> 76:0", - "77:2-16 -> 77:2-16", - "78:2-23 -> 78:2-23", - "79:2-27 -> 79:2-27", - "80:0 -> 80:0", + "78:0 -> 78:0", + "79:2-16 -> 79:2-16", + "80:2-23 -> 80:2-23", + "81:2-27 -> 81:2-27", "82:0 -> 82:0", - "83:2-32 -> 83:2-32", - "84:2-34 -> 84:2-34", - "85:2-22 -> 85:2-22", - "86:2-17 -> 86:2-17", + "84:0 -> 84:0", + "85:2-32 -> 85:2-32", + "86:2-34 -> 86:2-34", "87:2-22 -> 87:2-22", - "88:2-22 -> 88:2-22", - "89:2-16 -> 89:2-16", - "90:2-11 -> 90:2-11", - "91:2-12 -> 91:2-12", - "92:0 -> 92:0", + "88:2-17 -> 88:2-17", + "89:2-22 -> 89:2-22", + "90:2-22 -> 90:2-22", + "91:2-16 -> 91:2-16", + "92:2-11 -> 92:2-11", + "93:2-12 -> 93:2-12", "94:0 -> 94:0", - "95:2-22 -> 95:2-22", "96:0 -> 96:0", + "97:2-22 -> 97:2-22", "98:0 -> 98:0", - "99:2-28 -> 99:2-28", - "100:2-25 -> 100:2-25", - "101:2-24 -> 101:2-24", - "102:0 -> 102:0", + "100:0 -> 100:0", + "101:2-28 -> 101:2-28", + "102:2-25 -> 102:2-25", + "103:2-24 -> 103:2-24", "104:0 -> 104:0", - "105:2-15 -> 105:2-15", "106:0 -> 106:0", + "107:2-15 -> 107:2-15", "108:0 -> 108:0", - "109:2-18 -> 109:2-18", "110:0 -> 110:0", + "111:2-18 -> 111:2-18", "112:0 -> 112:0", - "113:2-26 -> 113:2-26", "114:0 -> 114:0", + "115:2-26 -> 115:2-26", "116:0 -> 116:0", - "117:2-14 -> 117:2-14", "118:0 -> 118:0", + "119:2-14 -> 119:2-14", "120:0 -> 120:0", - "121:2-14 -> 121:2-14", "122:0 -> 122:0", + "123:2-14 -> 123:2-14", "124:0 -> 124:0", - "125:2-31 -> 125:2-31", - "126:2-22 -> 126:2-22", - "127:0 -> 127:0", + "126:0 -> 126:0", + "127:2-31 -> 127:2-31", + "128:2-22 -> 128:2-22", "129:0 -> 129:0", - "130:2-26 -> 130:2-26", "131:0 -> 131:0", + "132:2-26 -> 132:2-26", "133:0 -> 133:0", - "134:2-28 -> 134:2-28", - "135:2-15 -> 135:2-15", - "136:0 -> 136:0", + "135:0 -> 135:0", + "136:2-28 -> 136:2-28", + "137:2-15 -> 137:2-15", "138:0 -> 138:0", - "139:2-20 -> 139:2-20", "140:0 -> 140:0", + "141:2-20 -> 141:2-20", "142:0 -> 142:0", - "143:2-11 -> 143:2-11", "144:0 -> 144:0", + "145:2-11 -> 145:2-11", "146:0 -> 146:0", - "147:2-11 -> 147:2-11", - "148:2-12 -> 148:2-12", - "149:0 -> 149:0", + "148:0 -> 148:0", + "149:2-11 -> 149:2-11", + "150:2-12 -> 150:2-12", "151:0 -> 151:0", - "152:2-12 -> 152:2-12", "153:0 -> 153:0", + "154:2-12 -> 154:2-12", "155:0 -> 155:0", - "156:2-11 -> 156:2-11", - "157:2-12 -> 157:2-12", - "158:2-18 -> 158:2-18", - "159:0 -> 159:0", + "157:0 -> 157:0", + "158:2-11 -> 158:2-11", + "159:2-12 -> 159:2-12", + "160:2-18 -> 160:2-18", "161:0 -> 161:0", - "162:2-12 -> 162:2-12", "163:0 -> 163:0", + "164:2-12 -> 164:2-12", "165:0 -> 165:0", - "166:2-18 -> 166:2-18", "167:0 -> 167:0", + "168:2-18 -> 168:2-18", "169:0 -> 169:0", - "170:2-12 -> 170:2-12", - "171:2-16 -> 171:2-16", - "172:0 -> 172:0", + "171:0 -> 171:0", + "172:2-12 -> 172:2-12", + "173:2-16 -> 173:2-16", "174:0 -> 174:0", - "175:2-17 -> 175:2-17", "176:0 -> 176:0", + "177:2-17 -> 177:2-17", "178:0 -> 178:0", - "179:2-17 -> 179:2-17", "180:0 -> 180:0", + "181:2-17 -> 181:2-17", "182:0 -> 182:0", - "183:2-24 -> 183:2-24", - "184:2-16 -> 184:2-16", - "185:0 -> 185:0", + "184:0 -> 184:0", + "185:2-24 -> 185:2-24", + "186:2-16 -> 186:2-16", "187:0 -> 187:0", - "188:2-17 -> 188:2-17", - "189:2-14 -> 189:2-14", - "190:0 -> 190:0", + "189:0 -> 189:0", + "190:2-17 -> 190:2-17", + "191:2-14 -> 191:2-14", "192:0 -> 192:0", - "193:2-15 -> 193:2-15", "194:0 -> 194:0", + "195:2-15 -> 195:2-15", "196:0 -> 196:0", - "197:2-26 -> 197:2-26", - "198:2-26 -> 198:2-26", - "199:2-21 -> 199:2-21", - "200:2-21 -> 200:2-21", - "201:2-16 -> 201:2-16", - "202:2-16 -> 202:2-16", + "198:0 -> 198:0", + "199:2-26 -> 199:2-26", + "200:2-26 -> 200:2-26", + "201:2-21 -> 201:2-21", + "202:2-21 -> 202:2-21", "203:2-16 -> 203:2-16", - "204:2-17 -> 204:2-17", - "205:2-17 -> 205:2-17", - "206:2-14 -> 206:2-14", - "207:2-14 -> 207:2-14", - "208:2-19 -> 208:2-19", - "209:2-40 -> 209:2-40", - "210:2-31 -> 210:2-31", - "211:2-30 -> 211:2-30", - "212:2-29 -> 212:2-29", - "213:2-16 -> 213:2-16", - "214:2-21 -> 214:2-21", - "215:2-23 -> 215:2-23", - "216:2-24 -> 216:2-24", - "217:2-25 -> 217:2-25", - "218:2-19 -> 218:2-19", - "219:2-29 -> 219:2-29", - "220:2-30 -> 220:2-30", - "221:2-28 -> 221:2-28", - "222:2-36 -> 222:2-36", - "223:2-29 -> 223:2-29", - "224:2-24 -> 224:2-24", - "225:2-32 -> 225:2-32", - "226:2-13 -> 226:2-13", - "227:2-19 -> 227:2-19", - "228:2-17 -> 228:2-17", - "229:2-18 -> 229:2-18", - "230:2-19 -> 230:2-19", - "231:2-15 -> 231:2-15", - "232:2-17 -> 232:2-17", - "233:2-14 -> 233:2-14", - "234:2-20 -> 234:2-20", - "235:2-22 -> 235:2-22", - "236:2-28 -> 236:2-28", - "237:2-26 -> 237:2-26", - "238:2-27 -> 238:2-27", - "239:2-28 -> 239:2-28", - "240:2-24 -> 240:2-24", - "241:2-25 -> 241:2-25", - "242:2-26 -> 242:2-26", - "243:2-23 -> 243:2-23", - "244:0 -> 244:0", + "204:2-16 -> 204:2-16", + "205:2-16 -> 205:2-16", + "206:2-17 -> 206:2-17", + "207:2-17 -> 207:2-17", + "208:2-14 -> 208:2-14", + "209:2-14 -> 209:2-14", + "210:2-19 -> 210:2-19", + "211:2-40 -> 211:2-40", + "212:2-31 -> 212:2-31", + "213:2-30 -> 213:2-30", + "214:2-29 -> 214:2-29", + "215:2-16 -> 215:2-16", + "216:2-21 -> 216:2-21", + "217:2-23 -> 217:2-23", + "218:2-24 -> 218:2-24", + "219:2-25 -> 219:2-25", + "220:2-19 -> 220:2-19", + "221:2-29 -> 221:2-29", + "222:2-30 -> 222:2-30", + "223:2-28 -> 223:2-28", + "224:2-36 -> 224:2-36", + "225:2-29 -> 225:2-29", + "226:2-24 -> 226:2-24", + "227:2-32 -> 227:2-32", + "228:2-13 -> 228:2-13", + "229:2-19 -> 229:2-19", + "230:2-17 -> 230:2-17", + "231:2-18 -> 231:2-18", + "232:2-19 -> 232:2-19", + "233:2-15 -> 233:2-15", + "234:2-17 -> 234:2-17", + "235:2-14 -> 235:2-14", + "236:2-20 -> 236:2-20", + "237:2-22 -> 237:2-22", + "238:2-28 -> 238:2-28", + "239:2-26 -> 239:2-26", + "240:2-27 -> 240:2-27", + "241:2-28 -> 241:2-28", + "242:2-24 -> 242:2-24", + "243:2-25 -> 243:2-25", + "244:2-26 -> 244:2-26", + "245:2-23 -> 245:2-23", "246:0 -> 246:0", - "247:2-26 -> 247:2-26", - "248:2-26 -> 248:2-26", - "249:2-21 -> 249:2-21", - "250:2-21 -> 250:2-21", - "251:2-16 -> 251:2-16", - "252:2-16 -> 252:2-16", + "248:0 -> 248:0", + "249:2-26 -> 249:2-26", + "250:2-26 -> 250:2-26", + "251:2-21 -> 251:2-21", + "252:2-21 -> 252:2-21", "253:2-16 -> 253:2-16", - "254:2-17 -> 254:2-17", - "255:2-17 -> 255:2-17", - "256:2-14 -> 256:2-14", - "257:2-14 -> 257:2-14", - "258:2-19 -> 258:2-19", - "259:2-40 -> 259:2-40", - "260:2-31 -> 260:2-31", - "261:2-30 -> 261:2-30", - "262:2-29 -> 262:2-29", - "263:2-16 -> 263:2-16", - "264:2-21 -> 264:2-21", - "265:2-23 -> 265:2-23", - "266:2-24 -> 266:2-24", - "267:2-25 -> 267:2-25", - "268:2-19 -> 268:2-19", - "269:2-29 -> 269:2-29", - "270:2-30 -> 270:2-30", - "271:2-28 -> 271:2-28", - "272:2-36 -> 272:2-36", - "273:2-29 -> 273:2-29", - "274:2-24 -> 274:2-24", - "275:2-32 -> 275:2-32", - "276:2-13 -> 276:2-13", - "277:2-19 -> 277:2-19", - "278:2-17 -> 278:2-17", - "279:2-18 -> 279:2-18", - "280:2-19 -> 280:2-19", - "281:2-15 -> 281:2-15", - "282:2-17 -> 282:2-17", - "283:2-14 -> 283:2-14", - "284:2-20 -> 284:2-20", - "285:2-22 -> 285:2-22", - "286:2-28 -> 286:2-28", - "287:2-26 -> 287:2-26", - "288:2-27 -> 288:2-27", - "289:2-28 -> 289:2-28", - "290:2-24 -> 290:2-24", - "291:2-25 -> 291:2-25", - "292:2-26 -> 292:2-26", - "293:2-23 -> 293:2-23", - "294:0 -> 294:0", + "254:2-16 -> 254:2-16", + "255:2-16 -> 255:2-16", + "256:2-17 -> 256:2-17", + "257:2-17 -> 257:2-17", + "258:2-14 -> 258:2-14", + "259:2-14 -> 259:2-14", + "260:2-19 -> 260:2-19", + "261:2-40 -> 261:2-40", + "262:2-31 -> 262:2-31", + "263:2-30 -> 263:2-30", + "264:2-29 -> 264:2-29", + "265:2-16 -> 265:2-16", + "266:2-21 -> 266:2-21", + "267:2-23 -> 267:2-23", + "268:2-24 -> 268:2-24", + "269:2-25 -> 269:2-25", + "270:2-19 -> 270:2-19", + "271:2-29 -> 271:2-29", + "272:2-30 -> 272:2-30", + "273:2-28 -> 273:2-28", + "274:2-36 -> 274:2-36", + "275:2-29 -> 275:2-29", + "276:2-24 -> 276:2-24", + "277:2-32 -> 277:2-32", + "278:2-13 -> 278:2-13", + "279:2-19 -> 279:2-19", + "280:2-17 -> 280:2-17", + "281:2-18 -> 281:2-18", + "282:2-19 -> 282:2-19", + "283:2-15 -> 283:2-15", + "284:2-17 -> 284:2-17", + "285:2-14 -> 285:2-14", + "286:2-20 -> 286:2-20", + "287:2-22 -> 287:2-22", + "288:2-28 -> 288:2-28", + "289:2-26 -> 289:2-26", + "290:2-27 -> 290:2-27", + "291:2-28 -> 291:2-28", + "292:2-24 -> 292:2-24", + "293:2-25 -> 293:2-25", + "294:2-26 -> 294:2-26", + "295:2-23 -> 295:2-23", "296:0 -> 296:0", - "297:2-26 -> 297:2-26", - "298:2-26 -> 298:2-26", - "299:2-21 -> 299:2-21", - "300:2-21 -> 300:2-21", - "301:2-16 -> 301:2-16", - "302:2-16 -> 302:2-16", + "298:0 -> 298:0", + "299:2-26 -> 299:2-26", + "300:2-26 -> 300:2-26", + "301:2-21 -> 301:2-21", + "302:2-21 -> 302:2-21", "303:2-16 -> 303:2-16", - "304:2-17 -> 304:2-17", - "305:2-17 -> 305:2-17", - "306:2-14 -> 306:2-14", - "307:2-14 -> 307:2-14", - "308:2-19 -> 308:2-19", - "309:2-40 -> 309:2-40", - "310:2-31 -> 310:2-31", - "311:2-30 -> 311:2-30", - "312:2-29 -> 312:2-29", - "313:2-16 -> 313:2-16", - "314:2-21 -> 314:2-21", - "315:2-23 -> 315:2-23", - "316:2-24 -> 316:2-24", - "317:2-25 -> 317:2-25", - "318:2-19 -> 318:2-19", - "319:2-29 -> 319:2-29", - "320:2-30 -> 320:2-30", - "321:2-28 -> 321:2-28", - "322:2-36 -> 322:2-36", - "323:2-29 -> 323:2-29", - "324:2-24 -> 324:2-24", - "325:2-32 -> 325:2-32", - "326:2-13 -> 326:2-13", - "327:2-19 -> 327:2-19", - "328:2-17 -> 328:2-17", - "329:2-18 -> 329:2-18", - "330:2-19 -> 330:2-19", - "331:2-15 -> 331:2-15", - "332:2-17 -> 332:2-17", - "333:2-14 -> 333:2-14", - "334:2-20 -> 334:2-20", - "335:2-22 -> 335:2-22", - "336:2-28 -> 336:2-28", - "337:2-26 -> 337:2-26", - "338:2-27 -> 338:2-27", - "339:2-28 -> 339:2-28", - "340:2-24 -> 340:2-24", - "341:2-25 -> 341:2-25", - "342:2-26 -> 342:2-26", - "343:2-23 -> 343:2-23", - "344:0 -> 344:0", + "304:2-16 -> 304:2-16", + "305:2-16 -> 305:2-16", + "306:2-17 -> 306:2-17", + "307:2-17 -> 307:2-17", + "308:2-14 -> 308:2-14", + "309:2-14 -> 309:2-14", + "310:2-19 -> 310:2-19", + "311:2-40 -> 311:2-40", + "312:2-31 -> 312:2-31", + "313:2-30 -> 313:2-30", + "314:2-29 -> 314:2-29", + "315:2-16 -> 315:2-16", + "316:2-21 -> 316:2-21", + "317:2-23 -> 317:2-23", + "318:2-24 -> 318:2-24", + "319:2-25 -> 319:2-25", + "320:2-19 -> 320:2-19", + "321:2-29 -> 321:2-29", + "322:2-30 -> 322:2-30", + "323:2-28 -> 323:2-28", + "324:2-36 -> 324:2-36", + "325:2-29 -> 325:2-29", + "326:2-24 -> 326:2-24", + "327:2-32 -> 327:2-32", + "328:2-13 -> 328:2-13", + "329:2-19 -> 329:2-19", + "330:2-17 -> 330:2-17", + "331:2-18 -> 331:2-18", + "332:2-19 -> 332:2-19", + "333:2-15 -> 333:2-15", + "334:2-17 -> 334:2-17", + "335:2-14 -> 335:2-14", + "336:2-20 -> 336:2-20", + "337:2-22 -> 337:2-22", + "338:2-28 -> 338:2-28", + "339:2-26 -> 339:2-26", + "340:2-27 -> 340:2-27", + "341:2-28 -> 341:2-28", + "342:2-24 -> 342:2-24", + "343:2-25 -> 343:2-25", + "344:2-26 -> 344:2-26", + "345:2-23 -> 345:2-23", + "346:0 -> 346:0", ] `) })