Appearance
Apps and screens
An app is a place in the sidebar, under Apps. Opening it opens a tab showing one of its screens; the tab's header switches between them. An extension can bring several apps, or none.
json
"apps": [
{
"id": "graph",
"name": "Graph",
"icon": "graph.svg",
"screens": [{ "id": "graph", "title": "Graph", "entry": "graph.html" }]
}
]| Key | |
|---|---|
id | The app's key. |
name | Up to 60 characters. |
icon | A path in the folder; the extension's icon if left out. |
screens | At least one. |
place | apps (the default) or places. See below. |
For a single app, give screens at the top of the manifest instead of apps. The app is then named after the extension.
Screens
| Key | |
|---|---|
id | The screen's key, unique across the extension. |
title | Up to 40 characters. |
entry | The HTML page, such as index.html. |
module | Optional. A module Sorus runs in its own window instead, for an extension signed by Sorus. |
A screen is an ordinary web page. Its scripts connect to Sorus with the SDK:
js
import { connect } from '/__pages/sdk.js'
const pages = await connect()pages.screen says which screen this is. Move to another with pages.navigate({ screen: 'diary' }), or open something in Sorus with pages.navigate({ object: id }) or pages.navigate({ page: id }).
Look like Sorus
A screen gets Sorus's colors and font as CSS variables on its root, and they change when the person changes theirs:
| Variable | |
|---|---|
--pages-background | The page |
--pages-surface | Panels |
--pages-raised | Raised controls |
--pages-border | Borders |
--pages-text, --pages-text-muted, --pages-text-faint | Text |
--pages-accent, --pages-accent-soft, --pages-on-accent | The accent, a soft version, and text on it |
--pages-error | Errors |
--pages-radius | Corner radius |
--pages-font | The font |
The root also has data-pages-scheme="light" or "dark", and its color-scheme is set to match.
Places
"place": "places" puts the app among Sorus's own places, beside Today and Calendar, and lets its icon name one of Sorus's icons as pages:<name>. Both take effect only for extensions signed by Sorus; for any other, the app goes under Apps.
The person can pin any app to the Library from its menu.