https://linen.dev logo
Join Discord
Powered by
# react
  • a

    ambitious-knife-25690

    07/10/2020, 1:54 PM
    It's just from this code snippet
  • a

    ambitious-knife-25690

    07/10/2020, 1:55 PM
    would
    backgroundColor: 'fade(theme.palette.common.white, 0.15)',
    not work as well?
  • u

    user

    07/10/2020, 1:55 PM
    You can do string interpolation yourself in this one
  • u

    user

    07/10/2020, 1:56 PM
    If you don't, theme.palette.x won't be resolved
  • u

    user

    07/10/2020, 1:57 PM
    Oh, it's just not meant to be quoted
  • u

    user

    07/10/2020, 1:57 PM
    Well I'm not sure I exposed functions like
    fade
    .. maybe they're somewhere x)
  • a

    ambitious-knife-25690

    07/10/2020, 1:58 PM
    neither are working
  • a

    ambitious-knife-25690

    07/10/2020, 1:58 PM
    so maybe fade isn't exposed?
  • u

    user

    07/10/2020, 1:58 PM
    It's not, and it wouldn't work inside a string anyway
  • u

    user

    07/10/2020, 1:58 PM
    That's meant to be a function call
  • u

    user

    07/10/2020, 2:00 PM
    https://github.com/kLabz/haxe-material-ui/issues/3 Yup, styles API is WIP
  • a

    ambitious-knife-25690

    07/10/2020, 2:00 PM
    yeah, that's fine i don't mind
  • a

    ambitious-knife-25690

    07/10/2020, 2:01 PM
    just getting a grasp for whether or not i'm being an dumb x)
  • u

    user

    07/10/2020, 2:02 PM
    The
    [theme.breakpoints.up('sm')]: { ...
    syntax is annoying.. I could somehow support it in haxe but that's not as easy as string interpolation since it wants a real array, not a string representation of an array (so I cannot just tell haxe to do string interpolation there)
  • u

    user

    07/10/2020, 2:03 PM
    Well I guess I'll just add string interpolation support and that'll be
    '${theme.breakpoints.up('sm')}': { ... }
    ,
    '${theme.breakpoints.up('sm')}, ${theme.breakpoints.up('md')}': { ... }
    , etc.
  • u

    user

    07/10/2020, 2:04 PM
    Seems close enough, mostly because they don't seem to use it much for more than one item x)
  • a

    ambitious-knife-25690

    07/10/2020, 2:05 PM
    heh
  • a

    ambitious-knife-25690

    07/10/2020, 2:05 PM
    is there an example in the repo of how to implement
    fade
    ? I'm not familiar with macros but I have a bit of spare time that I could maybe go fiddling
  • a

    ambitious-knife-25690

    07/10/2020, 2:06 PM
    assuming it's something "simple"
  • u

    user

    07/10/2020, 2:06 PM
    fade
    should just be an extern to
    fade
    in '@material-ui/core/styles'
  • a

    ambitious-knife-25690

    07/10/2020, 2:08 PM
    :o
  • a

    ambitious-knife-25690

    07/10/2020, 2:08 PM
    it's already here
  • u

    user

    07/10/2020, 2:09 PM
    Nah
  • u

    user

    07/10/2020, 2:09 PM
    That's the Fade component, not the same thing
  • u

    user

    07/10/2020, 2:11 PM
    This works
    Copy code
    @:jsRequire('@material-ui/core/styles', 'fade')
    extern class Fade {
    	// Note: using T instead of real color type because I don't remember where
    	// it is (or if it exists) x)
    	@:selfCall
    	public static function fade<T>(color:T, amount:Float):T;
    
    }
    No idea about actual arguments, etc. though
  • u

    user

    07/10/2020, 2:13 PM
    T
    seems to be just
    String
  • u

    user

    07/10/2020, 2:13 PM
    I'd use
    ColorString
    from
    mui.Colors
    I guess
  • a

    ambitious-knife-25690

    07/10/2020, 2:13 PM
    mfw
  • a

    ambitious-knife-25690

    07/10/2020, 2:13 PM
    lol
  • u

    user

    07/10/2020, 2:14 PM
    Your search is broken :P
1...505152...80Latest