Install
Works with Drupal: ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Canvas Studio Tailwind 1.0.0-beta2 requires Canvas Studio 1.0.0-beta2, released together with it. Upgrade both projects at the same time. The step-by-step guide ships in Canvas Studio as docs/upgrading.md.
New features
- Timeline and Timeline Entry components. A chronology as a first-class component, with a
layoutprop (vertical, zigzag) and responsive marker placement. An entry hasmarkerandcontentslots, plus optionalbranch_aandbranch_b. - Per-breakpoint values for the remaining design properties: text size and colour, border width and colour (linked and per side), and individual position offsets, each for tablet, laptop and desktop. New fields default to inherit, so existing content renders unchanged.
- Content templates can link component props to host entity fields: link props accept URLs and paths (
format: uri-reference), so Canvas offers the host entity URL, andhero-blog.dateaccepts a timestamp field. - Rich-text heading scale set by the theme: every rich-text heading size, line height and margin is a
--cs-prose-*variable, defaulting to the theme's own Tailwind tokens (the README lists them). - Navbar
navbar--scrolledstate class once the page scrolls, so an overlay header can turn solid without its own script.
Enhancements
- Every component stylesheet is in
@layer componentswith an explicit layer order, so components no longer outrank theme utilities, and theborder_radiusmappings no longer emit!important. - Rich text is styled on every component that can hold it, through a shared
cs-proselibrary (tables, nested lists, captions and rules included, with logical properties for right-to-left). - The bundle no longer requires byte_theme by name: Mercury, Byte or any theme from the same starterkit works, given a Tailwind build that scans the library and the
phosphoricon pack. - The roadmap-step Card surface resolves through the mapping layer; a neutral
defaultcard surface is available to every component. - Timeline controls follow the prop-bundle conventions.
- Roadmap gains the Background, Borders and Visibility prop groups, and Roadmap Step gains Visibility, in line with Group, Section and Card.
- Per-instance preview markers keep the Canvas editor's height stabiliser from mixing up instances (preview only; production output unchanged).
- Accessibility: the navbar phone menu's opener exposes
aria-expandedandaria-controls, Escape closes the menu and focus returns to the opener. - Translation: video play and pause labels and fallback text, and carousel slide labels, go through
t()andDrupal.t(). - Right-to-left: the navbar uses logical spacing and the roadmap's layout margins and borders are logical properties.
Bug fixes
hero-side-by-sideandhero-billboard: an image set through the media prop shows (the always-rendered empty slot used to replace it); the billboard also shows an image placed in its slot alone.cardandcard-testimonial: an empty media slot no longer hides the media prop; a new testimonial without an image renders instead of failing validation.badgeandbutton: a gradient background chosen in the editor paints instead of being covered by the style's fill.navbar: the phone menu no longer opens empty after the page is scrolled.hero-blogrenders without an image, as its schema allows.media: width and height reachcanvas:imageonly when known, so an SVG saved before its dimensions were read no longer fails validation.- Min and max height no longer offer the width sizes (
xsto7xl,prose), which had no height class; the tablet, laptop and desktop values are scoped to their breakpoint. - Component stylesheets declare the layer order;
navbarandhero-blogno longer sit below Tailwind's reset.
Deprecated
- Roadmap and Roadmap Step, in favour of Timeline. Both still ship and existing content is untouched; they will be removed in a later major release.
Upgrading from 1.0.0-beta1
- Back up the database and public files, and record
drush cs-sync --dry-runanddrush cs:cv. - Update both projects:
composer require 'drupal/canvas_studio:^1.0.0-beta2' 'drupal/canvas_studio_tailwind:^1.0.0-beta2' -W, thendrush updatedb -yanddrush cr. - Run the upgrade script, dry run first:
CS_DRY_RUN=1 drush php:script modules/contrib/canvas_studio_tailwind/scripts/upgrade-to-beta2.php drush php:script modules/contrib/canvas_studio_tailwind/scripts/upgrade-to-beta2.php
It lists every block involved, grouped by page, with a link that opens it in the editor, then asks before writing (
-yfor unattended deploys). It is safe to run twice and must run once per environment. It:- clears min and max height values that used the width sizes (they never did anything);
- removes optional links that are not URLs or paths (such as the literal
No URL), which would otherwise stop the component rendering, and lists required ones to fix by hand; - keeps backgrounds looking as in beta1: a gradient hidden under an image is switched off, and overlays are switched off unless your theme already painted
.bg-overlay(CS_OVERLAYS=keep|offoverrides); - switches a stored gradient on a badge or a button to none, since no earlier release painted it;
- lists, without changing them, the blocks beta2 changes on its own (linked sections and groups becoming clickable, per-breakpoint text sizes winning).
Values it turns off stay stored, so an editor can turn them back on.
- Rebuild the theme's Tailwind CSS (
npm run build) and commit the compiled CSS. Without it the new controls appear and have no effect. The README describes the recommended wiring (two symlinks into the theme plus@source; do not@importcomponent stylesheets). - Sync:
drush cs-sync,drush cs:cv,drush cs:doctor; the skip and error counts should match your baseline. - Export and commit the configuration with the code change.
- Check custom CSS that overrides these components: components no longer outrank theme utilities, and a radius chosen in the editor no longer carries
!important. Wrap your own component CSS in@layer componentswith the order statement if needed.
Other environments: drush cs:ci, drush deploy, the upgrade script with -y, drush cs-sync, drush cs:cv.
From a 1.0.x development snapshot: the script detects a snapshot that already painted backgrounds and block links like beta2 and leaves them alone; it still clears invalid heights and links and fixes badge and button gradients. CS_FROM=beta1 or CS_FROM=dev overrides the detection.
Compatibility
- Requires
drupal/canvas_studio1.0.0-beta2. Drupal 11, Drupal Canvas^1.9; verified on Canvas 1.10.1 and 1.12.0, upgrade rehearsed on Canvas 1.9.0. - Needs a Tailwind-built theme that scans this library and an extension declaring the
phosphoricon pack (Mercury, Byte or a theme from the same starterkit). On Drupal 11.4,html_cva()comes from core; on older 11.x minors a theme such as Byte provides it through thecvamodule.