Commit Graph
99 Commits
Author SHA1 Message Date
Conrad Irwin 800a7adcf2 go to line2 (#3261)
- MODAL
- center a div
- MOAR CODE
- Beautiful go to line modal


Release Notes:
- N/A
2023-11-08 17:16:00 -07:00
Nate Butler aa604a3623 Document ColorScaleSteps (#3271)
[[PR Description]]

Adds documentation to ColorScaleSteps:

```rust
/// Returns the specified step in the [`ColorScale`].
    #[inline]
    pub fn step(&self, step: ColorScaleStep) -> Hsla {
        // Steps are one-based, so we need convert to the zero-based vec index.
        self.0[step.0 - 1]
    }

    /// `Step 1` - Used for main application backgrounds.
    ///
    /// This step provides a neutral base for any overlaying components, ideal for applications' main backdrop or empty spaces such as canvas areas.
    ///
    #[inline]
    pub fn step_1(&self) -> Hsla {
        self.step(ColorScaleStep::ONE)
    }

    /// `Step 2` - Used for both main application backgrounds and subtle component backgrounds.
    ///
    /// Like `Step 1`, this step allows variations in background styles, from striped tables, sidebar backgrounds, to card backgrounds.
    #[inline]
    pub fn step_2(&self) -> Hsla {
        self.step(ColorScaleStep::TWO)
    }

    /// `Step 3` - Used for UI component backgrounds in their normal states.
    ///
    /// This step maintains accessibility by guaranteeing a contrast ratio of 4.5:1 with steps 11 and 12 for text. It could also suit hover states for transparent components.
    #[inline]
    pub fn step_3(&self) -> Hsla {
        self.step(ColorScaleStep::THREE)
    }

    /// `Step 4` - Used for UI component backgrounds in their hover states.
    ///
    /// Also suited for pressed or selected states of components with a transparent background.
    #[inline]
    pub fn step_4(&self) -> Hsla {
        self.step(ColorScaleStep::FOUR)
    }

    /// `Step 5` - Used for UI component backgrounds in their pressed or selected states.
    #[inline]
    pub fn step_5(&self) -> Hsla {
        self.step(ColorScaleStep::FIVE)
    }

    /// `Step 6` - Used for subtle borders on non-interactive components.
    ///
    /// Its usage spans from sidebars' borders, headers' dividers, cards' outlines, to alerts' edges and separators.
    #[inline]
    pub fn step_6(&self) -> Hsla {
        self.step(ColorScaleStep::SIX)
    }

    /// `Step 7` - Used for subtle borders on interactive components.
    ///
    /// This step subtly delineates the boundary of elements users interact with.
    #[inline]
    pub fn step_7(&self) -> Hsla {
        self.step(ColorScaleStep::SEVEN)
    }

    /// `Step 8` - Used for stronger borders on interactive components and focus rings.
    ///
    /// It strengthens the visibility and accessibility of active elements and their focus states.
    #[inline]
    pub fn step_8(&self) -> Hsla {
        self.step(ColorScaleStep::EIGHT)
    }

    /// `Step 9` - Used for solid backgrounds.
    ///
    /// `Step 9` is the most saturated step, having the least mix of white or black.
    ///
    /// Due to its high chroma, `Step 9` is versatile and particularly useful for semantic colors such as
    /// error, warning, and success indicators.
    #[inline]
    pub fn step_9(&self) -> Hsla {
        self.step(ColorScaleStep::NINE)
    }

    /// `Step 10` - Used for hovered or active solid backgrounds, particularly when `Step 9` is their normal state.
    #[inline]
    pub fn step_10(&self) -> Hsla {
        self.step(ColorScaleStep::TEN)
    }

    /// `Step 11` - Used for text and icons requiring low contrast or less emphasis.
    #[inline]
    pub fn step_11(&self) -> Hsla {
        self.step(ColorScaleStep::ELEVEN)
    }

    /// `Step 12` - Used for text and icons requiring high contrast or prominence.
    #[inline]
    pub fn step_12(&self) -> Hsla {
        self.step(ColorScaleStep::TWELVE)
    }
```

Release Notes:

- N/A
2023-11-08 16:25:17 -05:00
Mikayla 738ca57aba Merge branch 'main' into go-to-line2 2023-11-08 11:32:36 -08:00
Marshall Bowers 8f89c1e77b Replace GitStatusColors with StatusColors (#3268)
This PR removes `GitStatusColors` in favor of just using `StatusColors`
instead.

Release Notes:

- N/A
2023-11-08 11:32:32 -05:00
Nate Butler 1854ce79d5 Document ColorScaleSteps 2023-11-08 00:45:05 -05:00
Nate Butler bbabbb2860 Add new default player colors and the players story. 2023-11-07 21:51:12 -05:00
Nate Butler 0817153b76 Extend the theme crate to enable stories, add players story 2023-11-07 21:08:33 -05:00
Nate Butler 26f779d477 Update default player colors 2023-11-07 20:27:00 -05:00
555a4ba002 Beautiful go to line modal
Co-authored-by: Julia <julia@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
2023-11-07 15:32:34 -07:00
Nate Butler a5eb90dc5e Continue documenting theme colors 2023-11-07 14:04:09 -05:00
Nate Butler 0b0195f75e Merge branch 'main' into document-theme 2023-11-07 13:36:08 -05:00
Nate Butler 723ac00cbf Begin documenting theme colors 2023-11-07 13:36:01 -05:00
Antonio Scandurra 61a5f961ec Merge remote-tracking branch 'origin/main' into editor-movement 2023-11-07 18:50:43 +01:00
Antonio Scandurra 800a03407c Merge remote-tracking branch 'origin/main' into editor-movement 2023-11-07 18:48:08 +01:00
Marshall Bowers a0f395f419 theme_importer: Format generated themes (#3255)
This PR makes the `theme_importer` format the themes that it generates
automatically.

Release Notes:

- N/A
2023-11-07 12:45:09 -05:00
Marshall Bowers fc9a860c79 Rework third-party themes (#3254)
This PR reworks the way we define our third-party themes to make them
work as overlays on top of a base theme.

We introduce the concept of a `UserThemeFamily` that contains
`UserTheme`s. Rather than being an entire theme definition on their own,
a `UserTheme` just contains optional overrides for the values in a
`Theme`.

When resolving a `UserTheme`, we apply it on top of the base theme. Any
values not overridden in the `UserTheme` will fall back to the `Theme`
defaults.

Right now we are just using `UserTheme` to model third-party themes that
we distribute with the Zed binary. However, this same structure can also
be used to import arbitrary user themes (such as from a theme registry,
or even a theme blob from the settings file).

Release Notes:

- N/A
2023-11-07 11:40:07 -05:00
Marshall Bowers a9db13e190 Rename ThemeVariant to Theme (#3252)
This PR renames the `ThemeVariant` type to `Theme`.

This better reflects its purpose, as well as matches the same name as we
had before, which should make porting crates slightly easier.

Release Notes:

- N/A
2023-11-07 10:41:36 -05:00
Marshall Bowers 9a929eab68 Regenerate all themes 2023-11-07 08:59:50 -05:00
Marshall Bowers c18888a72b Add new ThemeColors values to the theme printer 2023-11-07 08:59:37 -05:00
Antonio Scandurra d14a35be66 Fix warning 2023-11-07 14:31:17 +01:00
Antonio Scandurra c4aef05877 Add colors for document highlights 2023-11-07 13:15:08 +01:00
Antonio Scandurra ccdb5b2857 Merge remote-tracking branch 'origin/main' into editor2-paint 2023-11-07 13:09:48 +01:00
Antonio Scandurra 103ec87630 Remove focused field and use FocusHandle instead in Editor 2023-11-07 12:46:31 +01:00
Antonio Scandurra 0dbb8f8b4d Paint lines 2023-11-07 12:25:33 +01:00
Nate Butler 4e52e68a43 Finish up initial themes 2023-11-06 15:24:36 -05:00
Nate Butler d4745027be Format themes 2023-11-06 14:58:34 -05:00
Nate Butler 6c0f5f9965 Add additional themes, update theme importer 2023-11-06 14:54:21 -05:00
Nate Butler 9427239b0d Add Noctis Theme 2023-11-06 12:43:10 -05:00
Marshall Bowers 31cfb83723 Merge branch 'main' into import-theme 2023-11-06 12:08:46 -05:00
c905d4f66d Rename fields in ThemeColors (#3242)
This PR applies a number of field renames in the `ThemeColors` struct
from the `import-theme` branch.

This will help prevent this branch from diverging too far from `main`.

Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-06 11:53:27 -05:00
Antonio Scandurra 53e7fcfd1f Paint editor background 2023-11-06 15:54:09 +01:00
Nate Butler 09fd938c2c Add checkboxes and their stories 2023-11-05 01:06:41 -05:00
Max Brunsfeld 7b7ba5236d WIP2000 2023-11-03 16:40:37 -07:00
Marshall Bowers f81e3f4dab Allow deriving Serialize and Deserialize on generated refinement (#3227)
This PR adds support for deriving `Serialize` and `Deserialize` on the
refinement type generated by `#[derive(Refineable)]`.

Release Notes:

- N/A
2023-11-03 17:21:00 -04:00
Marshall Bowers f9701564ce Merge branch 'main' into import-theme 2023-11-03 15:41:12 -04:00
Marshall Bowers 9e7f83068a Remove Default impl for ThemeColors` (#3226)
This PR removes the `Default` impl for `ThemeColors`.

Since we need default light and dark variants for `ThemeColors`, we
can't use a single `Default` impl.

Release Notes:

- N/A
2023-11-03 15:40:50 -04:00
Antonio Scandurra 18f34e4eed WIP 2023-11-03 18:55:20 +01:00
Marshall Bowers ca64641b26 Merge branch 'main' into import-theme 2023-11-03 10:11:35 -04:00
Conrad Irwin f9cee6b4cf Convert rich_text2 2023-11-02 19:30:33 -06:00
Nate Butler 7d5e80d90a Merge branch 'main' into import-theme 2023-11-02 20:16:09 -04:00
Nate Butler 0685483f99 Add terminal colors to ThemeColors, add _background to some color names. 2023-11-02 19:53:52 -04:00
Marshall Bowers 270c15ae97 Add themes2/src/themes directory 2023-11-02 19:17:39 -04:00
Marshall Bowers ce9a070d73 Finish up theme printer 2023-11-02 19:14:51 -04:00
Marshall Bowers 5d2e8aa6fb Parse VSCode theme files 2023-11-02 18:00:55 -04:00
Nate ButlerandMarshall Bowers 538664e784 Scaffold out new theme-importer crate
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-02 17:21:11 -04:00
Nate Butler c9c18d1f29 Deserialize theme metadata 2023-11-02 16:31:22 -04:00
Nate Butler 3ecb46ad01 [Broken] Load a src theme in test 2023-11-02 16:26:27 -04:00
Nate Butler 24fb5d36ac WIP 2023-11-02 14:54:53 -04:00
Nate Butler dd57f15f4c WIP 2023-11-02 14:23:43 -04:00
Mikayla d8b8390702 Remove the 2s from source code 2023-11-02 10:55:02 -07:00