Skip to main content

Custom Styling Example

This example demonstrates how to create a beautifully styled payment form using the Paysight Widget’s theming capabilities.

Live demo

Open the interactive theming demo in the sandbox playground.

Complete Implementation

Key Styling Features

1. Theme Configuration

2. Dark Mode Support

3. Component-Specific Styles

4. State-Based Styling

Implementation Steps

  1. Define Theme Variables
    • Set up CSS variables for consistent styling
    • Include both light and dark mode values
  2. Create Base Styles
    • Style container elements
    • Set up typography
    • Configure spacing and layout
  3. Style Form Components
    • Customize input fields
    • Style buttons
    • Add field labels and error messages
  4. Add Interactive States
    • Implement hover effects
    • Add focus states
    • Style error states
  5. Implement Dark Mode
    • Create dark theme variables
    • Add theme toggle functionality
    • Test both themes
  6. Add Polish
    • Include transitions
    • Add subtle animations
    • Ensure consistent spacing

Best Practices

  1. Use CSS Variables
  2. Maintain Consistency
  3. Follow Accessibility Guidelines

Next Steps