mcpField
T
theme-design

theme-design

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

theme-design について

theme-designは、FigmaのデザインをOdooのWebサイトテーマに反映するためのワークフロー資料です。デザイン分析、標準テンプレートの選択、テーマ変数の設定、必要に応じたCSSやカスタムスニペットの追加を案内します。

主な機能

  1. 01Figmaデザインの分析フロー
  2. 02色をOdooテーマ変数に対応付け
  3. 03ヘッダーとフッターのテンプレート選択
  4. 04ショップとブログのレイアウト設定
  5. 05テンプレートのプログラムによる有効化

活用シーン

  1. 01FigmaデザインからOdooテーマを計画
  2. 02デザインに合うヘッダーとフッターの選択
  3. 03ショップとブログページの設定
  4. 04抽出したデザイン情報からテーマ設定を作成

MCP 対応

デザイン抽出の手順でFigma MCPとChrome MCPを使う方法が記載されています。MCPサーバーの実装や提供については説明されていません。

インストール

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

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

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

詳細

FigmaからOdooへのデザインワークフロー

デザインワークフローの方法論

1. ANALYZE DESIGN → Extract colors, fonts, layout, components
2. COMPARE TO ODOO TEMPLATES → Match header, footer, page layouts
3. CHOOSE CLOSEST TEMPLATE → Select best matching built-in template
4. CONFIGURE VIA VARIABLES → Set $o-website-values-palettes
5. ENHANCE WITH CUSTOM CSS → Only what templates can't provide
6. CREATE CUSTOM SNIPPETS → Components not available in Odoo

Figma抽出パイプライン

Figma MCPを使用する
1. Use Figma MCP with prompt:
   "Convert this Figma design to HTML for Odoo <version> website theme.
   Use Bootstrap v5.1.3 classes (not Tailwind).
   Apply proper Odoo theme structure with sections and containers."

2. Extract Color Palette:
   "Extract the color palette and map to o-color-1 through o-color-5."

3. Extract Typography:
   "Convert text styling to Bootstrap typography classes."
Chrome MCPを使用する(ブラウザー自動化)
  1. FigmaのURLに移動 → Pagesを開きます(コンポーネントではありません!)
  2. ページ要素をクリックして、以下を抽出します:
    • ヘッダー/ナビゲーションバー → プライマリカラー
    • CTAボタン → セカンダリカラー
    • セクションの背景 → o-color-3
    • 本文テキスト → テキストカラー、フォントファミリー
    • 見出し(H1-H6) → 見出しフォント、サイズ

確認するページ:ホームページ、About/サービス、問い合わせ、フッター領域

カラーマッピング
デザイン要素対応先
ブランドのプライマリカラー(ボタン、リンク)o-color-1
アクセント/CTAカラーo-color-2
明るいセクションの背景o-color-3
メインコンテンツの背景o-color-4
暗いテキスト/見出しo-color-5

ヘッダーテンプレート(主要11種類+バリエーション)

XML ID名前最適な用途
website.template_header_defaultデフォルトほとんどのウェブサイト
website.template_header_hamburgerハンバーガーミニマルなデザイン
website.template_header_stretchストレッチ幅の広いレイアウト
website.template_header_vertical縦型アプリのようなサイト
website.template_header_search検索Eコマース、ディレクトリ
website.template_header_sales_oneセールス 1オンラインストア
website.template_header_sales_twoセールス 2大規模なカタログ
website.template_header_sales_threeセールス 3製品重視
website.template_header_sales_fourセールス 4ファッション、小売
website.template_header_sidebarサイドバーダッシュボードサイト
website.template_header_boxedボックス型モダンなブランド
ヘッダーの配置バリエーション
  • ..._align_center / ..._align_right — デスクトップでの配置
  • ..._mobile_align_center / ..._mobile_align_right — モバイルでの配置
ヘッダーの表示設定(相互排他的)
XML ID効果
website.header_visibility_standardページと一緒にスクロールします
website.header_visibility_fixed上部に固定されます
website.header_visibility_disappears下にスクロールすると非表示になります
website.header_visibility_fade_outフェードアウトします
ヘッダーコンポーネント(組み合わせ可能)
XML IDコンポーネントデフォルト
website.option_header_brand_logoロゴ画像有効
website.option_header_brand_nameテキスト名無効
website.header_call_to_actionCTAボタン有効
website.header_search_box検索バー有効
website.header_social_linksソーシャルアイコン無効
ヘッダーの決定フローチャート
Is navigation hidden? → YES → template_header_hamburger
                       → NO → Vertical sidebar? → YES → Full page? → sidebar / vertical
                                                 → NO → E-commerce? → YES → Categories? → sales_two / sales_one
                                                                    → NO → Search prominent? → template_header_search
                                                                                             → Boxed? → boxed / stretch / default

フッターテンプレート(9種類)

XML ID名前最適な用途
website.footer_customデフォルト一般用途
website.template_footer_descriptive説明型コーポレートサイト
website.template_footer_centered中央揃えランディングページ
website.template_footer_linksリンク大規模サイト
website.template_footer_minimalistミニマリストすっきりしたデザイン
website.template_footer_contact問い合わせサービス業
website.template_footer_call_to_actionCTAマーケティングサイト
website.template_footer_headlineヘッドラインブランドメッセージ
website.template_footer_slideoutスライドアウトモダン/トレンド重視
フッターの決定フローチャート
Minimal (just copyright)? → YES → template_footer_minimalist
                          → NO → Center-aligned? → template_footer_centered
                                 Newsletter/CTA? → template_footer_call_to_action
                                 Contact info? → template_footer_contact
                                 Primarily links? → template_footer_links
                                 Detailed description? → template_footer_descriptive
                                 Default → footer_custom

ショップページテンプレート(website_sale)

レイアウトオプション
XML ID機能
website_sale.products_design_cardカードレイアウト
website_sale.products_design_gridグリッドレイアウト
website_sale.products_thumb_4_34:3の画像比率
website_sale.products_thumb_cover画像がコンテナー全体を埋めます(デフォルト)
カテゴリーとフィルター
XML ID機能デフォルト
website_sale.products_categories左サイドバー無効
website_sale.products_categories_top上部ナビゲーション有効
website_sale.products_attributes属性フィルター有効
website_sale.filter_products_price価格フィルター無効
website_sale.search検索ボックス有効
website_sale.sort並べ替えドロップダウン有効
商品詳細オプション
XML ID機能デフォルト
website_sale.product_commentレビュー無効
website_sale.product_buy_now「今すぐ購入」ボタン無効
website_sale.alternative_products代替商品有効

ブログテンプレート(website_blog)

ブログ一覧
XML ID機能デフォルト
website_blog.opt_blog_cover_post注目バナー有効
website_blog.opt_blog_list_viewリスト表示無効
website_blog.opt_blog_cards_designカードコンポーネント無効
website_blog.opt_blog_sidebar_showサイドバー無効
ブログ記事詳細
XML ID機能デフォルト
website_blog.opt_blog_post_breadcrumbパンくずリスト有効
website_blog.opt_blog_post_read_next次の記事を読む有効
website_blog.opt_blog_post_commentコメント無効

カートとチェックアウト

XML ID機能デフォルト
website_sale.suggested_products_listおすすめ商品有効
website_sale.reduction_codeプロモーションコード有効
website_sale.accept_terms_and_conditions利用規約のチェックボックス無効

デザインからテーマ設定を生成する

デザインを分析し、テンプレートを照合した後:

// primary_variables.scss — Generated from Design Analysis
$o-theme-font-configs: (
    'Poppins': (
        'family': ('Poppins', sans-serif),
        'url': 'Poppins:300,400,500,600,700',
    ),
);

$o-website-values-palettes: (
    (
        'color-palettes-name': 'default-1',
        'font': 'Poppins',
        'headings-font': 'Poppins',
        'header-template': 'hamburger',
        'header-links-style': 'pills',
        'logo-height': 48px,
        'footer-template': 'contact',
        'footer-scrolltop': true,
        'btn-padding-y': 0.75rem,
        'btn-border-radius': 8px,
        'link-underline': 'never',
    )
);

次に、照合したテンプレートをプログラムで有効化するためにtheme.utilsを作成します:

def _theme_yourtheme_post_copy(self, mod):
    self.enable_view('website.template_header_hamburger')
    self.enable_view('website.template_footer_contact')
    self.enable_view('website.option_header_brand_logo')
    self.disable_view('website.header_visibility_standard')
    self.enable_view('website.header_visibility_fixed')

コメント