-
Notifications
You must be signed in to change notification settings - Fork 48
feat(why-kmesh): Add thematic sky-blue icons to feature cards #247
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,8 +1,11 @@ | ||||||
import React from "react"; | ||||||
import SectionContainer from "../sectionContainer"; | ||||||
import Translate from "@docusaurus/Translate"; | ||||||
import { Icon } from '@iconify/react'; | ||||||
import "./index.scss"; | ||||||
|
||||||
const SKY_BLUE = "#4FC3F7"; | ||||||
|
||||||
const reasons = [ | ||||||
{ | ||||||
title: <Translate>Smooth compatibility</Translate>, | ||||||
|
@@ -15,6 +18,7 @@ const reasons = [ | |||||
</Translate> | ||||||
</> | ||||||
), | ||||||
icon: <Icon icon="mdi:connection" color={SKY_BLUE} width="24" height="24" />, | ||||||
}, | ||||||
{ | ||||||
title: <Translate>High performance</Translate>, | ||||||
|
@@ -25,6 +29,7 @@ const reasons = [ | |||||
<Translate>Service startup performance 40%↑</Translate> | ||||||
</> | ||||||
), | ||||||
icon: <Icon icon="mdi:rocket" color={SKY_BLUE} width="24" height="24" />, | ||||||
}, | ||||||
{ | ||||||
title: <Translate>Low overhead</Translate>, | ||||||
|
@@ -33,6 +38,7 @@ const reasons = [ | |||||
<Translate>ServiceMesh data plane overhead 70%↓</Translate> | ||||||
</> | ||||||
), | ||||||
icon: <Icon icon="mdi:arrow-down-bold" color={SKY_BLUE} width="24" height="24" />, | ||||||
}, | ||||||
{ | ||||||
title: <Translate>Security Isolation</Translate>, | ||||||
|
@@ -43,6 +49,7 @@ const reasons = [ | |||||
<Translate>Cgroup-level Orchestration Isolation</Translate> | ||||||
</> | ||||||
), | ||||||
icon: <Icon icon="mdi:shield-lock" color={SKY_BLUE} width="24" height="24" />, | ||||||
}, | ||||||
{ | ||||||
title: <Translate>Full Stack Visualization*</Translate>, | ||||||
|
@@ -55,10 +62,12 @@ const reasons = [ | |||||
</Translate> | ||||||
</> | ||||||
), | ||||||
icon: <Icon icon="mdi:chart-line" color={SKY_BLUE} width="24" height="24" />, | ||||||
}, | ||||||
{ | ||||||
title: <Translate>Open Ecosystem</Translate>, | ||||||
content: <Translate>Support for XDS Protocol Standards</Translate>, | ||||||
icon: <Icon icon="mdi:earth" color={SKY_BLUE} width="24" height="24" />, | ||||||
}, | ||||||
]; | ||||||
|
||||||
|
@@ -71,11 +80,12 @@ export default function Why() { | |||||
<div className="reasonBoxContainer"> | ||||||
{reasons.map((item, index) => ( | ||||||
<div key={index} className="reasonBox"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using the array
Suggested change
|
||||||
<div className="reasonIcon">{item.icon}</div> | ||||||
<p className="reasonTitle">{item.title}</p> | ||||||
<div className="reasonContent">{item.content}</div> | ||||||
</div> | ||||||
))} | ||||||
</div> | ||||||
</SectionContainer> | ||||||
); | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,32 @@ | |
flex-basis: 33.333%; | ||
padding: 0 15px; | ||
margin-bottom: 2rem; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
text-align: center; | ||
} | ||
|
||
.reasonIcon { | ||
margin-bottom: 12px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 60px; | ||
height: 60px; | ||
background: rgba(79, 195, 247, 0.1); | ||
border-radius: 50%; | ||
transition: transform 0.2s ease; | ||
|
||
svg { | ||
width: 30px; | ||
height: 30px; | ||
fill: #4FC3F7; | ||
} | ||
|
||
&:hover { | ||
transform: scale(1.1); | ||
} | ||
} | ||
Comment on lines
+23
to
43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The color .reasonIcon {
$sky-blue: #4FC3F7;
margin-bottom: 12px;
display: flex;
justify-content: center;
align-items: center;
width: 60px;
height: 60px;
background: rgba($sky-blue, 0.1);
border-radius: 50%;
transition: transform 0.2s ease;
svg {
width: 30px;
height: 30px;
fill: $sky-blue;
}
&:hover {
transform: scale(1.1);
}
} |
||
|
||
.reasonTitle { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
color
,width
, andheight
props on theIcon
component are redundant and potentially misleading, as these styles are already defined (and in the case of size, overridden) in the corresponding SCSS file (src/components/Why/index.scss
). The SCSS sets thewidth
andheight
to30px
(conflicting with the24
here) and thefill
color. To improve maintainability and have a single source of truth for styling, it's best to remove these props and let CSS handle the presentation entirely. This change should be applied to all<Icon>
components in this file (lines 32, 41, 52, 65, 70).