mcpField
T
theme-scss

theme-scss

github.com/ahmed-lakoshaデザイン・UI7663 回インストール31 週間前に更新
リポジトリ

theme-scss について

Odoo のウェブサイトテーマで使う SCSS 変数のリファレンスです。フォント、カラーシステム、サイト設定変数に加え、読み込み順の制約も説明しており、テーマのスタイルを調整する開発者向けです。

主な機能

  1. 01Google Fonts の設定
  2. 025つのセマンティックカラーと組み合わせを解説
  3. 03サイト設定変数を参照
  4. 04テーマ SCSS の読み込み順制約を説明

活用シーン

  1. 01Odoo テーマのフォント設定
  2. 02テーマのパレットと配色の調整
  3. 03ボタン、フォーム、ヘッダー、フッターの変数を検索

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/ahmed-lakosha/odoo-plugins --skill theme-scss

インストール後、Claude Code で/theme-scssを入力して読み込まれたか確認します。

詳細

Odoo テーマ SCSS 変数リファレンス

重要な読み込み順序のルール

テーマの SCSS ファイルは、Odoo のコア変数が定義される前に読み込まれます。

1. YOUR theme's primary_variables.scss (via prepend)  ← FIRST
2. Odoo core primary_variables.scss                    ← SECOND

CONSEQUENCE: CANNOT use map-merge() with core variables!

誤り:$o-color-palettes: map-merge($o-color-palettes, (...)); → 未定義変数エラー
正しい:map-merge を使わず、単独の変数を定義します。


1. $o-theme-font-configs — Google Fonts

$o-theme-font-configs: (
    '<Font Name>': (
        'family': (<CSS font-family list>),     // Required
        'url': '<Google Fonts query param>',     // Required — NOT the full URL!
        'properties': (                          // Optional: per-context overrides
            '<font-alias>': ( '<key>': <value> ),
        ),
    ),
);

重要:'url' キーにはクエリパラメーターのみを指定します。

// CORRECT
'url': 'Poppins:300,300i,400,400i,600,600i,700,700i'

// WRONG — do NOT include full URL
'url': 'https://fonts.googleapis.com/css?family=Poppins:300,400,700'
フォントウェイトの形式
'url': 'Poppins:300,300i,400,400i,600,600i,700,700i'
//      Light  Light-i  Regular Regular-i SemiBold ...
// Number alone = normal, Number + 'i' = italic
複数語のフォント名
'url': 'Open+Sans:300,300i,400,400i,700,700i'
'url': 'IBM+Plex+Sans+Arabic:100,200,300,400,500,600,700'
フォントエイリアス('properties' 用)
エイリアス対応先用途
'base''font'本文テキスト
'headings''headings-font'すべての見出し
'navbar''navbar-font'ナビゲーション
'buttons''buttons-font'ボタン
完全な例
$o-theme-font-configs: (
    'Poppins': (
        'family': ('Poppins', sans-serif),
        'url': 'Poppins:300,300i,400,400i,500,500i,600,600i,700,700i',
        'properties': (
            'base': ( 'font-size-base': (15 / 16) * 1rem ),
        ),
    ),
    'Playfair Display': (
        'family': ('Playfair Display', serif),
        'url': 'Playfair+Display:400,400i,700,700i',
    ),
);
アラビア語/RTL フォント
$o-theme-font-configs: (
    'IBM Plex Sans Arabic': (
        'family': ('IBM Plex Sans Arabic', sans-serif),
        'url': 'IBM+Plex+Sans+Arabic:100,200,300,400,500,600,700',
    ),
    'Cairo': (
        'family': ('Cairo', sans-serif),
        'url': 'Cairo:200,300,400,500,600,700,800,900',
    ),
);

2. $o-color-palettes — カラーシステム

5 つのセマンティックカラー
色意味一般的な用途
o-color-1プライマリ/アクセントブランドカラー、ボタン、リンク
o-color-2セカンダリアクセント、セカンダリボタン
o-color-3明るい背景セクションの背景、カード
o-color-4白/最も明るい色コンテンツの背景(#FFFFFF)
o-color-5ダーク/テキスト見出し、フッター、暗いセクション
カラーの組み合わせ(o_cc1 ~ o_cc5)
クラス背景用途
o_cc1o-color-4(白)メインコンテンツ
o_cc2o-color-3(明るい色)交互に配置するセクション
o_cc3o-color-2(セカンダリ)アクセントセクション
o_cc4o-color-1(プライマリ)CTA セクション
o_cc5o-color-5(ダーク)フッター、暗いセクション
パレットの構造
$o-color-palettes: map-merge($o-color-palettes, (
    'my-palette': (
        'o-color-1': #09294F,
        'o-color-2': #FFA807,
        'o-color-3': #F6F4F0,
        'o-color-4': #FFFFFF,
        'o-color-5': #1B212C,

        // Component assignments
        'menu': 1,
        'footer': 5,
        'copyright': 5,

        // Color combination overrides
        'o-cc5-link': 'o-color-4',
        'o-cc5-btn-primary': 'o-color-2',
    ),
));

注記:$o-color-palettes を使った map-merge が機能するのは、テーマ以外のモジュールのみです。prepend を使用するテーマでは、代わりに 'color-palettes-name' を指定して $o-website-values-palettes を使用してください。

HTML での使用方法
<section class="o_cc o_cc1 pt32 pb32"></section>
<section class="o_cc o_cc2 pt32 pb32"></section>
<section class="o_cc o_cc5 pt32 pb32"></section>
色の導出(使用できる色が 2 色のみの場合)
o-color-3 = lighten(primary, 45%)
o-color-4 = #FFFFFF
o-color-5 = darken(primary, 40%) or #191A19

3. $o-website-values-palettes — マスター設定(115 個以上のキー)

クイックリファレンス
カテゴリ数説明
タイポグラフィとフォント13フォントファミリーの設定
フォントサイズ13ベースサイズと見出しサイズ
行の高さ11テキストの間隔
マージン22見出しと段落のマージン
ボタン17ボタンのスタイル設定
入力欄12フォームフィールドのスタイル設定
ヘッダー13ヘッダー/ナビゲーションの設定
フッター3フッターの設定
リンク1下線の動作
レイアウト3ページレイアウト
色とグラデーション5パレットとグラデーション
Google Fonts2追加フォントの読み込み
3.1 タイポグラフィとフォント
キー説明
'font'サイト全体のベースフォント
'headings-font'H1~H6 のフォント
'navbar-font'ナビゲーションメニューのフォント
'buttons-font'ボタンテキストのフォント
'h2-font' ~ 'h6-font'個別の見出しフォント
'display-1-font' ~ 'display-4-font'ディスプレイテキストのフォント
3.2 フォントサイズ
キーデフォルト説明
'font-size-base'1remベースのフォントサイズ(16px)
'small-font-size'0.875rem小さいテキスト(14px)
'h1-font-size' ~ 'h6-font-size'計算値見出しサイズ
'display-1-font-size' ~ 'display-6-font-size'5rem~2.5remディスプレイサイズ
3.3 行の高さとマージン
キーデフォルト説明
'body-line-height'1.5本文テキスト
'headings-line-height'1.2すべての見出し
'h2-line-height' ~ 'h6-line-height'継承個別設定
'paragraph-margin-top'0段落の上マージン
'paragraph-margin-bottom'16px段落の下マージン
'headings-margin-top' / 'headings-margin-bottom'0 / 0.5rem見出しのマージン
3.4 ボタン(17 個のキー)
Key説明
'btn-padding-y' / 'btn-padding-x'デフォルトのパディング
'btn-font-size'フォントサイズ
'btn-padding-y-sm' / 'btn-padding-x-sm'小さいボタン
'btn-padding-y-lg' / 'btn-padding-x-lg'大きいボタン
'btn-border-width'境界線の太さ
'btn-border-radius' / -sm / -lg角の丸み
'btn-primary-outline'プライマリをアウトラインにする(bool)
'btn-secondary-outline'セカンダリをアウトラインにする(bool)
'btn-primary-flat' / 'btn-secondary-flat'フラットスタイル(bool)
'btn-ripple'マテリアルのリップル効果(bool)
3.5 入力欄(12 個のキー)
Key説明
'input-padding-y' / 'input-padding-x'入力欄のパディング
'input-font-size'入力欄のフォントサイズ
'input-border-width'境界線の太さ
'input-border-radius' / -sm / -lg角の丸み
3.6 ヘッダーとナビゲーション(13 個のキー)
Key値説明
'header-template''default' / 'hamburger' / 'vertical' / 'sidebar'ヘッダーのレイアウト
'header-links-style''default' / 'fill' / 'outline' / 'pills' / 'block' / 'border-bottom'リンクのスタイル
'header-font-size'CSS lengthヘッダーテキストのサイズ
'logo-height'CSS lengthロゴの高さ
'fixed-logo-height'CSS length固定時のロゴの高さ
'hamburger-position''left' / 'center' / 'right'デスクトップでの位置
'hamburger-position-mobile''left' / 'center' / 'right'モバイルでの位置
3.7 フッター(3 個のキー)
Key値説明
'footer-template''default' / 'centered' / 'minimalist' / 'links' / 'descriptive'レイアウト
'footer-effect'null / 'slideout_slide_hover' / 'slideout_shadow'アニメーション
'footer-scrolltop'booleanページ上部へ戻るボタン
3.8 リンクとレイアウト
Key値説明
'link-underline''never' / 'hover' / 'always'下線の動作
'layout''full' / 'boxed'ページレイアウト
'body-image'URL背景画像
3.9 色とグラデーション
Key説明
'color-palettes-name'有効なカラーパレット名
'menu-gradient'メニューの背景グラデーション
'footer-gradient'フッターの背景グラデーション

完全な例 — モダンな企業向けテーマ

$o-website-values-palettes: (
    (
        'color-palettes-name': 'my-corporate-palette',

        // Typography
        'font': 'Inter',
        'headings-font': 'Inter',
        'navbar-font': 'Inter',
        'buttons-font': 'Inter',
        'font-size-base': 1rem,
        'headings-line-height': 1.3,
        'body-line-height': 1.6,

        // Header
        'header-template': 'default',
        'header-links-style': 'default',
        'logo-height': 48px,
        'fixed-logo-height': 36px,

        // Buttons
        'btn-padding-y': 0.75rem,
        'btn-padding-x': 1.5rem,
        'btn-border-radius': 8px,
        'btn-ripple': true,

        // Inputs
        'input-padding-y': 0.75rem,
        'input-border-radius': 8px,

        // Footer
        'footer-template': 'default',
        'footer-scrolltop': true,

        // Links
        'link-underline': 'hover',
        'layout': 'full',
    ),
);

タイポグラフィの倍率

$o-theme-h1-font-size-multiplier: (64 / 16); // 64px → 4.0
$o-theme-h2-font-size-multiplier: (48 / 16); // 48px → 3.0
$o-theme-h3-font-size-multiplier: (32 / 16); // 32px → 2.0
$o-theme-h4-font-size-multiplier: (24 / 16); // 24px → 1.5
$o-theme-h5-font-size-multiplier: (20 / 16); // 20px → 1.25
$o-theme-h6-font-size-multiplier: (16 / 16); // 16px → 1.0 (FIXED!)

コメント