Skip to content

Mixins #34

@BernardGatt

Description

@BernardGatt

Mixins will give the ability to anyone styling the application to save and reuse styles, a mixin is created by treating an alias as a normal Class that requires styling, StyleKit will then associate all the styles contained in the block to that alias. Mixins would then be used by setting the mixins property that will be available on every component and passing in one or more aliases.

{
    "@primaryColor": "#641E16",
    "@secondaryColor": "#17202A",
    "@tertiaryColor": "#424949",
    "@textFieldStyle": {
        "font": "HelveticaNeue-Light:25.0",
        "color": "@primaryColor",
        "border": 0.5,
        "cornerRadius": 8.0
    },
    "MyApp.LoginView": {
        "MyApp.MainTextField": {
            "mixins": ["@textFieldStyle"],
            "backgroundColor": "@secondaryColor"
        },
        "MyApp.SecondaryTextField": {
            "mixins": ["@textFieldStyle"],
            "backgroundColor": "@tertiaryColor"
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions