Skip to content

Commit 19baa3f

Browse files
committed
add version compatability notice
1 parent 3571d90 commit 19baa3f

File tree

2 files changed

+69
-46
lines changed

2 files changed

+69
-46
lines changed

preview/assets/hero.css

Lines changed: 59 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,85 @@
11
#hero {
2-
display: flex;
3-
flex-direction: column;
4-
align-items: center;
5-
justify-content: center;
6-
padding: 50px;
7-
margin: 0;
2+
display: flex;
3+
flex-direction: column;
4+
align-items: center;
5+
justify-content: center;
6+
padding: 50px;
7+
margin: 0;
88
}
99

10-
#hero>h1, #hero>h2 {
11-
margin: 10px 0;
12-
color: var(--secondary-color-4);
13-
font-family: Arial, Helvetica, sans-serif;
14-
font-size: 1.5rem;
15-
font-weight: 500;
10+
#hero > h1,
11+
#hero > h2 {
12+
margin: 10px 0;
13+
color: var(--secondary-color-4);
14+
font-family: Arial, Helvetica, sans-serif;
15+
font-size: 1.5rem;
16+
font-weight: 500;
1617
}
1718

18-
#hero>h1{
19-
font-size: 2rem;
20-
font-weight: 600;
19+
#hero > h1 {
20+
font-size: 2rem;
21+
font-weight: 600;
2122
}
2223

2324
#hero #title {
24-
font-size: 2rem;
25-
font-weight: 500;
25+
font-size: 2rem;
26+
font-weight: 500;
2627
}
2728

2829
#hero-separator {
29-
height: 2px;
30-
margin-bottom: 50px;
30+
height: 2px;
31+
margin-bottom: 50px;
3132
}
3233

3334
#hero-search-container {
34-
display: flex;
35-
width: 100%;
36-
max-width: 800px;
37-
flex-direction: column;
38-
align-items: center;
39-
justify-content: center;
40-
margin: auto;
35+
display: flex;
36+
width: 100%;
37+
max-width: 800px;
38+
flex-direction: column;
39+
align-items: center;
40+
justify-content: center;
41+
margin: auto;
4142
}
4243

4344
#hero-search-input {
44-
width: 100%;
45-
box-sizing: border-box;
46-
padding: 10px 20px;
47-
border: 1px solid var(--primary-color-6);
48-
border-radius: .5rem;
49-
margin: 2em auto;
50-
background-color: var(--primary-color-1);
51-
color: var(--secondary-color-4);
45+
width: 100%;
46+
box-sizing: border-box;
47+
padding: 10px 20px;
48+
border: 1px solid var(--primary-color-6);
49+
border-radius: 0.5rem;
50+
margin: 2em auto;
51+
background-color: var(--primary-color-1);
52+
color: var(--secondary-color-4);
5253
}
5354

5455
#hero-search-input:focus-visible {
55-
box-shadow: 0 0 0 2px var(--focused-border-color);
56+
box-shadow: 0 0 0 2px var(--focused-border-color);
5657
}
5758

5859
#hero-installation {
59-
display: flex;
60-
flex-direction: row;
61-
align-items: center;
62-
justify-content: center;
63-
gap: 1em;
64-
border: 1px solid var(--primary-color-6);
65-
border-radius: .5rem;
66-
padding: .5em 1em;
67-
margin: 1em auto;
60+
display: flex;
61+
flex-direction: row;
62+
align-items: center;
63+
justify-content: center;
64+
gap: 1em;
65+
border: 1px solid var(--primary-color-6);
66+
border-radius: 0.5rem;
67+
padding: 0.5em 1em;
68+
margin: 1em auto;
6869
}
6970

7071
#hero-installation:hover {
71-
background-color: var(--primary-color-3);
72-
}
72+
background-color: var(--primary-color-3);
73+
}
74+
75+
#version-compatibility-notice {
76+
display: flex;
77+
flex-direction: row;
78+
align-items: center;
79+
justify-content: center;
80+
gap: 1em;
81+
background: var(--primary-warning-color);
82+
border-radius: 0.5rem;
83+
padding: 0.5em 1em;
84+
margin: 1em auto;
85+
}

preview/src/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@ fn Home(iframe: Option<bool>, dark_mode: Option<bool>) -> Element {
824824
i { "unstyled" }
825825
" foundational components for Dioxus."
826826
}
827+
VersionCompatibilityNotice {}
827828
Installation {}
828829
div { id: "hero-search-container",
829830
input {
@@ -852,6 +853,15 @@ fn Installation() -> Element {
852853
}
853854
}
854855

856+
#[component]
857+
fn VersionCompatibilityNotice() -> Element {
858+
rsx! {
859+
div { id: "version-compatibility-notice",
860+
"Dioxus Components is only compatible with Dioxus v0.7.0-rc.1 or later."
861+
}
862+
}
863+
}
864+
855865
#[component]
856866
fn ComponentGallery(search: String) -> Element {
857867
rsx! {

0 commit comments

Comments
 (0)