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

`Text.style` supersedes `Text.color` #166

Closed
kasbah opened this Issue Feb 10, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@kasbah
Contributor

kasbah commented Feb 10, 2015

First applying a style seems to make it impossible to then use Text.color.

http://share-elm.com/sprout/56506538e4b05f0d6cc4a102

import Graphics.Element (..)
import Graphics.Collage (..)
import Text (..)
import Text
import Color (..)

redText : String -> Text
redText str =
    Text.color red (fromString str)

redText' : String -> Text
redText' str =
    Text.color red (style defaultStyle (fromString str))

main : Element
main = flow down 
  [ leftAligned <| redText  "Hello, World!"
  , leftAligned <| redText' "Hello, World!"
  ]
@rubytree

This comment has been minimized.

Show comment
Hide comment
@rubytree

rubytree Nov 21, 2015

@kasbah I think it works with 0.15

rubytree commented Nov 21, 2015

@kasbah I think it works with 0.15

@kasbah

This comment has been minimized.

Show comment
Hide comment
@kasbah

kasbah Nov 21, 2015

Contributor

Yes, looks good in 0.15

http://share-elm.com/sprout/5650560be4b05f0d6cc4a0ee

import Graphics.Element exposing (..)
import Graphics.Collage exposing (..)
import Text exposing (..)
import Text
import Color exposing (..)

redText : String -> Text
redText str =
    Text.color red (fromString str)

redText' : String -> Text
redText' str =
    Text.color red (style defaultStyle (fromString str))

main : Element
main = flow down 
  [ leftAligned <| redText  "Hello, World!"
  , leftAligned <| redText' "Hello, World!"
  ]
Contributor

kasbah commented Nov 21, 2015

Yes, looks good in 0.15

http://share-elm.com/sprout/5650560be4b05f0d6cc4a0ee

import Graphics.Element exposing (..)
import Graphics.Collage exposing (..)
import Text exposing (..)
import Text
import Color exposing (..)

redText : String -> Text
redText str =
    Text.color red (fromString str)

redText' : String -> Text
redText' str =
    Text.color red (style defaultStyle (fromString str))

main : Element
main = flow down 
  [ leftAligned <| redText  "Hello, World!"
  , leftAligned <| redText' "Hello, World!"
  ]

@kasbah kasbah closed this Nov 21, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment