Install
Works with Drupal: ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Canvas Studio 1.0.0-beta2 is released together with Canvas Studio Tailwind 1.0.0-beta2, which requires it. Upgrade both projects at the same time. The step-by-step guide ships in the module as docs/upgrading.md.
New features
- Text formats for Canvas rich-text fields are chosen on the format itself. Each text format's edit form gains a Drupal Canvas section: Use in Canvas rich-text fields with No, Yes, or Yes, as the default. The formats list shows a Canvas column, and the form warns about formats that do not filter HTML and formats Canvas content already uses. Nothing widens on upgrade: a site keeps exactly the format Canvas offered before.
- A warning before a format switch would strip content. With two or more formats enabled, switching a rich-text field to a more restrictive format asks first, in core's own wording.
- The editor toolbar follows the chosen format. Switching format rebuilds CKEditor with that format's buttons.
- Min and max height use the height scale: the same steps as height, fractions,
autoand viewport units (screen,svh,lvh,dvh), so a full-height section can be set in the editor. cs:doctorcatches controls that do nothing: CSS custom properties no stylesheet reads, andcs-*classes no stylesheet defines.
Enhancements
- The colour and gradient fields work without their picker libraries: a colour field falls back to a text box beside the browser's colour input, a gradient to a text box. Missing libraries no longer cause failed requests in the editor, and the status report names what to install.
- The README documents the full install, including the Pickr and Grapick libraries;
docs/upgrading.mdgives the upgrade in order.
Bug fixes
- Background: a gradient together with an image are composed as ordered layers instead of one overwriting the other.
- Background: the overlay colour and opacity controls paint, as a layer over the background, instead of depending on a theme rule.
- Link: the stretched-link CSS ships, so a section or group with a link is clickable as a whole.
- Typography: a per-breakpoint text size wins over the ramp of its preset instead of depending on CSS source order.
- The module's editor-only assets load in the Canvas editor (they were attached through a hook the editor route never invokes); right-to-left admin languages no longer shift the Canvas UI off screen.
cs-syncnotices a prop shape that changed through configuration, and migrates unsaved editor drafts along with their hosts.cs:cvfinds every tree-bearing config entity, including Canvas 1.11's page variants.- The quality gates (tests, phpcs, phpstan) pass for real.
Upgrading from 1.0.0-beta1
- Back up the database and public files. Record your baseline:
drush cs-sync --dry-runanddrush cs:cv. - Update the code:
composer require 'drupal/canvas_studio:^1.0.0-beta2' 'drupal/canvas_studio_tailwind:^1.0.0-beta2' -W - Run the database updates:
drush updatedb -ythendrush cr. The update moves the Canvas text format choice onto the formats, and marks the site as coming from beta1. - Run the Canvas Studio Tailwind upgrade script, dry run first:
CS_DRY_RUN=1 drush php:script modules/contrib/canvas_studio_tailwind/scripts/upgrade-to-beta2.php, review the list (every block, with its page and a link that opens it in the editor), then run it withoutCS_DRY_RUNand confirm. It clears values beta2 no longer accepts and keeps the look of existing pages; see the Canvas Studio Tailwind release notes. - Rebuild the theme's Tailwind CSS (
npm run buildin the theme) and commit the compiled CSS. - Sync the components:
drush cs-sync,drush cs:cv,drush cs:doctor. The skip and error counts should match your baseline. - Export and commit the configuration:
drush config:export, committed with the code change. - Install the picker libraries if the status report asks for them: Pickr 1.9.1 into
libraries/pickrand Grapick 0.1.13 intolibraries/grapick(see the README), thendrush cr.
Other environments: drush cs:ci (pre-flight), drush deploy, the upgrade script with -y, then drush cs-sync and drush cs:cv. Run the script once per environment: it changes content.
From a 1.0.x development snapshot: the same steps. The update moves text-format tiers onto the formats. The upgrade script sees that the snapshot already painted backgrounds like beta2 and leaves them alone (override with CS_FROM=beta1 or CS_FROM=dev).
What may look different after upgrading: a linked section or group becomes clickable as a whole (unless your theme already styled .cs-link-cover), and a per-breakpoint text size now always wins over its preset. The upgrade script lists every such block. Backgrounds, overlays and rich-text headings keep their beta1 look.
Rolling back: restore the database backup and the previous code together.
Compatibility
- Drupal 11, Drupal Canvas
^1.9. Verified on Canvas 1.10.1 and 1.12.0; the upgrade was also rehearsed on a production copy running Canvas 1.9.0. - The upstream Canvas CKEditor toolbar defect worked around here is not fixed in Canvas 1.12.