gettengineering / prism Goto Github PK
View Code? Open in Web Editor NEWGett's Design System code generator. Use Zeplin Styleguides as your R&D's Single Source of Truth.
Home Page: https://prism.tools
License: MIT License
Gett's Design System code generator. Use Zeplin Styleguides as your R&D's Single Source of Truth.
Home Page: https://prism.tools
License: MIT License
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:
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!
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
I'm getting the following output. Do you have any advice for me?
prism generate
❌ Error: Failed decoding Array<TextStyle>
Hi,
Can the Prism TextStyle be used within a xib / storyboard?
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.I notices some tokens output floats, where others seem to look like integer.
textStyle.fontSize
gives a floattextStyle.lineHeight
appears to be an integerin 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.
Are there plans to support Zeplin Global Styleguides and Styleguide trees with parent‑child relationships?
I am wondering if Prism can download full screen and convert them into xml ? Or could you point to where can I find it in the docs? Thanks :)
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.
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.
Here is my text style in Zeplin:
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?>
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?
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.
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.
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.