=== TokenForge ===
Contributors: pristadigital
Tags: design tokens, css variables, accessibility, woocommerce
Requires at least: 5.9
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.58.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Design tokens, fluid scales, utility classes, contrast and accessibility checks for any WordPress site, with Bricks and WooCommerce support.

== Description ==

TokenForge is a design system you set up once and use everywhere. Colours, type and spacing scales, layout, buttons, cards, icons and effects become CSS variables and classes in one static stylesheet, loaded on the front end, in the block editor and in your page builder.

A new site starts ready with a complete starter design system. Reset to defaults any time, for everything or one section. The built-in Manual (TokenForge, Manual) explains every screen.

**Design system**

* Colour families with light and dark shades from one colour, live preview, and dark mode by section with a light or dark switch (shortcode or block).
* Fluid type and spacing scales from one setting each, a width scale, grids and automatic gaps.
* Layout, borders, radius, shadows, icons, buttons, cards, overlays and prose styles.
* Utility classes for spacing, grids, flex grids, flex and alignment, text and more, with optional breakpoint variants. Unused classes can be left out after a site scan.
* Effects: entrance, exit, hover, border and scroll effects, and optional default effects for your buttons.
* A Tokens screen that lists every variable, where it comes from and where it is used.

**Builders and the block editor**

* Works with the block editor, Bricks, Etch, Oxygen, Breakdance, Divi and Elementor. Bricks has the deepest support.
* In every supported builder: the TokenForge window, variables and classes by right-click, the input helper, suggestions and recipes in the custom CSS box, text recipes, a light and dark preview of the canvas, and the TokenForge stylesheet in the canvas.
* Block editor: your tokens become the editor presets, plus patterns, button styles, a class field and optional editor tools.
* Bricks: two-way sync with Bricks variables, colours, global classes and the theme style, a design check, a BEM class generator, form element extensions and a setup wizard.

**Accessibility**

* Contrast check of text, links, focus rings and buttons in light and dark mode (WCAG 2 AA, APCA shown), with a suggested token applied in one click.
* Optional automatic attributes: hidden decorative icons, alt text, menu labels, the current page mark and a new tab notice.
* A page check in the builder (axe-core), only when an administrator presses Run check.
* Data attributes for layout and behaviour without code (data-tf-stack, data-tf-space, data-tf-surface, data-tf-reveal, data-tf-tooltip, data-tf-filter and more).

**Fonts, WooCommerce and tools**

* Self-hosted fonts: upload TTF or OTF and get WOFF2, or download a Google font once to your server.
* WooCommerce shop, product, cart, checkout and account pages and blocks styled with your tokens, each part with its own switch.
* Export and import settings (with a preview), W3C design token files for Figma, Tokens Studio and Style Dictionary, the settings history (last 20 saves, undoable), WP-CLI commands and tools for AI agents.
* Moving from another utility framework? The settings import under Import, export & reset brings your settings across, and its class names work too.

**Developers**

The filter `tokenforge_global_scss` returns SCSS that TokenForge compiles and adds last to the stylesheet (put it in a child theme or a mu-plugin). The action `tokenforge_builder_enqueue` loads an add-on's assets in every supported builder, and `tokenforge_block_editor_enqueue` in the block editor. Details and examples are in the Manual.

TokenForge is original software released under the GPLv2 or later, developed by Prista Digital (https://pristadigital.com).

== Installation ==

1. Install the zip from Plugins, Add New, Upload, or upload the `tokenforge` folder to `/wp-content/plugins/`.
2. Activate. A new site starts with the starter design system.
3. Open **TokenForge** in the admin menu, change what you like and save. TokenForge, Manual explains each screen.

== Frequently Asked Questions ==

= Do I need a page builder? =

No. The stylesheet loads on the front end and in the block editor. The builder tools switch on only with Bricks, Etch, Oxygen, Breakdance, Elementor or Divi 5.

= Will it slow my site down? =

No CSS is built while a page loads: TokenForge writes one static stylesheet when you save. You can print it inline, switch off sections you do not use and leave out unused utility classes. Shop styles are a second file loaded only where the shop shows.

= How do I switch from another utility framework? =

Open Import, export & reset, press the settings import button and confirm. Colours, scales, layout, typography, buttons, cards, components, overlays and fonts come across; custom CSS does not. The settings history can undo it.

= Can I add my own CSS? =

Yes: in your builder's custom CSS box or the Customizer's Additional CSS. Developers can add SCSS with the `tokenforge_global_scss` filter.

= What happens when I deactivate or delete TokenForge? =

Deactivating stops the stylesheet; settings stay. Deleting removes the settings, the generated stylesheets and what TokenForge added to Bricks. Uploaded font files stay in `uploads/tokenforge/fonts/`.

= Does TokenForge keep anything about visitors? =

Only what your forms ask for: send counts for forms with a send limit, and the last send time per signed-in user for per-user limits. In the visitor's browser: their light or dark choice, and, where you turn it on, unsent form answers. Deleting TokenForge removes the counts and send times.

= Where is the full documentation? =

In the plugin: TokenForge, Manual in the admin menu.

== External services ==

TokenForge contacts one outside service, Google Fonts, and only when an administrator presses Download from Google Fonts (Typography, Self-hosted fonts). Your server then asks fonts.googleapis.com for the family's CSS and downloads the font files from fonts.gstatic.com, once. It sends the family name, the weights and styles you picked, and your server's IP address, like any web request. The files are stored in `uploads/tokenforge/fonts/`, so your visitors never contact Google.

Google terms: https://developers.google.com/terms
Google privacy policy: https://policies.google.com/privacy

The accessibility checker (axe-core, MPL 2.0) is bundled and runs in the builder only. Nothing else is contacted.

== Screenshots ==

1. Home: every section at a glance, with a switch for each module.
2. Colour families: light and dark shades generated from one colour, with a live preview.
3. Typography: fluid text and heading sizes from one scale.
4. WooCommerce: shop pages, product lists, filters and blocks, each part with its own switch.
5. Forms: field styles, form classes, steps and conditional fields for the builder's form.

== Changelog ==

Older versions are in changelog.txt.

= 0.58.4 =
* Dark mode: links and outline buttons in dark sections, which turn light in dark mode, now use their light-surface colour, so they no longer sit light on light.
* Dark mode: the shop's current page number keeps readable text.
* Contrast checker: measures those links as the page draws them.

= 0.58.3 =
* Dark mode: text set to a fixed colour (black from an imported setup, say) now switches to its light pair, so sections that turn dark stay readable.
* Dark mode: elements you gave a fixed background in the builder (a white header, say) keep their light colours, so their text never turns light on light.
* Dark mode: a fixed page, card or boxed-page background turns dark only when that makes its text more readable.
* Shop: the New badge and the cart item counts keep readable text in dark mode.
* With dark mode off nothing changes.
* Faster pages: the block editor colour and size lists are built once and kept, not on every page view.
