Skip to content

Commit 0e1861b

Browse files
authored
Merge pull request #1 from DioxusLabs/rework-homepage
Rework the homepage with the component library
2 parents 1eb4113 + 4eb6172 commit 0e1861b

143 files changed

Lines changed: 13915 additions & 4058 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
features: dioxus-code/all-languages dioxus-code-editor/web dioxus-code-demo/web dioxus-code-live-input/web
4747

4848
web-demo:
49+
if: github.event_name == 'push'
4950
uses: ealmloff/dioxus-ci/.github/workflows/web-build.yml@main
5051
with:
5152
working-directory: demo

Cargo.lock

Lines changed: 124 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Two ways to highlight:
3131
dioxus-code = "0.1"
3232
```
3333

34-
```rust
34+
```rust,ignore
3535
use dioxus::prelude::*;
3636
use dioxus_code::{Code, Theme, code};
3737
@@ -57,7 +57,7 @@ For editor-style use cases where the source isn't known at compile time:
5757
dioxus-code = { version = "0.1", features = ["runtime"] }
5858
```
5959

60-
```rust
60+
```rust,ignore
6161
use dioxus_code::{Code, SourceCode, Theme};
6262
6363
rsx! {
@@ -74,7 +74,7 @@ Language can be set explicitly, inferred from a filename via `with_name("main.rs
7474

7575
`dioxus-code-editor` is a sibling crate that pairs the highlighter with a `contenteditable` input layer:
7676

77-
```rust
77+
```rust,ignore
7878
use dioxus_code_editor::CodeEditor;
7979
use dioxus_code::Theme;
8080
@@ -96,10 +96,22 @@ It is controlled — drive `value` from your own signal and update it inside `on
9696

9797
Thirty-odd built-ins, including Tokyo Night, Catppuccin (all four), Dracula, GitHub Light/Dark, Gruvbox, Nord, One Dark, Rosé Pine, Solarized, the Rustdoc themes, and others. Each is exposed as a `Theme` constant and a CSS asset; pages with multiple themes render side-by-side without leaking styles.
9898

99-
```rust
99+
```rust,ignore
100100
Code { src: code!("/example.rs"), theme: Theme::CATPPUCCIN_MOCHA }
101101
```
102102

103+
Use `CodeTheme::system` to select a light and dark theme with CSS media
104+
queries. This is JavaScript-free and works during SSR:
105+
106+
```rust,ignore
107+
use dioxus_code::{Code, CodeTheme, Theme, code};
108+
109+
Code {
110+
src: code!("/example.rs"),
111+
theme: CodeTheme::system(Theme::GITHUB_LIGHT, Theme::TOKYO_NIGHT),
112+
}
113+
```
114+
103115
## Examples
104116

105117
```sh

0 commit comments

Comments
 (0)