Skip to content

Commit

Permalink
Breaking: Remove support for legacy AOT mode (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
stormwarning authored Mar 25, 2022
1 parent a28cad8 commit aa9273c
Show file tree
Hide file tree
Showing 15 changed files with 310 additions and 416 deletions.
7 changes: 7 additions & 0 deletions .changeset/fluffy-goats-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'tailwindcss-opentype': major
---

Drop support for legacy AOT mode in order to support v3

Plugin no longer supports v1, may work in v2 as long as JIT mode is enabled.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ npm install tailwindcss-opentype
- [Utility OpenType](https://github.com/kennethormandy/utility-opentype) by [@kennethormandy](https://github.com/kennethormandy)
- [OpenType Features](https://sparanoid.com/lab/opentype-features/) by [@sparanoid](https://github.com/sparanoid)

## Related

[✂️ tailwindcss-capsize](https://github.com/stormwarning/tailwindcss-capsize) — Utility classes for trimming leading whitespace.


[npm-url]: https://www.npmjs.com/package/tailwindcss-opentype
[npm-img]: https://img.shields.io/npm/v/tailwindcss-opentype.svg?style=flat-square
[npm-dls]: https://img.shields.io/npm/dt/tailwindcss-opentype.svg?style=flat-square
4 changes: 2 additions & 2 deletions docs/.eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ module.exports = function (eleventyConfig) {
} else {
let linkClass = [
'px-3 py-2 transition-colors duration-200 relative block',
isSelected && 'text-light-blue-700',
isSelected && 'text-sky-700',
!isSelected && 'hover:text-grey-900 text-grey-500',
].join(' ')

tag = dedent`<a class="${linkClass}" href="${url}">
<span class="rounded-md absolute inset-0 bg-light-blue-50 ${
<span class="rounded-md absolute inset-0 bg-sky-50 ${
!isSelected && 'opacity-0'
}"></span>
<span class="relative">${content}</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
.token.punctuation,
.token.module,
.token.property {
@apply text-light-blue-200;
@apply text-sky-200;
}

.token.atapply .token:not(.rule):not(.important) {
Expand Down
6 changes: 0 additions & 6 deletions docs/src/feature-alternates.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@ classData: ot-alternates

## Usage

:::reminder

**Remember:** Unless you're using Tailwind's [JIT mode](https://tailwindcss.com/docs/just-in-time-mode) — enabled in v3+, optional in v2.1+ — these utilities rely on the `.font-features` class to activate.

These utilities provide access to OpenType alternate glyph features not currently available via the higher-level CSS properties. For other alternate glyph features, use the [Font Variant Alternates](/font-variant-alternates) utilities.

:::

### Stylistic sets :feat[ss01–ss20]

This feature replaces sets of default character glyphs with stylistic variants. Glyphs in stylistic sets may be designed to harmonise visually, interact in particular ways, or otherwise work together.
Expand Down
6 changes: 0 additions & 6 deletions docs/src/feature-ligatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ classData: ot-ligatures

## Usage

:::reminder

**Remember:** these utilities rely on the `.font-features` class to activate. If you're using Tailwind's [JIT mode](https://tailwindcss.com/docs/just-in-time-mode), the extra class is _not_ required.

:::

These utilities provide access to OpenType ligature features not currently available via the higher-level CSS properties. For other ligature features, use the [Font Variant Ligatures](/font-variant-ligatures) utilities.

### Historical ligatures :feat[hlig]
Expand Down
6 changes: 0 additions & 6 deletions docs/src/feature-position.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ classData: position

## Usage

:::reminder

**Remember:** these utilities rely on the `.font-features` class to activate (until [browser support](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-position#browser_compatibility) for `font-variant-position` is better). If you're using Tailwind's [JIT mode](https://tailwindcss.com/docs/just-in-time-mode), the extra class is _not_ required.

:::

While it is possible to use the `font-variant-position` utilities at the "block" level, depending on the typeface this may result in other characters being substituted for the repositioned glyphs. To avoid this, wrap the appropriate characters in an inline element, such as `<sup>` or `<sub>`.

Using `<sup>` or `<sub>` elements has its own pitfalls, however. Common "reset" styles and even browser default styles often try to approximate superscript or subscript glyphs, which should be disabled if you are using a font designed with these features. These resets and defaults vary, so these utilities don't attempt to disable any default styles for these elements. Either account for this in your own baseline styles, or use a more neutral wrapper, like `<span>`.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/includes/class-table.njk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
>
{{- class -}}
</td>
<td class="py-2 pl-2 font-mono text-xs text-light-blue-600 whitespace-pre {{ 'border-t border-grey-200' if loop.index0 !== 0 }}">
<td class="py-2 pl-2 font-mono text-xs text-sky-600 whitespace-pre {{ 'border-t border-grey-200' if loop.index0 !== 0 }}">
{{- property -}}
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
id="nav"
>
<a class="inline-flex px-3" href="{{ '/' | url }}">
<div class="w-12 h-12 rounded-xl mb-8 bg-gradient-to-br flex items-center justify-center from-cyan-400 to-light-blue-500">
<div class="w-12 h-12 rounded-xl mb-8 bg-gradient-to-br flex items-center justify-center from-cyan-400 to-sky-500">
{% include 'logo.njk' %}
</div>
</a>
Expand Down
8 changes: 3 additions & 5 deletions docs/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ const defaultTheme = require('tailwindcss/defaultTheme')
const opentypePlugin = require('../dist/index')

module.exports = {
mode: 'jit',
purge: [
content: [
'./docs/src/**/*.{html,md,njk}',
'./docs/.eleventy.js',
'./docs/remark/*.js',
],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {
colors: {
grey: colors.coolGray,
grey: colors.gray,
amber: colors.amber,
orange: colors.orange,
rose: colors.rose,
Expand All @@ -25,7 +23,7 @@ module.exports = {
emerald: colors.emerald,
teal: colors.teal,
cyan: colors.cyan,
'light-blue': colors.lightBlue,
sky: colors.sky,
violet: colors.violet,
},

Expand Down
Loading

0 comments on commit aa9273c

Please sign in to comment.