All Projects → uber → Stylist

uber / Stylist

Licence: apache-2.0
A stylist creates cool styles. Stylist is a Gradle plugin that codegens a base set of Android XML themes.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Stylist

Styled Components Theme
Defines themes via flexible color selectors for use with styled-components
Stars: ✭ 302 (-14.69%)
Mutual labels:  themes, styles
highcharts-themes-collection
Highcharts themes collection
Stars: ✭ 30 (-91.53%)
Mutual labels:  themes, styles
Estilo
Create color schemes for Vim, Airline and Lightline
Stars: ✭ 282 (-20.34%)
Mutual labels:  themes
Themecreator
https://mswift42.github.io/themecreator/ create themes for intellij, textmate, atom, emacs, vim and gnome terminal.
Stars: ✭ 303 (-14.41%)
Mutual labels:  themes
Merge Duplicate Symbols
Sketch plugin to merge symbols and layer&text styles.
Stars: ✭ 272 (-23.16%)
Mutual labels:  styles
Theme.sh
A script which lets you set your $terminal theme.
Stars: ✭ 290 (-18.08%)
Mutual labels:  themes
Prism
Gett's Design System code generator. Use Zeplin Styleguides as your R&D's Single Source of Truth.
Stars: ✭ 308 (-12.99%)
Mutual labels:  codegen
Rigel
🌌 Colorscheme for vim, terminal, vscode and slack - based on the star Rigel ✨.
Stars: ✭ 324 (-8.47%)
Mutual labels:  themes
Hack Codegen
Library to programatically generate Hack code and write it to signed files
Stars: ✭ 322 (-9.04%)
Mutual labels:  codegen
Docsify Themeable
A delightfully simple theme system for docsify.js. Features multiple themes with rich customization options, an improved desktop and mobile experience, and legacy browser support (IE10+).
Stars: ✭ 299 (-15.54%)
Mutual labels:  themes
Caffeine Theme
A minimalist, Material Design inspired Ghost Theme for optimal desktop and mobile experiences
Stars: ✭ 300 (-15.25%)
Mutual labels:  themes
Color Studio
It is too hard to build coherent and accessible themes with the right colors. This should help.
Stars: ✭ 289 (-18.36%)
Mutual labels:  themes
Betterdiscordaddons
A series of plugins and themes for BetterDiscord.
Stars: ✭ 310 (-12.43%)
Mutual labels:  themes
Hyper Site
The official website for the Hyper terminal
Stars: ✭ 289 (-18.36%)
Mutual labels:  themes
Xaringanthemer
😎 Give your xaringan slides some style
Stars: ✭ 337 (-4.8%)
Mutual labels:  themes
Interfaces
Code generation tools for Go.
Stars: ✭ 279 (-21.19%)
Mutual labels:  codegen
Costumekit
Base types for theming an app.
Stars: ✭ 300 (-15.25%)
Mutual labels:  themes
Kube
Kube is a professional and a responsive Hugo theme for developers and designers that offers a documentation section mixed with a landing page and a blog.
Stars: ✭ 349 (-1.41%)
Mutual labels:  themes
Git Cop
DEPRECATED: Use Git Lint (https://www.alchemists.io/projects/git-lint) instead.
Stars: ✭ 352 (-0.56%)
Mutual labels:  styles
Cxjs
CxJS - Advanced JavaScript UI framework for admin and dashboard applications with ready to use grid, form and chart components.
Stars: ✭ 345 (-2.54%)
Mutual labels:  themes

Stylist Build Status

As Android apps grow, providing common styling across app themes becomes challenging. Typically, this results in copy-pasting style items across themes, monolithic themes, or complicated inheritance trees. Stylist is a highly-extensible platform for creating and maintaining an app’s base set of Android XML themes.

Overview

Stylist is a Gradle plugin written in Kotlin that generates a base set of Android XML themes. Stylist-generated themes are created using a stencil and trait system. Each theme is declared with a single stencil, which is comprised of sets of logically-grouped style items. All of this comes together to create an easily maintainable system of stencils and traits.

ThemeStencils: A 1:1 ratio of ThemeStencils to corresponding generated themes. Each ThemeStencil declares a theme name and parent theme plus any extra StyleItemGroups that should be included in addition to the globally applicable set.

StyleItemGroups: Each StyleItemGroup can be declared by multiple ThemeStencils and generate otherwise duplicated style items across all themes that include them. Common examples include default app colors, font sizes, and common dimension values. They are a logical groupings of custom theme attributes that get included in each theme that declares the group.

Usage

A simple ThemeStencilProvider that defines text sizes in Dark and Light themes would look like:

@AutoService(ThemeStencilProvider::class)
class SampleThemeStencilProvider : ThemeStencilProvider {

  private val textSizes = StyleItemGroup(
      StyleItem("textSizeSmall", "12dp"),
      StyleItem("textSizeMedium","16dp"),
      StyleItem("textSizeLarge", "20dp")
  )

  override fun stencils() = linkedSetOf(
      ThemeStencil("Theme.Sample.Dark", "Theme.AppCompat"),
      ThemeStencil("Theme.Sample.Light", "Theme.AppCompat.Light")
  )

  override fun globalStyleItemGroups() = linkedSetOf(
      textSizes
  )
}

Leaving you with a generated themes XML resource file like this:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<resources>
  <style name="Theme.Sample.Dark" parent="Theme.AppCompat">
    <item name="textSizeSmall">12dp</item>
    <item name="textSizeMedium">16dp</item>
    <item name="textSizeLarge">20dp</item>
  </style>
  <style name="Theme.Sample.Light" parent="Theme.AppCompat.Light">
    <item name="textSizeSmall">12dp</item>
    <item name="textSizeMedium">16dp</item>
    <item name="textSizeLarge">20dp</item>
  </style>
</resources>

This may look like a lot of boilerplate for simple style item shared by two themes, but it scales quite well when you want to have many custom color, dimension, and other style items on numerous app themes and custom theme attributes.

Download

Stylist Maven Central

classpath 'com.uber.stylist:stylist:0.0.2'

Stylist Core Maven Central

classpath 'com.uber.stylist:stylist-core:0.0.2'

Stylist API Maven Central

classpath 'com.uber.stylist:stylist-api:0.0.2'

License

Copyright (C) 2018 Uber Technologies

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].