mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-29 21:49:33 +00:00
Add more style helpers
This commit is contained in:
parent
53679ce045
commit
3921278319
3 changed files with 17 additions and 2 deletions
|
@ -7,7 +7,6 @@ use crate::{
|
||||||
};
|
};
|
||||||
use gpui::ViewContext;
|
use gpui::ViewContext;
|
||||||
use playground_macros::Element;
|
use playground_macros::Element;
|
||||||
|
|
||||||
use std::{marker::PhantomData, rc::Rc};
|
use std::{marker::PhantomData, rc::Rc};
|
||||||
|
|
||||||
struct ButtonHandlers<V, D> {
|
struct ButtonHandlers<V, D> {
|
||||||
|
|
|
@ -48,7 +48,7 @@ fn playground<V: 'static>(theme: &ThemeColors) -> impl Element<V> {
|
||||||
div()
|
div()
|
||||||
.text_color(black())
|
.text_color(black())
|
||||||
.h_full()
|
.h_full()
|
||||||
.w_24()
|
.w_1_2()
|
||||||
.fill(theme.success(0.5))
|
.fill(theme.success(0.5))
|
||||||
// .hover()
|
// .hover()
|
||||||
// .fill(theme.error(0.5))
|
// .fill(theme.error(0.5))
|
||||||
|
|
|
@ -78,9 +78,25 @@ fn tailwind_lengths() -> Vec<(&'static str, TokenStream2)> {
|
||||||
("48", quote! { rems(12.) }),
|
("48", quote! { rems(12.) }),
|
||||||
("56", quote! { rems(14.) }),
|
("56", quote! { rems(14.) }),
|
||||||
("64", quote! { rems(16.) }),
|
("64", quote! { rems(16.) }),
|
||||||
|
("72", quote! { rems(18.) }),
|
||||||
|
("80", quote! { rems(20.) }),
|
||||||
|
("96", quote! { rems(24.) }),
|
||||||
("auto", quote! { auto() }),
|
("auto", quote! { auto() }),
|
||||||
("px", quote! { pixels(1.) }),
|
("px", quote! { pixels(1.) }),
|
||||||
("full", quote! { relative(1.) }),
|
("full", quote! { relative(1.) }),
|
||||||
|
("1_2", quote! { relative(0.5) }),
|
||||||
|
("1_3", quote! { relative(1./3.) }),
|
||||||
|
("2_3", quote! { relative(2./3.) }),
|
||||||
|
("1_4", quote! { relative(0.25) }),
|
||||||
|
("2_4", quote! { relative(0.5) }),
|
||||||
|
("3_4", quote! { relative(0.75) }),
|
||||||
|
("1_5", quote! { relative(0.2) }),
|
||||||
|
("2_5", quote! { relative(0.4) }),
|
||||||
|
("3_5", quote! { relative(0.6) }),
|
||||||
|
("4_5", quote! { relative(0.8) }),
|
||||||
|
("1_6", quote! { relative(1./6.) }),
|
||||||
|
("5_6", quote! { relative(5./6.) }),
|
||||||
|
("1_12", quote! { relative(1./12.) }),
|
||||||
// ("screen_50", quote! { DefiniteLength::Vh(50.0) }),
|
// ("screen_50", quote! { DefiniteLength::Vh(50.0) }),
|
||||||
// ("screen_75", quote! { DefiniteLength::Vh(75.0) }),
|
// ("screen_75", quote! { DefiniteLength::Vh(75.0) }),
|
||||||
// ("screen", quote! { DefiniteLength::Vh(100.0) }),
|
// ("screen", quote! { DefiniteLength::Vh(100.0) }),
|
||||||
|
|
Loading…
Reference in a new issue