When an H2 gets its color from a Tag selector on its container, selecting the H2 can show black in the Style panel. The panel now shows the matching color. A Token or Local style on the H2 can still override the container's Tag selector. ## Plan and progress - [x] Reproduce the selected H2 showing the container color instead of its nested Tag color. - [x] Give descendant Tag selectors the intended CSS specificity in Builder and published CSS. - [x] Include matching ancestor Tag declarations in the Style panel's color calculation. - [x] Cover the selected H2 and regular and atomic CSS output with focused tests. - [x] Review documentation impact and update the Tag styles and selectors guides. - [x] Match the panel's competing ancestor Tag rules to CSS breakpoint and stylesheet order. - [x] Match the editing preview's selector specificity to the saved rule. - [x] Use the descendant separator directly when detecting nested selectors. - [x] Allow the same supported selector forms in Tag, Token, and Local sources. - [x] Match global Tag descendant styles in the editing preview and Style panel. - [x] Document nested Tag selector examples in the Tag styles guide. - [x] Explain supported selectors in Add more while its input is focused. - [x] Review and simplify nested state matching; preserve the entered selector text. - [x] Consolidate cascade declaration lookup and reuse the validated selector parse result. - [x] Align Builder and MCP selector entry with one validation rule; preserve saved selectors. - [x] Fix nested-selector source badges and preserve valid instance selection. - [x] Keep descendant conditions scoped to the matched element during inheritance. - [x] Match saved nested selectors regardless of tag casing or leading whitespace. - [ ] Verify both fixes, resolve review threads, and review CI. The panel model needs ancestor matching because it computes styles without querying the rendered element. The complete PR adds about 195 net non-test lines. The added work covers selector entry, active nested states, and matching Tag rules in the panel; the saved CSS output already supported nested tags. CSS generation uses `:where()` around the container selector so the nested tag can override the global tag style while the H2's own Token can override the nested tag style. No stored data changes. Checks passed locally: focused Builder style source, active state, panel model, and canvas preview tests; CSS data and runtime tests; Builder, CSS data, and project-build typechecks; lint, formatting, and `git diff --check`. The focused Add more menu was checked in Storybook in both themes. CI passed for commit `838cf4293f`; CI for `224f11e274` is pending. The full Builder app suite was started but stopped after it stopped producing results; the two affected suites passed independently. This follow-up adds 67 net non-test lines to track matching states by instance and match saved descendant selectors using the shared parser. No fixture inputs or generated fixture outputs changed. Ref #5657
Webstudio CLI
The Webstudio CLI helps you to link, sync and build projects from Webstudio Cloud. This README will guide you through the process of setting up a Webstudio project on your local machine and continually sync it with the cloud.
Prerequisites: Installing Node.js
You need Node.js to use the Webstudio CLI. If Node.js is already installed in your system, you can skip ahead to the section on installing the Webstudio CLI.
To install Node.js using NVM, first install NVM by running:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
Once NVM is installed, you can install Node.js version 22 by running:
nvm install 22
Verify your Node.js installation by checking its version:
node --version
Installing the Webstudio CLI
To get started with the Webstudio CLI:
-
Download and install the CLI using the following command:
npm install -g webstudio@latest -
Confirm the installation by checking the CLI version:
webstudio --version -
To keep your CLI updated, use the same command used for installation whenever a new release is available.
Initiating a Webstudio Project
Now, you can run a Webstudio project on your local machine using this command:
webstudio
This will initiate the flow to connect your Webstudio Cloud project and build it in your local computer. The default flow will guide you through the steps. You can also perform all the operations individually using independent commands.
Commands
Here is the list of independent commands:
- version
- help
- link
- sync
- build
link
The link command stores access to a Webstudio Cloud project. MCP clients use that connection to read and edit the latest Builder build directly; the project does not need to be published or synchronized first.
Shell-capable agents can call MCP tools directly as CLI subcommands immediately after linking. This does not require MCP client configuration or a client restart:
webstudio meta.index
webstudio components.search '{"brief":"button"}'
webstudio insert-fragment --input-file .temp/insert-fragment.json --dry-run
.temp/insert-fragment.json:
{
"parentInstanceId": "<parent-id>",
"fragment": "<section />"
}
The explicit equivalent is webstudio mcp single-op-call <tool> '<json>'.
Use webstudio connect <client> only when you want persistent native MCP tools
inside Claude Code, Codex, Cursor, or VS Code. A persistent client may need to
reconnect after its configuration or cached tool catalog changes.
See the Webstudio MCP documentation for setup, discovery, editing, verification, and safety guidance.
You can link a project from Webstudio Cloud with the following command:
webstudio link
This command will prompt you to paste a link which you can create using the Share option in your project.
Make sure to provide Build access when generating the link in Webstudio Cloud.
sync
Once the project is linked, use the sync command to sync it with the cloud:
webstudio sync
Sync downloads the current saved Builder project and its asset files, then prepares the local content index. Publishing is not required.
Use the export with webstudio build or webstudio import --to "<target-share-link>". Sync is not required for MCP editing.
build
Now, you can build your project with the build command:
webstudio build
During this phase, the CLI establishes the necessary routes and pages, scaffolding the entire application using the default Remix template. Additionally, all assets, such as images and fonts are downloaded to the assets folder inside the public directory.
Once the project is scaffolded, you can run npm install and then npm run dev to run your app in development mode.
If you want to build a production version of the app, you can run npm run build.
Deployment
Vercel
Once you've built the project locally, you can use the Vercel CLI to deploy your project directly to Vercel:
vercel deploy
Follow the instructions here to install the vercel CLI. We plan to add more deployment targets in future.
Netlify
If you want to deploy to netlify, you can use Netlify CLI to deploy your project directly to Netlify:
netlify deploy
You can configure the project to support netlify serverless/edge-functions respectively, as deployment target at the time of initially setting up your project. Please check the initiating-a-webstudio-project section.
You can manually change it using the build command. For serverless functions:
webstudio build --template netlify
Important Notes
If you use vercel build before vercel deploy, make sure to clean your app folder in the project afterward.
Vercel injects a few files to support and deploy Remix using their CLI, but these files are not necessary for your project when you use it locally.