Skip to content

Commit 0e329df

Browse files
authored
Merge pull request #551 from zihanKuang/improve-css
Style: Responsive Images/Figures & SCSS/Content Cleanup
2 parents 497dff5 + f117d0f commit 0e329df

File tree

3 files changed

+48
-68
lines changed

3 files changed

+48
-68
lines changed

assets/scss/_styles_project.scss

Lines changed: 33 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,20 @@ body {
122122
border: 0;
123123
}
124124
}
125+
126+
img,
127+
.md__image img,
128+
img.md-image-responsive {
129+
display: block;
130+
width: 100%;
131+
max-width: clamp(320px, 100%, 700px);
132+
height: auto;
133+
margin: 0 auto;
134+
object-fit: contain;
135+
box-sizing: border-box;
136+
}
137+
138+
overflow-x: hidden;
125139
}
126140

127141
// Links
@@ -166,7 +180,6 @@ a:not([href]):not([class]):hover {
166180
text-decoration: none;
167181
transition: color 0.2s;
168182
clip-path: polygon(100% 0, 100% 100%, 0.8em 100%, 0 50%, 0.8em 0);
169-
clip-path: polygon(100% 0, 100% 100%, 0.8em 100%, 0 50%, 0.8em 0);
170183

171184

172185
&:hover {
@@ -456,67 +469,33 @@ a:not([href]):not([class]):hover {
456469
}
457470
}
458471

459-
figure,
460-
figure[style*="width"] {
461-
width: max-content !important;
462-
max-width: 70% !important;
472+
.td-content figure,
473+
.td-content figure {
474+
width: max-content;
475+
max-width: clamp(320px, 100%, 700px);
463476
margin: 0 auto 2rem auto;
464-
477+
box-sizing: border-box;
465478
display: flex;
466479
flex-direction: column;
467480
align-items: center;
468-
469-
> img {
470-
width: auto !important;
471-
max-width: 100% !important;
472-
height: auto;
473-
object-fit: contain !important;
474-
display: block;
475-
margin: 0 auto;
476-
border-radius: .5rem .5rem 0rem 0rem !important;
477-
box-shadow: 0 0 0.5rem rgba(0, 179, 159, 0.4) !important;
478-
479-
&:hover {
480-
cursor: pointer;
481-
}
482-
}
483-
484-
> figcaption {
485-
width: 100% !important;
486-
text-align: center;
487-
padding: 0.5rem 1rem;
488-
background-color: rgba($lightslategray, 1);
489-
color: $dark;
490-
border-radius: 0 0 .5rem .5rem;
491-
box-sizing: border-box;
492-
}
493481
}
494482

495-
// Mobile: override for full-width content alignment
496-
@media (max-width: 600px) {
497-
figure,
498-
figure[style*="width"] {
499-
max-width: 100% !important;
500-
box-sizing: border-box;
501-
}
502-
}
503-
504-
.md__image img,
505-
img.md-image-responsive {
483+
.td-content figure > img {
506484
width: auto;
507-
max-width: 70%;
508-
max-height: 80vh;
509-
height: auto;
510-
display: block;
511-
margin: 0 auto;
512-
object-fit: contain;
485+
max-width: 100%;
486+
border-radius: .5rem .5rem 0 0;
487+
box-shadow: 0 0 0.5rem rgba(0, 179, 159, 0.4);
488+
transition: box-shadow 0.2s;
489+
}
513490

514-
@media (max-width: 600px) {
515-
width: auto;
516-
max-width: 100%;
517-
padding: 0 1rem;
518-
box-sizing: border-box;
519-
}
491+
.td-content figure > figcaption {
492+
width: 100%;
493+
text-align: center;
494+
padding: 0.5rem 1rem;
495+
background-color: rgba($lightslategray, 1);
496+
color: $dark;
497+
border-radius: 0 0 .5rem .5rem;
498+
box-sizing: border-box;
520499
}
521500

522501
.dashboard {

content/en/kanvas/advanced/performance/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Kanvas supports up to 1,000 relationships per design. Exceeding this limit can i
4747

4848
Tags are indexed and searchable. However, the performance of design operations may degrade as the number of tags increases. To ensure an optimal user experience, we recommend using tags judiciously and limiting the number of tags used in a design.
4949

50-
Upon loading a design exceeds that exceeds 20 tags within a single design, Kanvas will automatically disable grouping by tags. You can manually enable grouping by tags by clicking the Group Components button in the Designer dock. For more information, see [Working with Tags](/kanvas/designer/tagsets/).
50+
Upon loading a design exceeds that exceeds 20 tags within a single design, Kanvas will automatically disable grouping by tags. You can manually enable grouping by tags by clicking the "Group Components" button in the Designer dock. For more information, see [Working with Tags](/kanvas/designer/tagsets/).
5151

5252
<!--
5353
#### Maximum Number of Relationships per Component
@@ -87,7 +87,7 @@ In the same way, as you toggle the evaluation of different types of relationship
8787
Using the Layers panel you control the level of sophistication or simplicity of the rendering of components and relationships in your designs. You can both simplify your design layout by removing unnecessary elements and improve performance simultaneously. Alternatively, you can increase the level of detail in your design by enabling additional layers and relationships, while controlling the balance between detail and performance.
8888

8989
{{< alert type="info" title="Keep It Lightweight" >}}
90-
Hide layers you dont need at the moment to keep your workspace lightweight and responsive.
90+
Hide layers you don't need at the moment to keep your workspace lightweight and responsive.
9191
{{< /alert >}}
9292

9393
### Optimize use of Images in your Design

content/en/kanvas/designer/comments/index.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ aliases:
1212

1313
Kanvas's Designer enables you to place comments "inline" with your infrastructure as code. Use comments to offer feedback to team members, take detailed design notes, capture helpful tips for your team members, and include justification as to your infrastructure and application configuration decisions. Pay it forward to your future self by leaving historical record for reference later.
1414

15-
<figure style="width:400px;">
15+
<figure>
1616
<img src="./kanvas-comment.png" alt="Comments in Designer" />
1717
<figcaption>Example of comments in Designer</figcaption>
1818
</figure>
@@ -28,7 +28,7 @@ You can add comments in a number of convenient ways. Since designs are public by
2828
1. Click on the comment icon in the toolbar to open a comment instantly. This is your go-to method for quick annotations without leaving your design or first identifying where you want to place your comment.
2929
2. You can also create a comment by dragging and dropping the comment icon from the Dock to your design. This method allows you to place comments directly on specific elements or areas of your design.
3030

31-
<figure style="width:400px;">
31+
<figure>
3232
<img src="./comment-dock.png" alt="Create a comment from the Dock" />
3333
<figcaption>Create a comment from the Dock</figcaption>
3434
</figure>
@@ -37,7 +37,7 @@ You can add comments in a number of convenient ways. Since designs are public by
3737

3838
Context-click on any area of your design, and from the contextual menu, select "Add a Comment". Using this context-click method allows for inline placement of your remarks right where you need them - *in context*.
3939

40-
<figure style="width:400px;">
40+
<figure>
4141
<img src="./comment-canvas.png" alt="Comment by context-clicking on your design" />
4242
<figcaption>Comment by context-clicking on your design</figcaption>
4343
</figure>
@@ -48,7 +48,7 @@ Context-click on any area of your design, and from the contextual menu, select "
4848

4949
## Design review using comments
5050

51-
<figure style="width:400px;">
51+
<figure>
5252
<img src="./conversation-screenshot.png" alt="Peer review using comments in Designer" />
5353
<figcaption>Peer review using comments in Designer</figcaption>
5454
</figure>
@@ -79,7 +79,7 @@ You can also reopen comments.
7979

8080
### View Comment History
8181

82-
<figure style="width:400px;">
82+
<figure>
8383
<img src="./comments-conversation.gif" alt="View comment history" />
8484
<figcaption>View comment history</figcaption>
8585
</figure>
@@ -123,7 +123,7 @@ Learn more about [sharing settings](/kanvas/designer/sharing).
123123

124124
- **Right-click and Copy**: Choose **Copy** to manually paste it later.
125125

126-
<figure style="width:400px;">
126+
<figure>
127127
<img src="./comment-copy.gif" alt="Copy a comment" />
128128
<figcaption>Copy a comment</figcaption>
129129
</figure>
@@ -158,7 +158,7 @@ Kanvas auto-generates comment names, useful for quick feedback. When duplicating
158158
You can temporarily hide or reveal open comments using the Layers panel—just like toggling layers in Photoshop.
159159
This helps you focus on the most important parts of your design and improves clarity during reviews.
160160

161-
<figure style="width:400px;">
161+
<figure>
162162
<img src="./comments-hide.png" alt="Hide comments using Layers" />
163163
<figcaption>Hide comments using the Layers panel</figcaption>
164164
</figure>
@@ -171,8 +171,9 @@ Want to improve the performance of your workspace? [Learn more about using the L
171171

172172
If you plan to keep certain comments in your design for documentation, team reference, or historical context, it's a good idea to give them meaningful names. This simple habit improves clarity for both you and your team—especially when reviewing or revisiting designs later.
173173

174-
<figure style="width:400px;">
174+
<figure>
175175
<img src="./naming-comments.png" alt="Naming a comment in Designer" />
176+
<figcaption>Naming a comment in Designer</figcaption>
176177
</figure>
177178

178179
{{< alert type="info" title="Best Practice" >}}
@@ -186,7 +187,7 @@ If a comment is resolved by mistake, it can be reopened. Adding a new comment to
186187

187188
Follow the steps below to reopen a comment:
188189

189-
<figure style="width:400px;">
190+
<figure>
190191
<img src="./comments-unresolved.gif" alt="Unresolving comments in designer" />
191192
<figcaption>Unresolving comments in designer</figcaption>
192193
</figure>
@@ -195,7 +196,7 @@ Follow the steps below to reopen a comment:
195196

196197
Each time that a new comment is made in a design, remark placed into existing comment, a comment is resolved or reopened, you and your collaborators might receive notification via email.
197198

198-
<figure style="width:400px;">
199+
<figure>
199200
<img src="./example-notification-email.png" alt="Example email notification received when design comment is made" />
200201
<figcaption>Example email notification received when design comment is made.</figcaption>
201202
</figure>
@@ -214,14 +215,14 @@ Customize your [notification preferences](/cloud/identity/users/notification-pre
214215

215216
Customize your notification preferences to mute email notifications for comments on your design. With notifications for new comments silenced, you won't receive email notifications for new comments on your design. This can be useful if you want to temporarily pause notifications or reduce email clutter.
216217

217-
<figure style="width:400px;">
218+
<figure>
218219
<img src="./comment-notificationBell.png" alt="Turn Off notification from comments in designer" style="width:auto">
219220
<figcaption>Example of comments in Designer</figcaption>
220221
</figure>
221222

222223
You can also manage all your comment notification settings centrally through the **Cloud -> Account -> [Preference](https://docs.layer5.io/cloud/identity/users/notification-preferences/)**.
223224

224-
<figure style="width:400px;">
225+
<figure>
225226
<img src="./comment-cloud-manage.png" alt="Manage comment notifications in the Cloud Portal" style="width:auto">
226227
<figcaption>Manage all comment notifications centrally in the Cloud</figcaption>
227228
</figure>

0 commit comments

Comments
 (0)