Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
[Skip CI] Docs update with storefront customization section WIP
Damian Legawiecb99d226f3fae
diff --git a/docs/developer/storefront/custom-css.mdx b/docs/developer/storefront/custom-css.mdxnew file mode 100644index 0000000000..6a5df1595c--- /dev/null+++ b/docs/developer/storefront/custom-css.mdx@@ -0,0 +1,7 @@+---+title: "Custom CSS"+description: "Learn how to add custom CSS stylesheets to your Spree storefront"+---+++diff --git a/docs/developer/storefront/custom-javascript.mdx b/docs/developer/storefront/custom-javascript.mdxnew file mode 100644index 0000000000..60283e6b5b--- /dev/null+++ b/docs/developer/storefront/custom-javascript.mdx@@ -0,0 +1,7 @@+---+title: "Custom JavaScript"+description: "Learn how to add custom JavaScript to your Spree storefront"+---+++diff --git a/docs/developer/storefront/links.mdx b/docs/developer/storefront/links.mdxnew file mode 100644index 0000000000..b38e92f8e3--- /dev/null+++ b/docs/developer/storefront/links.mdx@@ -0,0 +1,6 @@+---+title: "Links"+---++Links are used to create the navigation of the storefront. They can be assigned to Sections and Blocks.+diff --git a/docs/developer/storefront/pages.mdx b/docs/developer/storefront/pages.mdxnew file mode 100644index 0000000000..543f23c795--- /dev/null+++ b/docs/developer/storefront/pages.mdx@@ -0,0 +1,12 @@+---+title: "Pages"+description: "Learn how to create and use pages in your Spree storefront"+---++## Built-in Pages+++++## Custom Pages+diff --git a/docs/developer/storefront/sections-blocks.mdx b/docs/developer/storefront/sections-blocks.mdxnew file mode 100644index 0000000000..6de0a29694--- /dev/null+++ b/docs/developer/storefront/sections-blocks.mdx@@ -0,0 +1,17 @@+---+title: "Sections & Blocks"+description: "Learn how to create and use sections and blocks in your Spree storefront"+---++Sections are the building blocks of the pages. They are used to create the structure of the pages and themes.++Each theme comes with a set of default sections, but you can create your own custom sections as well.++## Default Sections+++++++diff --git a/docs/developer/storefront/storefront-overview.mdx b/docs/developer/storefront/storefront.mdxsimilarity index 56%rename from docs/developer/storefront/storefront-overview.mdxrename to docs/developer/storefront/storefront.mdxindex f1f5982542..4ccce5e811 100644--- a/docs/developer/storefront/storefront-overview.mdx+++ b/docs/developer/storefront/storefront.mdx@@ -1,5 +1,5 @@----title: "Storefront Overview"+title: "Overview"---Spree 5 ships with a new mobile-first storefront that is fully customizable & themeable.@@ -8,27 +8,29 @@ Spree 5 ships with a new mobile-first storefront that is fully customizable & thNew Storefront consists of:-* Themes-+<CardGroup>+ <Card title="Themes" href="/developer/storefront/themes">Themes are a collection of styles, scripts and templates that are used to style and layout the storefront.--* Pages-+ </Card>+ <Card title="Pages" href="/developer/storefront/pages">Pages are the main building blocks of the storefront. They are used to create the structure of the storefront. Each Theme comes with a set of default pages such as Home Page, Product Listing Page, Product Page, etc, but you can create your own custom landing pages as well.--* Sections-+ </Card>+ <Card title="Sections" href="/developer/storefront/sections-blocks">Sections are the building blocks of the pages. They are used to create the structure of the pages. Each Section is a collection of Blocks.--* Blocks-+ </Card>+ <Card title="Blocks" href="/developer/storefront/sections-blocks#blocks">Blocks are the smallest building blocks of the storefront. They are used to create the content of the pages.+ </Card>+ <Card title="Links" href="/developer/storefront/links">+ Links are used to create the navigation of the storefront. They can be assigned to Sections and Blocks.+ </Card>+</CardGroup>## Page Builder-The new storefront comes with a Page Builder that allows you to build pages using a drag-and-drop interface, as a part of Spree Admin Dashboard (provided via `spree_admin` gem). This allows you to create new pages and sections, modify existing ones, and add new blocks to the pages in a no-code way.+The new storefront comes with a visual Page Builder that allows non-developers to build pages using a drag-and-drop interface, as a part of Spree Admin Dashboard (provided via `spree_admin` gem). This allows your team to create new pages and sections, modify existing ones, and add new blocks to the pages in a no-code way.You can learn more about the Page Builder in the [User Documentation](/user/storefront/theme-editor).diff --git a/docs/developer/storefront/themes.mdx b/docs/developer/storefront/themes.mdxnew file mode 100644index 0000000000..cca838175a--- /dev/null+++ b/docs/developer/storefront/themes.mdx@@ -0,0 +1,160 @@+---+title: "Themes"+description: "Learn how to develop themes for your Spree storefront"+---++Themes are the main building blocks of the storefront. They hold styles, settings, and templates for the storefront.++## Default Theme++Spree comes with a default theme called `default`. It is used as a base for all the themes and contains the core styles and scripts. This theme is included with the Spree Commerce core and is always available.++## Creating a New Theme++You can create your own custom themes by following the steps below.++```bash+rails g spree:theme MyTheme+```++This command will create a new theme called `my_theme` in the `app/views/themes` directory and copy the default theme files to the new theme.++It will also add a line in your `config/initializers/spree.rb` file to load the new theme.++```ruby+Rails.application.config.spree.themes << Spree::Themes::MyTheme+```++Now you can go to **Admin Dashboard -> Storefront -> Themes**, you should see a new section **Add new theme** with your theme name. Click **Add** button to activate the theme.++### Theme Templates++Theme has the following template structure:++```+├── account+│ ├── store_credits+│ ├── profile+│ ├── orders+│ ├── newsletter+│ └── addresses+├── checkout+├── contacts+├── orders+├── page_sections+├── policies+├── posts+├── products+├── search+├── settings+├── shared+└── wishlists+```++Each directory contains standard [Ruby on Rails ERB templates](https://guides.rubyonrails.org/action_view_overview.html) for the corresponding page.++`page_sections` directory contains sections that are used globally across the storefront.++`shared` directory contains shared components that are used across the storefront.++### Theme Settings++The theme settings are stored in the `app/models/spree/themes/my_theme.rb` file.++```ruby+module Spree+ module Themes+ class MyTheme < Spree::Theme+ def self.metadata+ {+ authors: ['Spree Commerce'], # replace with your name+ license: 'MIT' # replace with your license+ }+ end++ # COLORS+ # main colors+ preference :primary_color, :string, default: '#000000'+ preference :accent_color, :string, default: '#F0EFE9'+ preference :danger_color, :string, default: '#C73528'+ preference :neutral_color, :string, default: '#999999'+ preference :background_color, :string, default: '#FFFFFF'+ preference :text_color, :string, default: '#000000'+ preference :success_color, :string, default: '#00C773'++ # buttons+ preference :button_background_color, :string+ preference :button_text_color, :string, default: '#ffffff'+ preference :button_hover_background_color, :string+ preference :button_hover_text_color, :string+ preference :button_border_color, :string++ # borders+ preference :border_color, :string, default: '#E9E7DC'+ preference :sidebar_border_color, :string++ preference :secondary_button_background_color, :string+ preference :secondary_button_text_color, :string+ preference :secondary_button_hover_background_color, :string+ preference :secondary_button_hover_text_color, :string++ # inputs+ preference :input_text_color, :string, default: '#6b7280'+ preference :input_background_color, :string, default: '#ffffff'+ preference :input_border_color, :string+ preference :input_focus_border_color, :string+ preference :input_focus_background_color, :string+ preference :input_focus_text_color, :string++ # sidebar (checkout)+ preference :checkout_sidebar_background_color, :string, default: '#f3f4f6'+ preference :checkout_divider_background_color, :string+ preference :checkout_sidebar_text_color, :string++ # TYPOGRAPHY+ preference :custom_font_code, :string, default: nil+ # body+ preference :font_family, :string, default: 'Inter'+ preference :font_size_scale, :integer, default: 100+ # headers+ preference :header_font_family, :string, default: 'Inter'+ preference :header_font_size_scale, :integer, default: 100+ preference :headings_uppercase, :boolean, default: true++ # BUTTONS+ preference :button_border_thickness, :integer, default: 1+ preference :button_border_opacity, :integer, default: 100+ preference :button_border_radius, :integer, default: 100+ preference :button_shadow_opacity, :integer, default: 0+ preference :button_shadow_horizontal_offset, :integer, default: 0+ preference :button_shadow_vertical_offset, :integer, default: 4+ preference :button_shadow_blur, :integer, default: 5++ # INPUTS+ preference :input_border_thickness, :integer, default: 1+ preference :input_border_opacity, :integer, default: 100+ preference :input_border_radius, :integer, default: 8+ preference :input_shadow_opacity, :integer, default: 0+ preference :input_shadow_horizontal_offset, :integer, default: 0+ preference :input_shadow_vertical_offset, :integer, default: 4+ preference :input_shadow_blur, :integer, default: 5++ # BORDERS+ preference :border_width, :integer, default: 1+ preference :border_radius, :integer, default: 6+ preference :border_shadow_opacity, :integer, default: 0+ preference :border_shadow_horizontal_offset, :integer, default: 0+ preference :border_shadow_vertical_offset, :integer, default: 4+ preference :border_shadow_blur, :integer, default: 5++ # PRODUCT IMAGES+ preference :product_listing_image_height, :integer, default: 300+ preference :product_listing_image_width, :integer, default: 300+ preference :product_listing_image_height_mobile, :integer, default: 190+ preference :product_listing_image_width_mobile, :integer, default: 190+ end+ end+end+```++These are standard [Spree preferences](/developer/customization/model-preferences) that are configurable via Page Builder.diff --git a/docs/docs.json b/docs/docs.jsonindex 84d0f06e78..b0f6729857 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -1,7 +1,7 @@{"$schema": "https://mintlify.com/docs.json","name": "Spree Commerce documentation",- "theme": "mint",+ "theme": "maple","colors": {"primary": "#0A2242","light": "#D7DFE9",@@ -42,6 +42,19 @@"pages": ["developer/customization/quickstart","developer/customization/configuration",+ {+ "group": "Storefront",+ "icon": "store",+ "pages": [+ "developer/storefront/storefront",+ "developer/storefront/themes",+ "developer/storefront/pages",+ "developer/storefront/sections-blocks",+ "developer/storefront/links",+ "developer/storefront/custom-javascript",+ "developer/storefront/custom-css"+ ]+ },"developer/customization/authentication","developer/customization/checkout","developer/customization/permissions",@@ -925,13 +938,6 @@"developer/customization/routes"]},- {- "group": "Extending Spree",- "pages": [- "developer/extending-spree/promotions",- "developer/customization/extensions"- ]- },{"group": "Deployment","pages": [