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

RCT-3428: Fix natural height size #181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/dist/docs.min.css

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions scss/components/frames.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.layout-tiles {
&.force-natural-figma-frame-height {
.grid {
.tile-item {
.preview {
height: fit-content;
width: fit-content;
padding: 8px;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took this padding from the editor, please let me know if it's OK @honzatmn

background-image: none;
}
}
}
}
}

1 change: 1 addition & 0 deletions scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
@import './blocks/guidelines';
@import './blocks/figma-component-props-table';
@import './blocks/figma-components';
@import './components/frames.scss';

/* =================================== */

Expand Down
6 changes: 3 additions & 3 deletions src/page_body/structure/blocks/page_block_frames.pr
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

{[ let variant = block.variantKey /]}

{[ log block.properties /]}
{* Configure tile to show natural height if needed *}
{[ let forceNaturalHeight = (block.properties.alignment === "FrameHeight" || block.properties.layout == "C1" || block.properties.layout == "C1_75") /]}

Comment on lines -6 to -7
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure as to why we were defaulting to forceNaturalHeight with 1 column layouts, maybe you can help me out with this? @honzatmn

{[ let forceNaturalHeight = (block.properties.alignment === "FrameHeight") /]}
{* Render tile per rendered frame *}
<div class="content-block content-block--frames layout-tiles{{ getVariantClass(variant) }}{{ forceNaturalHeight ? " force-natural-height" : " with-subgrid" }}">
<div class="content-block content-block--frames layout-tiles{{ getVariantClass(variant) }}{{ forceNaturalHeight ? " force-natural-figma-frame-height" : " with-subgrid" }}">
<div class="grid {{ (block.properties && block.properties.layout) ? block.properties.layout.lowercased() : "c4" }}">
{[ for frame in block.frames ]}
{[ inject "page_block_frame" context { "frame": frame, "showTitles": block.properties.showTitles } /]}
Expand Down