This package is part of the SNAP suite.
A toolset to abstract Colors, Fonts, Icons and Numbers of a multi-platform SwiftUI app. Define semantic attributes in a Theme and apply them to your views for a consistent UI with maintainability in mind.
Consistency in look and feel is important, especially for a growing app project. Goal of SnapStyle is to define any visual attribute in a single place. Create a consistent UI with simple adjustments and quick experiments, but strong maintainability. Tweak a few attributes or adjust components to fit platform changes just once and have the whole app updated.
Instead of defining design attributes all over the place, you register a semantic key, assign a definition and use it in your SwiftUI views. Definitions can be overwritten in the View hierarchy to allow different styles and support user customisation like Themes or Accent color selection.
Comes with:
- Base attributes (Surface, Font, Icon, Number, Shape, Padding) and composed attributes (Composition, Accent, Components).
 - A preset of common semantic definitions for these attributes, with platform specific default values.
 - ViewModifier to apply them to your views.
 - Wrapper of stock SwiftUI views to set attributes from Style definitions (e.g. StyleStack(spacing:)).
 - Convenience views for common layout and style tasks (e.g. StyleScreen, StyleElement).
 - Configuration and Context is provided via Environment to access and configure definitions.
 
Fonts and Numbers are scaled by DynamicType by default. This brings some additional benefits:
UI sizes (paddings, spacings, ...) defined by the Theme will scale with DynamicType. By adjusting the configurations scale factor, the whole UI can be zoomed by a simple value change.
// TODO package: Setup Steps to setup the package ...
The demo project shows ...
// TODO package: Update Screenshot

// TODO package: How to use Details about package content ...
The main target to import using the package in an app. Provides access to internal targets.
Base implementation of Values, Caching and Context.
Implementation of Components and Elements. To build a semantic content structure.
Base set of definitions and values.
ViewModifier to use the definitions in SwiftUI Views.
SwiftUI Views to structure Views.
Convenience Views and Container for common solutions, using the style definitions.
Some helper views to look into the setup and caches, prevents exposing implementation for accidental misuse.
- Screen definition limiting the content to .widthReadableContent (UIKits readableContentGuide is not available in SwiftUI).
 
- The iOS default behaviour of .accentColor shows as grayed out when a popover or sheet is presented. Seems to be not possible to replicate for custom tint colors.