Skip to content
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 styles, layer styles and document colors #189

Open
jlarmstrongiv opened this issue May 14, 2023 · 2 comments
Open

🧐[问题]: text styles, layer styles and document colors #189

jlarmstrongiv opened this issue May 14, 2023 · 2 comments

Comments

@jlarmstrongiv
Copy link

jlarmstrongiv commented May 14, 2023

🧐 问题描述

How can I create text styles, layer styles, and document colors?

For symbols, how can I create a symbol, and then use an instance of the symbol when importing my existing html?

💻 示例代码

I was digging around in the source code and found related code:

🚑 其他信息

In html-sketchapp, the docs show:

In html-sketchapp-cli, the docs show:

If it has not been implemented yet, I think the custom data attributes from html-sketchapp-cli are a nice solution:

<div data-sketch-symbol="Button/Primary">...</div>
<div data-sketch-text="Heading">...</div>
<div data-sketch-color="#212121">...</div>
<div data-sketch-symbol="Icon/Reply">...</div>
<div data-sketch-symbol="Icon/Retweet">...</div>
<div data-sketch-symbol="Icon/Like">...</div>

<div data-sketch-symbol="IconRow">
  <div data-sketch-symbol-instance="Icon/Reply">...</div>
  <div data-sketch-symbol-instance="Icon/Retweet">...</div>
  <div data-sketch-symbol-instance="Icon/Like">...</div>
</div>
@arvinxx
Copy link
Collaborator

arvinxx commented May 22, 2023

Actually we don't implement shared styles yet. We should discuss it how to implement

@jlarmstrongiv
Copy link
Author

jlarmstrongiv commented May 22, 2023

@arvinxx

That makes sense—I noticed the nodeToSymbol method, but didn’t find anything on the styles or colors.

I personally like being able to infer everything from the markup—the data-sketch-* is just one way to do that. My use case is generating a sketch library from an html page—importing symbols, text-styles, layer-styles, and color swatches all in one go.

The https://github.com/html-sketchapp/html-sketchapp package came very close to doing that with https://github.com/brainly/html-sketchapp-style-guide, but it required sketch to be installed. I see they did fix the custom ids issue html-sketchapp/html-sketchapp#151, but there haven’t been any releases in years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants