Skip to main content

No project description provided

Project description

PyPI Version Build Status CodeCov

Next Commerce Theme Kit

Theme Kit is a cross-platform command line tool to build and maintain storefront themes with Sass Processing support on the Next Commerce platform.

Installation

Theme Kit is a python package available on PyPi

If you already have python and pip, install with the following command:

python -m pip install next-theme-kit

Mac OSX Requirements

See how to install python and pip with HomeBrew. Once you have completed this step you can install using the pip instructions above.

Windows Requirements

  • Option 1 (Recommended) - Windows 10 and above feature WSL (Windows Subsystem for Linux) which provides a native Linux environment, see how to Install WSL with Ubuntu. Once you have installed WSL, follow the best practice guides to configure and use with VS Code and then follow the pip instructions above to install Theme Kit.

  • Option 2 - Installing python in Windows natively can be done with through the Windows App Store. Recommend using Windows Powershell. This route is a little more tricky and some knowledge on how to manage python in windows will be required.

Use Python Virtual Environments - For Mac, Windows, and Linux, it's a best practice to use a Python Virtual Environment to isolate python packages and dependecies to reduce potential conflicts or errors, more on creating a Python Virutal Environment.

Updating Theme Kit

Update to the latest version of Theme Kit with the following command:

python -m pip install next-theme-kit --upgrade

:warning: Important

As of version 1.0.2, the store authentication uses Oauth and requires creating a store Oauth App with themes:read and themes:write permissions.

Usage

With the package installed, you can now use the commands inside your theme directory and work on a storefront theme.

Available Commands

  • ntk init - initialize a new theme
  • ntk list - list all available themes
  • ntk checkout - checkout an existing theme
  • ntk pull - download existing theme or theme file
  • ntk push - push current theme state to store
  • ntk watch - watch for local changes and automatically push changes to store
  • ntk sass - process sass to css, see Sass Processing

Important - You must pass the apikey and store parameters for all commands if there is not an existing config.yml file in your current directory.

Init

Initialize a new theme which will create the theme on a store and create an initial config.yml file

ntk init --name="<Theme Name>" --apikey="<api key>" --store="<https://storedomain.com>"
Required flags without config.yml
Short Long Description
-a --apikey API Key used to connect to the store.
-s --store Full domain of the store.
-n --name Name of the new theme

List

List all themes installed on the theme.

ntk list --apikey="<api key>" --store="<https://storedomain.com>"
Required flags without config.yml
Short Long Description
-a --apikey API Key used to connect to the store.
-s --store Full domain of the store.

Checkout

Checkout a theme from your store to pull it into your directory.

ntk checkout --theme_id=<id> --apikey="<api key>" --store="<https://storedomain.com>"
Required flags without config.yml
Short Long Description
-a --apikey API Key used to connect to the store.
-s --store Full domain of the store.
-t --theme_id ID of the theme.

Pull

Pull a theme from your store to into your directory.

ntk pull --theme_id=<id> --apikey="<api key>" --store="<https://storedomain.com>"
Required flags without config.yml
Short Long Description
-a --apikey API Key used to connect to the store.
-s --store Full domain of the store.
-t --theme_id ID of the theme.

Push

Push all theme files from your local directory to the store.

ntk push --theme_id=<id> --apikey="<api key>" --store="<https://storedomain.com>"
Required flags without config.yml
Short Long Description
-a --apikey API Key used to connect to the store.
-s --store Full domain of the store.
-t --theme_id ID of the theme.

Watch

Watch for file changes and additions in your local directory and automatically push them to the store.

ntk watch --theme_id=<id> --apikey="<api key>" --store="<https://storedomain.com>"
Required flags without config.yml
Short Long Description
-a --apikey API Key used to connect to the store.
-s --store Full domain of the store.
-t --theme_id ID of the theme.

Sass

Process sass files to CSS files for inclusion in your storefront. See Sass Processing for more details.

ntk sass
Optional flags
Short Long Description
-sos --sass_output_style Options are nested, expanded, compact, or compressed

Sass Processing

Theme kit includes support for Sass processing via Python Libsass. Sass processing includes support for variables, imports, nesting, mixins, inheritance, custom functions, and more.

How it works

  1. Put scss files in top level sass directory.
  2. Run ntk sass or ntk watch to process theme sass files.
  3. Top level scss files will be processed to css files in the asset directory with the same name.

Example Theme with Sass Structure

├── assets
│   ├── styles.css // reference this asset file in templates
├── sass
│   ├── _base.scss
│   ├── _variables.scss
│   └── styles.scss // processed to assets/main.css

Important - Sass processing is only supported on local, files in the sass directory are uploaded to your store for storage but cannot be edited in the store theme editor.

Configure Default Output Style

Change the default sass output style in config.yml, example below.

development:
  apikey: <api key>
  sass:
    output_style: compressed // options: nested, expanded, compact, or compressed
  store: <store url>
  theme_id: <theme id>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

next_theme_kit-1.1.0.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

next_theme_kit-1.1.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file next_theme_kit-1.1.0.tar.gz.

File metadata

  • Download URL: next_theme_kit-1.1.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for next_theme_kit-1.1.0.tar.gz
Algorithm Hash digest
SHA256 19a799608166e78e839c8f9a7cdc2010e4f391eb1683ca4fc108c1808d174cc7
MD5 48e728a1bfc0a6eb924621029f633e8c
BLAKE2b-256 4dc6f5404b2c68a89310da301484f1b8b27166fb6f4b4f9b59bfbe1dce59610a

See more details on using hashes here.

File details

Details for the file next_theme_kit-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: next_theme_kit-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for next_theme_kit-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a89087c71ff90f61322432109ec484393074bc99c4b4f43f782d1df60ca317dd
MD5 b874c9cb03957357325fe2a084ba975d
BLAKE2b-256 64022f0473bd0c7669d1f48eac6c09f3ef66f85274fcd484fd574f9e9c5a94a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page