Skip to content
On this page · 15 sections
  1. The layout
  2. Work with files
  3. Create, upload, rename and delete
  4. What a theme file can be
  5. Find what you need
  6. Save, preview and publish
  7. Discard changes
  8. When someone else changed the file
  9. History and snapshots
  10. File history
  11. Snapshots
  12. Problems
  13. Reset to the shipped theme
  14. Keyboard shortcuts
  15. Who can use it
Docs

Theme code editor

Updated

Edit your theme's Liquid, JSON, CSS and JavaScript files in the browser, save to a draft, check for problems, and publish, with per-file history and snapshots.

The theme code editor gives you every file of a theme: layouts, sections, blocks, snippets, templates, settings, translations and assets. Changes you save go to a draft that visitors do not see until you publish it, so you can work on a theme safely, even the live one.

To open it, go to Site → Themes at https://accounts.in1s.com and click Edit code on a theme. From the theme editor you can also open it from the theme menu. If you are new to theme files, start with Theme structure and Theme development.

The layout

  • The file list on the left groups the theme's files by folder. Use Filter files to narrow it. Files changed in the draft are marked Changed, and a file with unsaved edits has a mark beside its name.
  • The editor in the middle opens files in tabs, with syntax highlighting, completions (Ctrl Space) and problems underlined as you work. The status bar shows the line and column, the number of problems in the file and whether it is saved.
  • The side panel on the right has four tabs: History, Search, Snapshots and Problems. Hide or show it with the button in the header.
  • The draft bar at the top shows what the draft holds and has Visual editor, Preview, Discard, Save to draft and Publish.

Images and fonts open as a preview with a Replace button rather than as text.

Work with files

Create, upload, rename and delete

Each folder in the file list has New file and Upload buttons. A new file's name must have an extension that its folder takes, for example .liquid in sections/ or .json in templates/. You can upload up to 20 files at once.

Open a file's menu to Rename it (or press F2) or Delete it. Files the theme needs to work cannot be deleted or renamed; their menu says so. A deleted file disappears from the website only when you publish, and discarding the draft brings it back.

What a theme file can be

Folder File types
layout/, blocks/, snippets/ .liquid
sections/ .liquid, .json (section groups)
templates/, config/, locales/ .json
assets/ .css, .scss, .js, .liquid, .svg, .png, .jpg, .jpeg, .webp, .gif, .woff, .woff2, .ico, .json, .txt
data-lists/, forms/, workflows/, routes/, link-lists/ .json

A text file can be up to 1 MB and an image or font up to 10 MB. A theme can hold up to 2,000 files and 50 MB in all. SVG files are cleaned of anything unsafe when they are saved.

Find what you need

  • Ctrl P finds a file by name.
  • Ctrl Shift F searches the text of every file; results are grouped by file and open at the line.
  • F12, or Ctrl and a click, on a render, include or section tag opens the file it names.

Save, preview and publish

  1. Save to the draft

    Click Save to draft or press Ctrl S. The file is checked first; a file with an error is not saved, and the problem is shown in the editor and in Problems.

  2. Preview

    Click Preview to open the website with your draft applied, in a new tab. Visitors still see the published theme.

  3. Publish

    Click Publish (it shows how many files will go live). The whole draft is checked again; if any file has an error, publishing is blocked and the button says why. Warnings do not block publishing.

Once published, visitors of the active theme see the changes straight away. Each publish keeps a snapshot, so you can go back.

Tip

The theme editor saves to the same draft. Changes you make there and here are published together, and the file list marks what changed.

Discard changes

  • Discard in the draft bar throws away the whole draft, and the editor shows the published theme again.
  • Discard changes to file (above the open file) puts only that file back to its published version.

Both cannot be undone.

When someone else changed the file

Several people can work on a theme. The header shows who else has it open. If someone saved or published a file since you opened it, saving asks you to compare the two versions and choose (Compare and choose). If a file you changed in the draft was published by someone else in the meantime, it is marked Changed underneath: compare it with the published version, or discard your draft of that file, before you publish.

Edits you did not save are kept in your browser. When you open the file again, you can Compare and restore them, or Discard them.

History and snapshots

File history

The History tab lists every saved version of the open file, newest first, including autosaves from the visual editor. Compare a version with the open file, and restore it: a restore writes that version into the draft, never straight to the live theme.

Snapshots

A snapshot is a copy of the whole theme. One is kept each time you publish and before anything replaces the theme (a restore, a reset or a theme update). Click Take a snapshot to keep one yourself, and give it a Label such as "Before the spring redesign".

In the Snapshots tab, Compare shows which files differ from the live theme, and Restore puts the theme back to that snapshot. On the active theme, visitors see the restored version straight away. Any draft changes are discarded, and the theme as it was is kept as a snapshot, so a restore can itself be undone.

Problems

The Problems tab lists the errors and warnings in the draft, errors first. Click one to jump to the line. The draft is checked again a moment after each save. Errors must be fixed before you can publish.

Reset to the shipped theme

For a theme from the library, open the theme actions menu (…) in the header and choose Reset to shipped theme. All files go back to the theme as in1s ships it, and you can choose a Style. On the active theme, visitors see the change straight away, and the files changed in the draft are discarded. The theme as it was is kept as a snapshot, so you can restore it from Snapshots.

Blank and imported themes have no shipped version to reset to.

Keyboard shortcuts

Click the keyboard button in the header to see this list in the editor.

Keys Action
Ctrl S Save the open file to the draft
Ctrl P Find a file
Ctrl Shift F Search in all files
Ctrl F Search in the open file
F12 or Ctrl + click Open the file a render, include or section tag names
F2 Rename the file chosen in the file list
Ctrl Space Show completions
Esc, then Tab Move focus out of the editor (Tab indents while you type)
Arrow keys Move through the file list; Right opens a folder, Left closes it

On a Mac, use ⌘ instead of Ctrl.

Who can use it

A team member needs the Code permission on Themes. Because theme code can read every Data List and form, the role editor warns that this permission gives access to every list and form, whatever the role's other settings. See Team and roles.

If a Pro theme is locked because the website owner's plan no longer includes Pro themes, the editor opens read-only. See Manage themes.

Start typing to search the docs.