Documentation for Confluence 2.5.4 - 2.5.8.
Documentation for [Confluence Cloud] and the latest Confluence Server is available too.

最初に、Confluence 2.5.xスタイルの含有を無効化する必要があります。これらは、2.5.xテーマを許可し、Confluence バオジョン 2.6 以降での互換性を保持するため、既定で含まれています。

2.5.x スタイルを無効にするには、テーマの atlassian-plugin.xml に以下を追加してください。

...
<theme key="aqua" i18n-name-key="com.atlassian.confluence.themes.aqua.name" name="Aqua Theme" class="com.atlassian.confluence.themes.BasicTheme">     
    <description key="com.atlassian.confluence.themes.aqua.desc"/>
    ...
    <param name="includeClassicStyles" value="false"/>
    ...
</theme>
...

フラグ includeClassicStylesfalse に設定されていることにご注意ください。デフォルトでは true のため、これを明示的に設定する必要があります。

次に、以下のように atlassian-plugin.xml でカスタム テーマ スタイル シートを宣言する必要があります。

...
<theme key="aqua" i18n-name-key="com.atlassian.confluence.themes.aqua.name" name="Aqua Theme" class="com.atlassian.confluence.themes.BasicTheme">     
    <description key="com.atlassian.confluence.themes.aqua.desc"/>
    ...
    <resource type="stylesheet" name="my.css" location="styles/my-css.vm"/>
    ...
</theme>
...

Confluence 2.5.x との違い

  • #pluginStylesheet を使用してメイン デコレーターにテーマ スタイルシートを含める必要がなくなりました。Confluence は、お使いのテーマのスタイルシートを自動的にロードします (アクティブなテーマの場合)
  • リソースは、layout モジュールではなく、theme モジュールで宣言されます。
  • You need to start your custom style sheet (say my-css.vm), by copying over the latest styles from your Confluence installation. The style-sheet can be found in:
    confluence-[VERSION]/confluence/styles/site-css.vm.
    This step is necessary as Confluence now includes either your theme stylesheet or the default stylesheet, not both. This implies:
    • 既定スタイルが、直接テーマとしていない Confluence の部分のスタイルを設定するために含まれることはなくなりました
    • プラグイン スタイルシートでは、スタイルを上書きできなくなりました。プラグイン スタイルシートはプライマリ スタイルシートに変わりました。
    • Confluence の後のバージョンでは、新しいスタイルをお使いのテーマのスタイルシートにマージする必要があります。

複数スタイル シート

複数のスタイル シートを使用するようテーマを設定することができます。この機能は、メインのスタイル シートを、より明確な目的のいくつかの小さなスタイル シートに分割したい場合に便利です。次のように宣言することができます。

...
<theme key="aqua" i18n-name-key="com.atlassian.confluence.themes.aqua.name" name="Aqua Theme" class="com.atlassian.confluence.themes.BasicTheme">     
    <description key="com.atlassian.confluence.themes.aqua.desc"/>
    ...
    <resource type="stylesheet" name="my1.css" location="styles/my-css1.vm"/>
    <resource type="stylesheet" name="my2.css" location="styles/my-css2.vm"/>
    <resource type="stylesheet" name="my3.css" location="styles/my-css3.vm"/>
    ...
</theme>
...

これらのスタイルシートは宣言された順序で含められます。

  • ラベルなし