Join the Webstudio community

Updated 3 weeks ago

Way to reuse my custom colour variables in another project?

Neither can I replace global root in a new project, nor do instances that carry [variable] bring this variable into the new project. Variables always go missing when pasting to new projects. What's the mistake I make?
H
B
O
30 comments
Example: A button has slightly transparent white text, assigned as a variable. When I paste to a new project, the text comes in black (and the variable is missing in GR / Advanced).
You can always copy them from css preview and paste into advanced section input.
Though yeah, variables are not carried along with instances.
@Bogdan did we do this by mistake or intentionally?
Intentionally
To make variables transferrable it is better to use fallbacks and rely on variables only for customization.
because of the potential conflicts with variables on the target project, right?
I think this could be solved by having multiple copy options, e.g. "copy with CSS variables"
You can always copy them from css preview and paste into advanced section input.
Thank you, Bogdan!
I think this could be solved by having multiple copy options, e.g. "copy with CSS variables"
Alternatively you might show an equalent to such a dialog that wants to prevent exact duplicates in an image-database.
Attachment
2024-12-17_21h39_15.webp
I still don't get the proposed flow. In source project I can copy variables from CSS Preview, below Navigator. In target project, I cannot paste to CSS Preview of Global Root (error shown).
Attachment
2024-12-17_22h10_14.webp
Paste the styles into the advanced panel
Attachment
image.png
Thank you! I wasn't aware that this input accepts pasting multiple values
what would be making it more obvious?
placehoder with actual styles?
It worked.

what would be making it more obvious?
Puh, honestly this is hard to get across with a single line slit and your already introduced convention to add single properties with +.

To make this more obvious, it may be necessary to do something that technically speaking isn't needed – but helps understand.

I would try adding a line underneath the input.

Batch add

Clicking that link would enlarge the input, hide the dropdown chevron and the + and instead show a paste-icon.
Attachment
image.png
hmm, making the input 2 lines high from the beginning sounds like a good solution
indicates multiline nature
no, can't, its actually meant single-line so oyu can hit enter to submit
Yeah, I'd tend to create a separate GUI. The existing slit is already loaded with its combination of pick from list and create.
I recall I had a conversation with @Bogdan as this was implemented, his angle was mostly that user would usually type one property/value and hit enter and pasting is basically an added benefit
but I was back then already seeing that the pasting won't be obvious
need to put more thoughts into this UI
One could also separate the contexts "select predefined" and "create".

If selecting from list would no longer be combined with an Input, you could show a simple dropdown for "select" and a multi-row input for "create".
can't do that, that list is basically so long that we need a search interface aka combobox
could only add additional paste box or paste button basically
but that doesn't seem nice either
Iirc you want to create workspaces to administer Tokens and Variables. If this also gets the future place to import, you maybe don't have to spend too much time on refining the experience in "Advanced". Maybe you could use PostHogs Feature Flags to explain a few concepts here and there? https://posthog.com/feature-flags
Add a reply
Sign up and join the conversation on Discord