Gradients¶
この章では、次の方法について説明します。
セクションまたはタイトルにグラデーションを追加します。
ウェブサイトビルダーパレットにカスタムグラデーションを追加します。
標準¶
標準では、Website Builder から複数のグラデーションを直接選択できます。 ただし、カスタムテーマの場合は、 section
タグに style
属性を直接追加する必要があります。
使用
<section class="s_text_image" data-snippet="s_text_image" data-name="Text - Image" style="background-image: linear-gradient(135deg, rgb(255, 204, 51) 0%, rgb(226, 51, 255) 100%) !important;">
<!-- Content -->
</section>
テキストにグラデーションを適用するには、text-gradient
クラスの font
タグを使用します。
<h2>
<font class="text-gradient" style="background-image: linear-gradient(135deg, rgb(203, 94, 238) 0%, rgb(75, 225, 236) 100%);">A Section Subtitle</font>
</h2>
カスタム¶
ウェブサイトビルダーにカスタムグラデーションを追加します。これにより、ユーザーは手動でグラデーションを作成せずに簡単に使用できます。
/website_airproof/data/gradients.xml
¶<record id="colorpicker" model="ir.ui.view">
<field name="key">website_airproof.colorpicker</field>
<field name="name">Custom Gradients</field>
<field name="type">qweb</field>
<field name="inherit_id" ref="web_editor.colorpicker"/>
<field name="arch" type="xml">
<xpath expr="//div[@data-name='predefined_gradients']/t[@t-set='gradients']" position="after">
<t t-set="gradients" t-value="gradients + ['linear-gradient(135deg, rgb(203, 94, 238) 0%, rgb(75, 225, 236) 100%)']" />
</xpath>
</field>
</record>