Skip to content

Instantly share code, notes, and snippets.

@alyssais
Last active January 2, 2016 21:29
Show Gist options
  • Save alyssais/8364168 to your computer and use it in GitHub Desktop.
Save alyssais/8364168 to your computer and use it in GitHub Desktop.
This is going to make @matthewmascioni cry.
Teacup::Stylesheet.new :main do
style :fill,
constraints: [
:full_width,
:full_height
]
style :entry,
constraints: [
constrain(:left).equals(:superview, :left).plus(50),
constrain(:right).equals(:superview, :right).minus(50),
constrain(:center_y).equals(:superview, :center_y),
constrain(:height).gte(448)
]
style :avatar,
layer: {
cornerRadius: 30,
masksToBounds: true
},
constraints: [
constrain_left(20),
constrain_top(20),
constrain_width(60),
constrain_height(60)
]
style :name,
constraints: [
constrain(:left).equals(:avatar, :right).plus(20),
constrain(:right).equals(:superview, :right),
constrain(:center_y).equals(:avatar, :center_y)
]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment