Code Monkey home page Code Monkey logo

prism's People

Contributors

artemnovichkov avatar freak4pc avatar omaralbeik avatar ultravibez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prism's Issues

Prism in-app "Hot Reload"

Hi,
I was wondering to know if there is the possiblity to allow Prism to automatically download the updated colours/font/whatever file directly from Zeplin even when the application is live.

USE CASE:

  1. I released on the store the myApp v:1.0.0 where all my button are blue
  2. I change the buttonColor inside the Zeplin board from blue to green
  3. The very next time I open myApp it automatically download the new colour file and magically all my buttons turns to green.

In my understanding at the moment this is not possible, because I have to manually generate the colours file from the console and then later add it in my Xcode project.

Is it correct ?

Thank you very much!

FontName SnakeCase for Android compatibility

Hi @freak4pc!

Nice work so far!
Just found something that's annoying me
At the Examples/Android folder for textStyles it's using:

<item name="android:fontFamily">@font/{{% textStyle.fontName|lowercase|replace(-,_) %}}</item>
On that part it's using the transformation lowercase and replace but when I run the prism generate I get an error ❌ Error: There is no transformation called 'replace(-,_) ' or lowercase if I delete that transformation.
Is there something I'm missing? Do you think it make sense to add the snakecase token for this property also?
Cheers

xib Support

Hi,
Can the Prism TextStyle be used within a xib / storyboard?

Allow installing via Homebrew

Hello, guys! At first, thanks for the tool! It looks useful and solid, especially for syncing. BTW, I use Zepcode, Zeplin extension for Swift code snippets, but extensions have no logic for syncing. Anyway, I tried to install Prism with attached release, but have two errors

  • “prism-macOS.dms” cannot be opened because it is from an unidentified developer.. Classic security error.
  • The contents of "prism-macOS.dms" cannot be extracted with The Unarchiver after allowing to install the package.
    It's not convenient to download and build Prism from sources, especially for new releases. Are you going to add Homebrew support?

textStyle.fontSize does not roundedToNearest

I notices some tokens output floats, where others seem to look like integer.

  • textStyle.fontSize gives a float
  • where textStyle.lineHeight appears to be an integer

in some emitted languages one or the other might not be desirable, or will have to be specified. On further inspection i than noticed that roundToNearest always produces a float. So i assume that by not having any decimal places, it did not appear as one in the emit. This is already quite ideal for languages that don't need that . to specify the type.

Would it be possible for fontSize to be consistent with that rounding? Or do you think different emits would be needed.

I see that it would be nice to keep it rather simple.

Thanks for creating this great project.

HTTP 404 during `prism generate`

Thank you for the amazing tools!!

I face the error below if I use the first project, any other project working fine.
Screen Shot 2020-05-23 at 8 32 43 AM

The first project related to the design system and it contains colors, style guides, and spacing.
Screen Shot 2020-05-23 at 8 37 59 AM

Appreciate your support

Styleguide Trees

Are there plans to support Zeplin Global Styleguides and Styleguide trees with parent‑child relationships?

That one color.a edge case

Now that you introduced inverting conditionals, the alpha component of the color token has come to my attention. In most cases, when it is 1.0, it can be ignored. Unfortunately if it is not, one might need a different emit. For example color.rgb vs color.argb.

Do you think it would make sense to allow to use a conditional on color.a?

In one possible implementation this could be {{% IF color.a %}}. This would match all but 1.0. Which i can see, might be confusing. As the value would cast to the opposite. Alternatively maybe

  • {{% IF color.hasAlpha %}}
  • {{% IF color.isOpaque %}}
  • {{% IF color.a == 1.0 %}}

The latter probably being the most complicated to implement and just opening a completely different can of worms.

Sorry for bombarding you with issues.

Text Style "properties" not exposed as tokens or missing

Thanks @freak4pc for making it possible to test Prism on our project without text style colors. I really like the simplicity of it.

I notices the following font styles are not exposed as tokens:

  • font_weight
  • font_style
  • font_stretch

all but the last one are in the model and apparently not even optional in the API.

Rounding of letter spacing

Here is my text style in Zeplin:
Screenshot 2020-03-12 at 12 48 39
Here is generated code for the style:

static let searchBarPlaceholder: TextStyle = {
        let style = TextStyle()
        style.font = .SFProText-Regular(ofSize: 17.0, weight: .semibold)
        style.kerning = -0.408
        style.color = .additional1d
        style.lineHeight = 22.0
        return style
}()

I guess there are some hidden rules of rounding. I use this logic for code generation. What do you think? Should Prism update digit values from Zeplin?>

Template Loops and last/first line emit

Really love the simplicity of the templating language. I was trying to emit some JSON with it, which unfortunately does not allow trailing commas.

For example, this template

{
  {{% FOR color %}}
  "{{% color.identity.camelcase %}}": "{{% color.rgb %}}",
  {{% END color %}}
}

emits

{
  "black": "#000000",
  "white": "#ffffff",
}

So the trailing comma in the penultimate line is a problem. Do you have any idea how this could be solved?

Ignore style guide ids

Hi,

@freak4pc asked if I wanted to open an issue discussing implementation see #46

We want to be able to not fetch certain style guides, in our workspace we use the same naming in multiple style guides. Because of this, we want to be able to skip the fetching of certain style guides.

Thanks!

Support == and != operands

Based on discussion in #31, it could be nice to support basic operands of equality and inequality for tokens, e.g. :

{{% IF color.alpha == 1.0 %}}

This could have potentially a bunch of edge-cases with numerics, etc, but still worth thinking over and experimenting with.

Support line spacing

Hi! Thanks for this super helpful tool!

I'm currently building templates for an Android app. In Zeplin the line height is defined for some of our text styles (e.g. 18.2) with a text size of e.g. 15. To configure this in Android we need to have the "line spacing extra" being 3.2 in this example (18.2 - 15).

It would be great to do something like {{% textStyle.lineHeight - textStyle.fontSize %}} or a similar syntax.

Link to a detached Styleguide without a project

With the introduction of sectioned projects, there is a very valid use-case of companies that use a project-per-feature and a single base style guide.

In these scenarios, using Prism with a single Project ID is subpar.

We should support using a Styleguide ID, instead of a Project ID, for these specific use-cases.

This would be an if/or scenario, e.g. - you can either use Prism with a Styleguide, or a Project, but not both (which makes sense)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.