← Back to connors/photon

How to Deploy & Use connors/photon

Photon UI Toolkit - Deploy & Usage Guide

Prerequisites

  • Node.js (v4.0.0 or higher) - Required for running the Electron template app and development tools
  • npm (v2.0.0 or higher) - Node package manager for installing dependencies
  • Git - For cloning the repository
  • Jekyll (v2.5.x) - Only required if you plan to run documentation locally
  • Ruby and Rouge - Required for Jekyll documentation (Windows users should follow the unofficial guide for Jekyll installation)

Installation

  1. Clone the repository:

    git clone https://github.com/connors/photon.git
    cd photon
    
  2. Install Node.js dependencies:

    npm install
    
  3. Verify the structure: The repository contains:

    • css/photon.css - Compiled CSS styles
    • fonts/ - Entypo icon font files
    • template-app/ - Starter Electron application with example files

Configuration

Photon doesn't require any specific configuration for basic usage. The CSS and fonts are ready to use out of the box.

For development:

  • No environment variables are required
  • No API keys are needed
  • The template app uses standard Electron configuration in template-app/package.json

Build & Run

Development

  1. Start the example Electron app:

    npm start
    
  2. Watch for Sass changes (if modifying source files): Open a second terminal tab and run:

    npm run build
    

    This will rebuild the compiled photon.css whenever source Sass files change.

Production

To use Photon in your own Electron application:

  1. Copy the necessary files from the repository:

    • css/photon.css
    • fonts/ directory (all font files)
  2. Include in your HTML:

    <link rel="stylesheet" href="path/to/photon.css">
    
  3. Use Photon classes in your HTML markup following the documentation at photonkit.com

Deployment

Photon is a UI toolkit designed for Electron desktop applications, so deployment depends on your Electron app structure:

For Electron Apps

  1. Package your Electron app using standard Electron build tools:

    npm install --save-dev electron-builder
    
  2. Configure your build in package.json:

    "build": {
      "appId": "your.app.id",
      "productName": "Your App Name"
    }
    
  3. Build for distribution:

    npm run build
    npm run dist
    

Platforms

Photon works on all platforms supported by Electron:

  • macOS (64-bit)
  • Windows (32-bit and 64-bit)
  • Linux (32-bit and 64-bit)

Troubleshooting

Common Issues

Issue: Fonts not displaying correctly

  • Solution: Ensure all font files from the fonts/ directory are copied to your application's resources directory and paths are correctly referenced in photon.css

Issue: CSS not applying styles

  • Solution: Verify that photon.css is properly linked in your HTML and that there are no conflicting CSS rules

Issue: Jekyll documentation not running

  • Solution: Ensure you have the correct Jekyll version (v2.5.x) and have installed Rouge with gem install rouge

Issue: Build process fails

  • Solution: Check that all Node.js dependencies are installed with npm install and that you have the required Node.js version

Getting Help

  • Report bugs: File an issue following the contributor guidelines
  • Documentation: Visit photonkit.com for component documentation and usage examples
  • Development: The master branch is unstable; use tagged releases for production applications

Version Management

Photon follows Semantic Versioning. Check the tags for stable releases when deploying to production.