Skip to content

Commit 2da68f1

Browse files
Fix bug I introduced in my last commits. (#903)
* Improve colors, as well as the infra used for setting colors. * Fix circle and kb colors. * Fix some color bugs I introduced, and clean up all colors names.
1 parent 67f165e commit 2da68f1

File tree

9 files changed

+102
-53
lines changed

9 files changed

+102
-53
lines changed

components/blocks/iconHeader.js

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,44 @@ const IconHeader = ({ icon, rotate, title, background, color }) => {
66
return (
77
<section className={classNames(styles.Container)}>
88
<i
9-
className={classNames(
10-
styles.Icon,
11-
background === "violet-70"
12-
? styles.VioletBackground
13-
: background === "l-blue-70"
14-
? styles.LightBlueBackground
15-
: styles.OrangeBackground
16-
)}
9+
className={classNames(styles.Icon, BG_CLASS[background])}
1710
style={{
1811
transform: `rotate(${rotate}deg)`,
1912
}}
2013
>
2114
{icon}
2215
</i>
23-
<h4
24-
className={classNames(
25-
styles.Title,
26-
background === "violet-70"
27-
? styles.VioletText
28-
: background === "l-blue-70"
29-
? styles.LightBlueText
30-
: styles.OrangeText
31-
)}
32-
>
16+
<h4 className={classNames(styles.Title, FG_CLASS[background])}>
3317
{title}
3418
</h4>
3519
</section>
3620
);
3721
};
3822

23+
const BG_CLASS = {
24+
"red-70": styles.RedBackground,
25+
"orange-70": styles.OrangeBackground,
26+
"yellow-70": styles.YellowBackground,
27+
"green-70": styles.GreenBackground,
28+
"acqua-70": styles.AcquaBackground,
29+
"lightBlue-70": styles.LightBlueBackground,
30+
"darkBlue-70": styles.DarkBlueBackground,
31+
"indigo-70": styles.IndigoBackground,
32+
"gray-70": styles.GrayBackground,
33+
unset: styles.TransparentBackground,
34+
};
35+
36+
const FG_CLASS = {
37+
"red-70": styles.RedForeground,
38+
"orange-70": styles.OrangeForeground,
39+
"yellow-70": styles.YellowForeground,
40+
"green-70": styles.GreenForeground,
41+
"acqua-70": styles.AcquaForeground,
42+
"lightBlue-70": styles.LightBlueForeground,
43+
"darkBlue-70": styles.DarkBlueForeground,
44+
"indigo-70": styles.IndigoForeground,
45+
"gray-70": styles.GrayForeground,
46+
unset: styles.TransparentForeground,
47+
};
48+
3949
export default IconHeader;

components/blocks/iconHeader.module.css

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,70 @@
1212
}
1313

1414
/* Color modifiers */
15-
.VioletBackground {
16-
@apply bg-indigo-70;
15+
.RedBackground {
16+
@apply bg-red-70;
1717
}
1818

1919
.OrangeBackground {
2020
@apply bg-orange-70;
2121
}
2222

23+
.YellowBackground {
24+
@apply bg-yellow-70;
25+
}
26+
27+
.GreenBackground {
28+
@apply bg-green-70;
29+
}
30+
31+
.AcquaBackground {
32+
@apply bg-acqua-70;
33+
}
34+
2335
.LightBlueBackground {
2436
@apply bg-lightBlue-70;
2537
}
2638

27-
.VioletText {
28-
@apply text-indigo-70 !important;
39+
.DarkBlueBackground {
40+
@apply bg-darkBlue-70;
41+
}
42+
43+
.IndigoBackground {
44+
@apply bg-indigo-70;
45+
}
46+
47+
.RedForeground {
48+
@apply text-red-70 !important;
2949
}
3050

31-
.OrangeText {
51+
.OrangeForeground {
3252
@apply text-orange-70 !important;
3353
}
3454

35-
.LightBlueText {
55+
.YellowForeground {
56+
@apply text-yellow-70 !important;
57+
}
58+
59+
.GreenForeground {
60+
@apply text-green-70 !important;
61+
}
62+
63+
.AcquaForeground {
64+
@apply text-acqua-70 !important;
65+
}
66+
67+
.LightBlueForeground {
3668
@apply text-lightBlue-70 !important;
3769
}
3870

39-
:global(.dark) .VioletText {
71+
.DarkBlueForeground {
72+
@apply text-darkBlue-70 !important;
73+
}
74+
75+
.IndigoForeground {
76+
@apply text-indigo-70 !important;
77+
}
78+
79+
:global(.dark) .IndigoText {
4080
@apply text-white !important;
4181
}

components/blocks/note.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Note = ({ children }) => {
1313
icon="push_pin"
1414
rotate="45"
1515
title="Note"
16-
background="l-blue-70"
16+
background="lightBlue-70"
1717
color="white"
1818
/>
1919
{children}

components/blocks/tip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Tip = ({ children }) => {
1313
icon="star"
1414
rotate="0"
1515
title="Tip"
16-
background="violet-70"
16+
background="indigo-70"
1717
color="white"
1818
/>
1919
{children}

content/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Welcome to Streamlit
33
features:
44
- title: Get started
55
body: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
6-
color: violet-70
6+
color: indigo-70
77
icon: arrow_forward
88
url: /get-started
99
image: ""
@@ -17,7 +17,7 @@ features:
1717
- title: Topic guides
1818
body: Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut
1919
fugit, sed quia.
20-
color: l-blue-70
20+
color: lightBlue-70
2121
icon: description
2222
url:
2323
Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,

content/streamlit-cloud/get-started/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,21 @@ First things first, you need to create your Streamlit Community Cloud account to
1515
title="Quickstart"
1616
text="Create your account and deploy an example app as fast as possible. Jump right into coding with GitHub Codespaces."
1717
link="/streamlit-community-cloud/get-started"
18+
background="lightBlue-70"
1819
/>
1920
<Tile
2021
icon="person"
2122
title="Create your account"
2223
text="See all the options and get complete explanations as you create your Streamlit Community Cloud account."
2324
link="/streamlit-community-cloud/get-started/create-your-account"
25+
background="lightBlue-70"
2426
/>
2527
<Tile
2628
icon="security"
2729
title="Trust and Security"
2830
text="Security first! If you want to read up on how we handle your data before you get started, we've got you covered."
2931
link="streamlit-community-cloud/get-started/trust-and-security"
32+
background="lightBlue-70"
3033
/>
3134
</TileContainer>
3235

content/streamlit-cloud/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,42 @@ If you haven't built your first Streamlit app yet, you can check out [Get starte
1313

1414
<InlineCalloutContainer>
1515
<InlineCallout
16-
color="l-blue-70"
16+
color="lightBlue-70"
1717
icon="rocket_launch"
1818
bold="Quickstart"
1919
href="/streamlit-community-cloud/get-started"
2020
>Create your account and deploy an example app as fast as possible. Jump right into coding with GitHub Codespaces.
2121
</InlineCallout>
2222
<InlineCallout
23-
color="l-blue-70"
23+
color="lightBlue-70"
2424
icon="arrow_forward"
2525
bold="Get started"
2626
href="/streamlit-community-cloud/get-started"
2727
>Learn about Streamlit Community Cloud accounts and how to create one.
2828
</InlineCallout>
2929
<InlineCallout
30-
color="l-blue-70"
30+
color="lightBlue-70"
3131
icon="flight_takeoff"
3232
bold="Deploy your app"
3333
href="/streamlit-community-cloud/deploy-your-app"
3434
>A step-by-step guide on how to get your app deployed.
3535
</InlineCallout>
3636
<InlineCallout
37-
color="l-blue-70"
37+
color="lightBlue-70"
3838
icon="share"
3939
bold="Share your app"
4040
href="/streamlit-community-cloud/share-your-app"
4141
>Share or embed your app.
4242
</InlineCallout>
4343
<InlineCallout
44-
color="l-blue-70"
44+
color="lightBlue-70"
4545
icon="settings"
4646
bold="Manage your app"
4747
href="/streamlit-community-cloud/manage-your-app"
4848
>Access logs, reboot apps, set favorites, and more. Jump into a GitHub Codespace to edit your app in the cloud.
4949
</InlineCallout>
5050
<InlineCallout
51-
color="l-blue-70"
51+
color="lightBlue-70"
5252
icon="manage_accounts"
5353
bold="Manage your account"
5454
href="/streamlit-community-cloud/manage-your-account"

pages/style-guide.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,7 @@ ls -l myscript.sh`}
151151
</ArrowLinkContainer>
152152
</Component>
153153
<Component label="Note Block">
154-
<Note
155-
background="l-blue-10"
156-
color="gray-90"
157-
dark={{ background: "dark-black", color: "white" }}
158-
>
154+
<Note>
159155
<p>
160156
For this guide we’re using small amounts of data so that we can
161157
move quickly. You can check out our <Link href="/">Tutorial</Link>{" "}
@@ -166,9 +162,9 @@ ls -l myscript.sh`}
166162
</Component>
167163
<Component label="Note Block (with code embed option)">
168164
<Tip
169-
background="violet-10"
165+
background="indigo-10"
170166
color="gray-90"
171-
dark={{ background: "dark-violet", color: "white" }}
167+
dark={{ background: "dark-indigo", color: "white" }}
172168
>
173169
<p>
174170
Did you know you can also pass a URL to streamlit run? This is
@@ -217,7 +213,7 @@ https://raw.githubusercontent.com/streamlit/demo-uber-nyc-pickups/master/streaml
217213
<TilesContainer>
218214
<Tile
219215
size="third"
220-
background="l-blue-70"
216+
background="lightBlue-70"
221217
color="white"
222218
icon="downloading"
223219
title="Install Streamlit"
@@ -397,7 +393,7 @@ st.altair_chart(chart_data)`}
397393
<Component label="Inline callout">
398394
<InlineCalloutContainer>
399395
<InlineCallout
400-
color="violet-70"
396+
color="indigo-70"
401397
icon="school"
402398
bold="Tutorials"
403399
href="/"
@@ -407,7 +403,7 @@ st.altair_chart(chart_data)`}
407403
Streamlit.
408404
</InlineCallout>
409405
<InlineCallout
410-
color="violet-70"
406+
color="indigo-70"
411407
icon="school"
412408
bold="Tutorials"
413409
href="/"

public/admin/config.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ collections:
3737
widget: select,
3838
options:
3939
[
40-
"violet-70",
40+
"indigo-70",
4141
"orange-70",
42-
"blue-70",
42+
"darkBlue-70",
4343
"red-70",
4444
"yellow-70",
4545
"green-70",
46-
"b-g-70",
47-
"l-blue-70",
46+
"acqua-70",
47+
"lightBlue-70",
4848
"gray-70",
4949
],
5050
}
@@ -138,14 +138,14 @@ collections:
138138
widget: select,
139139
options:
140140
[
141-
"violet-70",
141+
"indigo-70",
142142
"orange-70",
143-
"blue-70",
143+
"darkBlue-70",
144144
"red-70",
145145
"yellow-70",
146146
"green-70",
147-
"b-g-70",
148-
"l-blue-70",
147+
"acqua-70",
148+
"lightBlue-70",
149149
"gray-70",
150150
],
151151
required: false,

0 commit comments

Comments
 (0)