Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch and generate shadow styles #63

Merged
merged 8 commits into from
May 21, 2020
Merged

Fetch and generate shadow styles #63

merged 8 commits into from
May 21, 2020

Conversation

timbaev
Copy link
Collaborator

@timbaev timbaev commented May 9, 2020

Generate shadow styles from Figma file!

  1. Create local Effect Styles in Figma file
    Снимок экрана 2020-05-09 в 21 18 39
  2. Configure fugen.yml file, e.g.:
shadowStyles:
  file:
    key: gZ0sNyG5kflJGqa9JvO5lL
    includedNodes:
      - 193%3A2
  destination: FugenDemo/Generated/ShadowStyle.swift
  templateOptions:
    publicAccess: true
    shadowViewTypeName: ShadowView
  1. Generate code using CLI:
fugen generate
  1. Example usage in code:
@IBOutlet private weak var shadowWiew: FugenShadowView!

shadowWiew.shadowStyle = .card16dpShadow

Available template options:

Key Type Default value Description
styleTypeName String ShadowStyle Style type name
shadowViewTypeName String FugenShadowView Name of generated view to which the shadow style is applied.
colorTypeName String UIColor Color type name. If the target platform is macOS, specify NSColor.
viewTypeName String UIView View type name. If the target platform is macOS, specify NSView.
bezierPathTypeName String UIBezierPath Bezier path type name. If the target platform is macOS, specify NSBezierPath.
publicAccess Boolean false Flag that adds public access modifier to the declarations in the generated file.

@almazrafi almazrafi merged commit 836dcda into almazrafi:master May 21, 2020
@almazrafi
Copy link
Owner

💪Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants