Skip to content

Commit

Permalink
Improve SiteCard, defining padding as prop
Browse files Browse the repository at this point in the history
  • Loading branch information
UpperCod committed Aug 9, 2022
1 parent c5f4d04 commit 77886e1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"publishConfig": {
"access": "public"
},
"version": "0.2.1",
"version": "0.3.0",
"type": "module",
"scripts": {
"start": "vite --force",
Expand Down
11 changes: 6 additions & 5 deletions src/site-big-title/site-big-title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ siteBigTitle.styles = [
tokens,
css`
:host {
--font-big-label: 30vh;
font-size: var(--font-big-label);
--font-weight: var(--font-weight-title);
--font-size: 30vh;
font-size: var(--font-size);
color: transparent;
text-stroke: 1px var(--color-orbe);
-webkit-text-stroke: 1px var(--color-orbe);
position: relative;
line-height: 1em;
font-weight: var(--font-weight-title);
margin-bottom: calc(var(--font-big-label) * -0.25);
font-weight: var(--font-weight);
margin-bottom: calc(var(--font-size) * -0.25);
}
.gradient {
position: absolute;
Expand All @@ -38,7 +39,7 @@ siteBigTitle.styles = [
}
@media (max-width: 768px) {
:host {
--font-big-label: 15vh;
--font-size: 15vh;
}
}
`,
Expand Down
6 changes: 5 additions & 1 deletion src/site-card/site-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function siteCard({ dotColor }: Props<typeof siteCard>) {
siteCard.props = {
dotColor: { type: String, reflect: true },
overflow: { type: Boolean, reflect: true },
padding: { type: Boolean, reflect: true },
};

siteCard.styles = [
Expand All @@ -28,7 +29,7 @@ siteCard.styles = [
--radius: var(--size-2);
--dot-size: var(--size-2);
--dot-transition: 1s ease all;
padding: var(--padding);
background: var(--color-card-background);
border: 1px solid var(--color-card-border);
box-sizing: border-box;
Expand Down Expand Up @@ -70,6 +71,9 @@ siteCard.styles = [
:host([overflow]) {
overflow: hidden;
}
:host([padding]) {
padding: var(--padding);
}
.content {
display: grid;
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion src/site-why.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function why() {
</SiteText>
</SiteText>
</SiteGrid>
<SiteCard overflow>
<SiteCard>
<CompareContent style={`padding: var(--size-4)`}>
<img
slot="content"
Expand Down
24 changes: 12 additions & 12 deletions src/site.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function site() {
IMPORT
</SiteText>
</SiteCount>
<SiteCard>
<SiteCard padding overflow>
<img class="step-img" src={imgStep1} alt="" />
</SiteCard>
</div>
Expand All @@ -145,7 +145,7 @@ function site() {
WEBCOMPONENT
</SiteText>
</SiteCount>
<SiteCard>
<SiteCard padding overflow>
<img class="step-img" src={imgStep2} alt="" />
</SiteCard>
</div>
Expand All @@ -155,7 +155,7 @@ function site() {
STYLES
</SiteText>
</SiteCount>
<SiteCard>
<SiteCard padding overflow>
<img class="step-img" src={imgStep3} alt="" />
</SiteCard>
</div>
Expand All @@ -165,7 +165,7 @@ function site() {
DECLARATIONS
</SiteText>
</SiteCount>
<SiteCard>
<SiteCard padding overflow>
<img class="step-img" src={imgStep4} alt="" />
</SiteCard>
</div>
Expand All @@ -183,7 +183,7 @@ function site() {
</SiteText>
<img slot="right" src={imgAtom} />
<SiteGrid slot="content" columns="1, 2 768px, 3 980px">
<SiteCard dotColor="#FFE600">
<SiteCard padding overflow dotColor="#FFE600">
<SiteText color="subtitle">
<h4>@atomico/exports</h4>
</SiteText>
Expand All @@ -194,7 +194,7 @@ function site() {
</small>
</SiteText>
</SiteCard>
<SiteCard dotColor="#0088FF">
<SiteCard padding overflow dotColor="#0088FF">
<SiteText color="subtitle">
<h4>@atomico/router</h4>
</SiteText>
Expand All @@ -205,7 +205,7 @@ function site() {
</small>
</SiteText>
</SiteCard>
<SiteCard dotColor="#00FF90">
<SiteCard padding overflow dotColor="#00FF90">
<SiteText color="subtitle">
<h4>@atomico/store</h4>
</SiteText>
Expand All @@ -216,7 +216,7 @@ function site() {
</small>
</SiteText>
</SiteCard>
<SiteCard dotColor="#00FF90">
<SiteCard padding overflow dotColor="#00FF90">
<SiteText color="subtitle">
<h4>@atomico/hooks</h4>
</SiteText>
Expand All @@ -227,7 +227,7 @@ function site() {
</small>
</SiteText>
</SiteCard>
<SiteCard dotColor="#00FF90">
<SiteCard padding overflow dotColor="#00FF90">
<SiteText color="subtitle">
<h4>@atomico/react</h4>
</SiteText>
Expand All @@ -238,7 +238,7 @@ function site() {
</small>
</SiteText>
</SiteCard>
<SiteCard dotColor="#00FF90">
<SiteCard padding overflow dotColor="#00FF90">
<SiteText color="subtitle">
<h4>@atomico/router</h4>
</SiteText>
Expand All @@ -249,7 +249,7 @@ function site() {
</small>
</SiteText>
</SiteCard>
<SiteCard dotColor="#00FF90">
<SiteCard padding overflow dotColor="#00FF90">
<SiteText color="subtitle">
<h4>@atomico/components</h4>
</SiteText>
Expand All @@ -260,7 +260,7 @@ function site() {
</small>
</SiteText>
</SiteCard>
<SiteCard dotColor="#00FF90">
<SiteCard padding overflow dotColor="#00FF90">
<SiteText color="subtitle">
<h4>@atomico/ui</h4>
</SiteText>
Expand Down

0 comments on commit 77886e1

Please sign in to comment.