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

Functions #33

Open
BernardGatt opened this issue Sep 28, 2016 · 0 comments
Open

Functions #33

BernardGatt opened this issue Sep 28, 2016 · 0 comments
Milestone

Comments

@BernardGatt
Copy link

BernardGatt commented Sep 28, 2016

In values we're proposing the introduction of a set of reserved keywords that will serve as functions, by version 1 there will be a number of functions available:

ImageURL

{
    "@logoImageURL": "https://avatars1.githubusercontent.com/u/17726261",
    "MyApp.LoginView": {
        "MyApp.LogoView": {
            "backgroundImage": "ImageURL(@logoImageURL)"
        }
    }
}

Gradient

{
    "@primaryColor": "#641E16",
    "@secondaryColor": "#78281F",
    "MyApp.LoginView": {
        "backgroundColor": "Gradient(style: 'Horizontal', locations: [0.9, 1.0], colors: [@primaryColor, @secondaryColor])"
    }
}

Alpha

{
    "@primaryColor": "#641E16",
    "MyApp.LoginView": {
        "UILabel": {
            "tintColor": "@primaryColor"
        },
        "UIButton": {
            "backgroundColor": "Alpha(@primaryColor, 80)"
        }
    }
}

In addition to these functions StyleKit will also provide a function registry so developers can add their own custom functions.

@BernardGatt BernardGatt added this to the 1.0 milestone Sep 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant