Skip to content

Instantly share code, notes, and snippets.

@mdgriffith
Last active March 14, 2017 15:20
Show Gist options
  • Save mdgriffith/af7d6f9d7d0a76407ef9cfafb7f6bab8 to your computer and use it in GitHub Desktop.
Save mdgriffith/af7d6f9d7d0a76407ef9cfafb7f6bab8 to your computer and use it in GitHub Desktop.
-- A Color Palette is a record that tracks
-- border, text and background color
primary =
Style.Color.palette
{ border = Color.blue
, text = Color.red
, background = Color.white
}
roboto =
Style.Font.importGoogle
{ family = "Roboto"
, size = 20
, lineHeight = 1
}
stylesheet =
Style.stylesheet
[ style Test
[ Font.current
|> Font.bold
|> Font.size 20
|> Font.lineHeight 1
, Color.paletteFrom -- use the palette from above
primary
]
, style ExampleButton
[ Font.named roboto
|> Font.size 18
|> Font.letterSpacing 20
|> Font.light
|> Font.align center
|> Font.uppercase
, Color.transparent -- Start with a transparent palette
|> Color.text primary -- And replace the text color
-- with the text color
-- from the primary color palette
, box
|> width (px 100)
|> height (px 100)
|> padding (all 5)
, border
|> Border.width (all 5)
|> Border.radius (all 5)
|> Border.style solid
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment