Closed svickars closed 1 year ago
Latest commit: 5dcfc874ca7d16ac517c753bd395695c7b4bf2fd
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
re: weird characters: because we are exporting html as headless and technically only a partial of HTML, we lack the <meta charset="utf-8">
meta tag that would handle encoding of commas and other symbols. This is a non-issue for us. To verify, plop the exported partial into a true html page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<!-- put figma2html export here -->
</body>
</html>
I've edited the attribute application. This removes the applyHTags
config option in favor of a more robust way of adding attributes. In short, use tag="h1"
in the [f2h]
text block to change from <p>
to <h1>
. From the new docs:
Including custom attributes: you can include custom attributes on a text layer by naming the layer
[f2h]
followed by a list of attributes in HTMl attribute format. For example, a text layer named[f2h]class="text-sm font-sans" id="my-text-layer"
will render as<p class="font-sans text-sm" id="my-text-layer">
. This can be useful for including Tailwind and other utility classes. You also can use a reservedtag
attribute to change the default<p>
tag to one of your choosing (ex:[f2h] tag="h1" id="hed" class="text-xl font-bold"
will render<h1 id="hed" class="text-xl font-bold">
). Note that naming your layers like this will not turn offStyle text elements
for that node, and will still include inline styling for child spans. To rely purely on class names for styling, turn off theStyle text elements
option.
Fixes a few things:
Apply header tags
feature was no longer working. I turned that off and have everything defaulting top
elements for now.null
whenFluid container width
is turned on.tempFrame
converts frames (that have text children), auto layouts, and components to groups and detaches instances, which means text nodes are have correct positioning, relative to the base frame.withModificationsForExport
to just remove those nodes from thetempFrame
.Still seeing issues (some new, some old) when testing in the playground file:
Files to test on: Playground Playground (UFOs) Positioning bug