jointrashposs/content/en/docs/2.for-users/3.features/theme.md

111 lines
4.4 KiB
Markdown
Raw Normal View History

New Crowdin updates (#23) * New translations role.md (Korean) * New translations role.md (Polish) * New translations role.md (Chinese Simplified) * New translations role.md (English) * New translations role.md (Indonesian) * New translations _dir.yml (French) * New translations _dir.yml (Italian) * New translations _dir.yml (Korean) * New translations _dir.yml (Polish) * New translations _dir.yml (Chinese Simplified) * New translations _dir.yml (English) * New translations _dir.yml (Indonesian) * New translations 1.index.md (French) * New translations 1.index.md (Italian) * New translations 1.index.md (Korean) * New translations 1.index.md (Polish) * New translations 1.index.md (Chinese Simplified) * New translations 1.index.md (English) * New translations 1.index.md (Indonesian) * New translations bash.md (French) * New translations bash.md (Italian) * New translations bash.md (Korean) * New translations bash.md (Polish) * New translations bash.md (Chinese Simplified) * New translations bash.md (English) * New translations bash.md (Indonesian) * New translations docker.md (French) * New translations docker.md (Italian) * New translations docker.md (Korean) * New translations docker.md (Polish) * New translations docker.md (Chinese Simplified) * New translations docker.md (English) * New translations docker.md (Indonesian) * New translations kubernetes.md (French) * New translations kubernetes.md (Italian) * New translations kubernetes.md (Korean) * New translations kubernetes.md (Polish) * New translations kubernetes.md (Chinese Simplified) * New translations kubernetes.md (English) * New translations kubernetes.md (Indonesian) * New translations manual.md (French) * New translations manual.md (Italian) * New translations manual.md (Korean) * New translations manual.md (Polish) * New translations manual.md (Chinese Simplified) * New translations manual.md (English) * New translations manual.md (Indonesian) * New translations ubuntu-manual.md (French) * New translations ubuntu-manual.md (Italian) * New translations ubuntu-manual.md (Korean) * New translations ubuntu-manual.md (Polish) * New translations ubuntu-manual.md (Chinese Simplified) * New translations ubuntu-manual.md (English) * New translations ubuntu-manual.md (Indonesian) * New translations _dir.yml (French) * New translations _dir.yml (Italian) * New translations _dir.yml (Korean) * New translations _dir.yml (Polish) * New translations _dir.yml (Chinese Simplified) * New translations _dir.yml (English) * New translations _dir.yml (Indonesian) * New translations cdn.md (French) * New translations cdn.md (Italian) * New translations cdn.md (Korean) * New translations cdn.md (Polish) * New translations cdn.md (Chinese Simplified) * New translations cdn.md (English) * New translations cdn.md (Indonesian) * New translations nginx.md (French) * New translations nginx.md (Italian) * New translations nginx.md (Korean) * New translations nginx.md (Polish) * New translations nginx.md (Chinese Simplified) * New translations nginx.md (English) * New translations nginx.md (Indonesian) * New translations push-docker-hub.md (French) * New translations push-docker-hub.md (Italian) * New translations push-docker-hub.md (Korean) * New translations push-docker-hub.md (Polish) * New translations push-docker-hub.md (Chinese Simplified) * New translations push-docker-hub.md (English) * New translations push-docker-hub.md (Indonesian) * New translations scale-out.md (French) * New translations scale-out.md (Italian) * New translations scale-out.md (Korean) * New translations scale-out.md (Polish) * New translations scale-out.md (Chinese Simplified) * New translations scale-out.md (English) * New translations scale-out.md (Indonesian) * New translations troubleshooting.md (French) * New translations troubleshooting.md (Italian) * New translations troubleshooting.md (Korean) * New translations troubleshooting.md (Polish) * New translations troubleshooting.md (Chinese Simplified) * New translations troubleshooting.md (English) * New translations troubleshooting.md (Indonesian) * New translations _dir.yml (French) * New translations _dir.yml (Italian) * New translations _dir.yml (Korean) * New translations _dir.yml (Polish) * New translations _dir.yml (Chinese Simplified) * New translations _dir.yml (English) * New translations _dir.yml (Indonesian) * New translations disable-timelines.md (French) * New translations disable-timelines.md (Italian) * New translations disable-timelines.md (Korean) * New translations disable-timelines.md (Polish) * New translations disable-timelines.md (Chinese Simplified) * New translations disable-timelines.md (English) * New translations disable-timelines.md (Indonesian) * New translations _dir.yml (French) * New translations _dir.yml (Italian) * New translations _dir.yml (Korean) * New translations _dir.yml (Polish) * New translations _dir.yml (Chinese Simplified) * New translations _dir.yml (English) * New translations _dir.yml (Indonesian) * New translations 1.index.md (French) * New translations 1.index.md (Italian) * New translations 1.index.md (Korean) * New translations 1.index.md (Polish) * New translations 1.index.md (Chinese Simplified) * New translations 1.index.md (English) * New translations 1.index.md (Indonesian) * New translations libraries.md (French) * New translations libraries.md (Italian) * New translations libraries.md (Korean) * New translations libraries.md (Polish) * New translations libraries.md (Chinese Simplified) * New translations libraries.md (English) * New translations libraries.md (Indonesian) * New translations permission.md (French) * New translations permission.md (Italian) * New translations permission.md (Korean) * New translations permission.md (Polish) * New translations permission.md (Chinese Simplified) * New translations permission.md (English) * New translations permission.md (Indonesian) * New translations 1.index.md (French) * New translations 1.index.md (Italian) * New translations 1.index.md (Korean) * New translations 1.index.md (Polish) * New translations 1.index.md (Chinese Simplified) * New translations 1.index.md (English) * New translations 1.index.md (Indonesian) * New translations 1.index.md (French) * New translations 1.index.md (Italian) * New translations 1.index.md (Korean) * New translations 1.index.md (Polish) * New translations 1.index.md (Chinese Simplified) * New translations 1.index.md (English) * New translations 1.index.md (Indonesian) * New translations global-timeline.md (French) * New translations global-timeline.md (Italian) * New translations global-timeline.md (Korean) * New translations global-timeline.md (Polish) * New translations global-timeline.md (Chinese Simplified) * New translations global-timeline.md (English) * New translations global-timeline.md (Indonesian) * New translations home-timeline.md (French) * New translations home-timeline.md (Italian) * New translations home-timeline.md (Korean) * New translations home-timeline.md (Polish) * New translations home-timeline.md (Chinese Simplified) * New translations home-timeline.md (English) * New translations home-timeline.md (Indonesian) * New translations hybrid-timeline.md (French) * New translations hybrid-timeline.md (Italian) * New translations hybrid-timeline.md (Korean) * New translations hybrid-timeline.md (Polish) * New translations hybrid-timeline.md (Chinese Simplified) * New translations hybrid-timeline.md (English) * New translations hybrid-timeline.md (Indonesian) * New translations index.md (French) * New translations index.md (Italian) * New translations index.md (Korean) * New translations index.md (Polish) * New translations index.md (Chinese Simplified) * New translations index.md (English) * New translations index.md (Indonesian) * New translations local-timeline.md (French) * New translations local-timeline.md (Italian) * New translations local-timeline.md (Korean) * New translations local-timeline.md (Polish) * New translations local-timeline.md (Chinese Simplified) * New translations local-timeline.md (English) * New translations local-timeline.md (Indonesian) * New translations main.md (French) * New translations main.md (Italian) * New translations main.md (Korean) * New translations main.md (Polish) * New translations main.md (Chinese Simplified) * New translations main.md (English) * New translations main.md (Indonesian) * New translations note-capture-events.md (French) * New translations note-capture-events.md (Italian) * New translations note-capture-events.md (Korean) * New translations note-capture-events.md (Polish) * New translations note-capture-events.md (Chinese Simplified) * New translations note-capture-events.md (English) * New translations note-capture-events.md (Indonesian) * New translations token.md (French) * New translations token.md (Italian) * New translations token.md (Korean) * New translations token.md (Polish) * New translations token.md (Chinese Simplified) * New translations token.md (English) * New translations token.md (Indonesian) * New translations 1.index.md (French) * New translations 1.index.md (Italian) * New translations 1.index.md (Korean) * New translations 1.index.md (Polish) * New translations 1.index.md (Chinese Simplified) * New translations 1.index.md (English) * New translations 1.index.md (Indonesian) * New translations _dir.yml (French) * New translations _dir.yml (Italian) * New translations _dir.yml (Korean) * New translations _dir.yml (Polish) * New translations _dir.yml (Chinese Simplified) * New translations _dir.yml (English) * New translations _dir.yml (Indonesian) * New translations create-plugin.md (French) * New translations create-plugin.md (Italian) * New translations create-plugin.md (Korean) * New translations create-plugin.md (Polish) * New translations create-plugin.md (Chinese Simplified) * New translations create-plugin.md (English) * New translations create-plugin.md (Indonesian) * New translations plugin-api-reference.md (French) * New translations plugin-api-reference.md (Italian) * New translations plugin-api-reference.md (Korean) * New translations plugin-api-reference.md (Polish) * New translations plugin-api-reference.md (Chinese Simplified) * New translations plugin-api-reference.md (English) * New translations plugin-api-reference.md (Indonesian) * New translations publish-on-your-website.md (French) * New translations publish-on-your-website.md (Italian) * New translations publish-on-your-website.md (Korean) * New translations publish-on-your-website.md (Polish) * New translations publish-on-your-website.md (Chinese Simplified) * New translations publish-on-your-website.md (English) * New translations publish-on-your-website.md (Indonesian) * New translations 5.releases.md (French) * New translations 5.releases.md (Italian) * New translations 5.releases.md (Korean) * New translations 5.releases.md (Polish) * New translations 5.releases.md (Chinese Simplified) * New translations 5.releases.md (English) * New translations 5.releases.md (Indonesian)
2023-11-18 07:39:00 +01:00
# テーマ
テーマを設定して、Misskeyクライアントの見た目を変更できます。
## テーマの設定
設定 > テーマ
## テーマを作成する
テーマコードはJSON5で記述されたテーマオブジェクトです。
テーマは以下のようなオブジェクトです。
```js
{
id: '17587283-dd92-4a2c-a22c-be0637c9e22a',
name: 'Danboard',
author: 'syuilo',
base: 'light',
props: {
accent: 'rgb(218, 141, 49)',
bg: 'rgb(218, 212, 190)',
fg: 'rgb(115, 108, 92)',
panel: 'rgb(236, 232, 220)',
renote: 'rgb(100, 152, 106)',
link: 'rgb(100, 152, 106)',
mention: '@accent',
hashtag: 'rgb(100, 152, 106)',
header: 'rgba(239, 227, 213, 0.75)',
navBg: 'rgb(216, 206, 182)',
inputBorder: 'rgba(0, 0, 0, 0.1)',
},
}
```
- `id` ... テーマの一意なID。UUIDをおすすめします。
- `name` ... テーマ名
- `author` ... テーマの作者
- `desc` ... テーマの説明(オプション)
- `base` ... 明るいテーマか、暗いテーマか
- `light`にすると明るいテーマになり、`dark`にすると暗いテーマになります。
- テーマはここで設定されたベーステーマを継承します。
- `props` ... テーマのスタイル定義。これから説明します。
### テーマのスタイル定義
`props`下にはテーマのスタイルを定義します。
キーがCSSの変数名になり、バリューで中身を指定します。
なお、この`props`オブジェクトはベーステーマから継承されます。
ベーステーマは、このテーマの`base`が`light`なら[\_light.json5][_light.json5]で、`dark`なら[\_dark.json5][_dark.json5]です。
つまり、このテーマ内の`props`に`panel`というキーが無くても、そこにはベーステーマの`panel`があると見なされます。
[_light.json5]: https://github.com/misskey-dev/misskey/blob/develop/packages/frontend/src/themes/_light.json5
[_dark.json5]: https://github.com/misskey-dev/misskey/blob/develop/packages/frontend/src/themes/_dark.json5
#### バリューで使える構文
- 16進数で表された色
- 例: `#00ff00`
- `rgb(r, g, b)`形式で表された色
- 例: `rgb(0, 255, 0)`
- `rgb(r, g, b, a)`形式で表された透明度を含む色
- 例: `rgba(0, 255, 0, 0.5)`
- 他のキーの値の参照
- `@{キー名}`と書くと他のキーの値の参照になります。`{キー名}`は参照したいキーの名前に置き換えます。
- 例: `@panel`
- 定数(後述)の参照
- `${定数名}`と書くと定数の参照になります。`{定数名}`は参照したい定数の名前に置き換えます。
- 例: `$main`
- 関数(後述)
- `:{関数名}<{引数}<{色}`
#### 定数
「CSS変数として出力はしたくないが、他のCSS変数の値として使いまわしたい」値があるときは、定数を使うと便利です。
キー名を`$`で始めると、そのキーはCSS変数として出力されません。
#### 関数
「ボタンの上にカーソルを合わせたときだけ色を明るくしたい」のように、既存の色から少し変更した色を使いたい場合に、関数を使うと便利です。
`:{関数名}<{引数}<{色や他のキーの参照}`の形で使うことができます。
```js
props: {
accent: '#86b300',
accentDarken: ':darken<10<#86b300',
accentLighten: ':lighten<10<@accent'
}
```
##### 使用できる関数
- `lighten` ... 渡された色の輝度(0 \~ 100)に対して引数(0 \~ 100)を加算した色を返します。
- `darken` ... 渡された色の輝度(0 \~ 100)に対して引数(0 \~ 100)を減算した色を返します。
- `alpha` ... 渡された色の透明度を引数(0.0 \~ 1.0)に設定した色を返します。
- 0.0のとき完全に透明、1.0で完全に不透明になります。
- `hue` ... 渡された色の色相(-360 \~ 360)に対して引数(-360 \~ 360)の値だけ回転させた色を返します。
- `saturate` ... 渡された色の彩度(0 \~ 100)に対して引数(0 \~ 100)を加算した色を返します。
## テーマを配布する
v2023.11.0以降では、あなたのウェブサイトから、ワンクリックでテーマを直接インストールできるようになっています。
テーマのインストール機能を提供する場合は、あなたのサイト上にAPIを実装する必要があります。詳しくは[こちら](../../for-developers/publish-on-your-website/)をご覧ください。