The short answer is “not yet”. But the long answer needs a bit of context.
Penpot supports various CSS generation options tied to our Layout features. Since we use open standards (SVG/HTML/CSS) to render our design, it’s trivial for us to give you an exact CSS representation of the layout rules that apply to your design as well as all the SVG code that you need.
Same design showing Flex Layout CSS (left) and standard CSS layout (right)
We will soon support Grid CSS on top of Flex CSS and other CSS rendering methods will follow.
Going from a design artifact to its CSS representation is simple enough because you control the means of which that design artifact (ie: a board with multiple elements arranged in a particular way) is created. The design activity uses discrete Penpot options to produce a valid result like padding input or alignment choices.
The other way round is tougher, though. Getting ANY CSS code and inferring a no-loss deterministic design representation would require processing the input and pushing it through a CSS rendering engine like browsers have. We would need to work on a 1:1 representation between any CSS property and Penpot visual representation.
Answer to the question
This is definitely something that would be supercool but we need to understand the main use case for this. If the use case is “I prefer to directly edit CSS code for Flex Layout input rather than using Penpot UI” then we don’t see a very compelling use case given the complexity of the task.
For other uses cases, we would like to listen to the community and understand what’s the ultimate goal for this as well as the sacrifices they would be willing to take in exchange. This is a “live FAQ” so please feel free to detail your use case so we can better gauge the benefits of having this.
Btw. on professional level in modern era of interface design, we don’t need everything generated by design tools. We (both designers and developers) need to understand more about how it works on both sides. Building (also both design and development) interfaces for decade, and I never use everything from generated code in Adobe XD, Sketch, Figma etc. Since this is really nice that you can copy and paste the whole code from design tools and it works, I think it’s not so much useful in most of the cases, because we use preselected variables, we have own system, we know how to define CSS and so on (I mean if you do it for a living).
Having something like code inspector, where I can see separated predefined styles like colors, typography, spacing, border radiuses, etc. is something where I see huge value. If design tool allow me define styles or layout properties like spacing (that are used across the design files), and then export e.g. in various formats (CSS, Sass, JSON etc.), then it starts to get quite interesting and no design tool has it yet. This transfers more responsibility to the designer, and the developer cannot then implement the designs incorrectly, because he simply has everything he needs.