Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[workspace]

resolver = "2"
members = [
"crates/dominator-css-bindgen",
"crates/dwind",
"crates/dwind-base", "crates/dwind-build",
"crates/dwind-base",
"crates/dwind-build",
"crates/dwind-macros",
"crates/dwui",
"crates/example-html-macro",
Expand All @@ -23,7 +23,7 @@ futures-signals = "0.3"
futures-signals-component-macro = { version = "0.4.0", features = [
"dominator",
] }
gloo-timers = { version = "0.3.0", features = ["futures"]}
gloo-timers = { version = "0.3.0", features = ["futures"] }
log = "0.4"
matchit = "0.8"
nom = "7.1"
Expand All @@ -50,5 +50,5 @@ web-sys = { version = "0.3", features = [
"Navigator",
"Url",
"Window",
"HtmlSelectElement"
"HtmlSelectElement",
] }
2 changes: 1 addition & 1 deletion crates/dominator-css-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dominator-css-bindgen"
version = "0.1.1"
version = "0.2.0"
edition = "2021"
description = "generate DOMINATOR rust bindings to use from your dwind based application"
homepage = "https://github.com/JedimEmO/dwind"
Expand Down
1 change: 0 additions & 1 deletion crates/dominator-css-bindgen/src/codegen/output_model.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::css::parse_css::{ParsedCssFile, ParsedSelector};
use cssparser::{CowRcStr, ToCss, Token};
use quote::quote;
use std::collections::HashMap;

/// Represent a simple output class and its pseudo classes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ pub fn render_output_class(output_class: OutputClass) -> TokenStream {
.identity
.to_string()
.replace("-", "_")
.replace(".", "_")
.replace("/", "_")
.to_uppercase();

let name_lower = name.to_lowercase();
Expand Down
5 changes: 3 additions & 2 deletions crates/dominator-css-bindgen/src/codegen/render_variables.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use case::CaseExt;
use proc_macro2::{Ident, Span, TokenStream};
use quote::quote;
use std::collections::{HashMap, HashSet};
use std::collections::HashMap;

pub fn render_variable_definitions(module_name: &str, variable_names: Vec<String>) -> String {
let variable_names = variable_names
Expand Down Expand Up @@ -74,6 +74,7 @@ fn render_struct_of_variable_names(module_name: &str, variable_names: Vec<String
impl #struct_ident {
pub fn to_style_sheet_raw(self) -> String {
let mut out: Vec<String> = vec![];
out.clear();

#(#raw_string_exprs)*

Expand All @@ -84,5 +85,5 @@ fn render_struct_of_variable_names(module_name: &str, variable_names: Vec<String
}

pub fn css_ident_to_rust(ident: &str) -> String {
ident.replace("-", "_")
ident.replace("-", "_").replace(".", "_").replace("/", "_")
}
2 changes: 1 addition & 1 deletion crates/dwind-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dwind-build"
version = "0.1.1"
version = "0.2.0"
edition = "2021"
description = "utility crate for building DWIND color swatches etc."
homepage = "https://github.com/JedimEmO/dwind"
Expand Down
11 changes: 11 additions & 0 deletions crates/dwind-build/src/colors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ pub fn render_color_json_file_to_rust_file(
let _ = colors_out_file
.write(render_color(color, "gradient-to", "gradient-to-").as_bytes())
.unwrap();
let _ = colors_out_file
.write(render_color(color, "from", "gradient-from-").as_bytes())
.unwrap();

let _ = colors_out_file
.write(render_color(color, "to", "gradient-to-").as_bytes())
.unwrap();

let _ = colors_out_file
.write(render_color(color, "fill", "fill-").as_bytes())
Expand All @@ -50,6 +57,10 @@ pub fn render_color_json_file_to_rust_file(
let _ = colors_out_file
.write(render_color(color, "stroke", "stroke-").as_bytes())
.unwrap();

let _ = colors_out_file
.write(render_color(color, "ring", "ring-").as_bytes())
.unwrap();
}

let _ = colors_out_file
Expand Down
2 changes: 1 addition & 1 deletion crates/dwind-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dwind-macros"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
description = "Macros used by the dwind crate for applying dominator classes to components using a custom language"
homepage = "https://github.com/JedimEmO/dwind"
Expand Down
5 changes: 4 additions & 1 deletion crates/dwind-macros/src/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ pub fn render_dwind_class(
}

if class.pseudo_classes.is_empty() && class.variant.is_none() {
let class_ident = Ident::new(&class.class_name.to_uppercase(), Span::call_site());
let class_ident = Ident::new(
&class_name_to_struct_identifier(&class.class_name).to_uppercase(),
Span::call_site(),
);

(quote! { &* #class_ident }, breakpoint, false)
} else {
Expand Down
1 change: 0 additions & 1 deletion crates/dwind-macros/src/grammar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use nom::combinator::opt;
use nom::multi::{many0, separated_list1};
use nom::sequence::{delimited, terminated};
use nom::IResult;
use std::env::var;

use crate::codegen::BreakpointInfo;

Expand Down
5 changes: 1 addition & 4 deletions crates/dwind-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ use dwind_base::media_queries::Breakpoint;
use macro_inputs::{DwGenerateInput, DwGenerateMapInput, DwindInput};
use proc_macro::TokenStream;
use quote::quote;
use std::future::Future;
use std::pin::Pin;
use std::rc::Rc;
use std::task::{Context, Poll};

/// Use dwind-macros macros on your DOMINATOR component
///
Expand Down Expand Up @@ -48,7 +45,7 @@ pub fn dwclass(input: TokenStream) -> TokenStream {

let v = Rc::new(Some(""));

v.as_ref().as_ref().map(|v| {});
v.as_ref().as_ref().map(|_v| {});

let classes = normal_classes.into_iter().filter_map(|v| v).map(|(class, breakpoint)| {
if let Some(breakpoint) = breakpoint {
Expand Down
22 changes: 11 additions & 11 deletions crates/dwind/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dwind"
version = "0.5.0"
version = "0.6.0"
edition = "2021"
description = "Style your DOMINATOR applications using a tailwind-like syntax and utility class collection!"
homepage = "https://github.com/JedimEmO/dwind"
Expand All @@ -9,18 +9,18 @@ license = "MIT"
keywords = ["web", "wasm", "css", "style"]

[dependencies]
const_format = { workspace = true}
dominator = { workspace = true}
dominator-css-bindgen = { path = "../dominator-css-bindgen", version = "0.1.1" }
const_format = { workspace = true }
dominator = { workspace = true }
dominator-css-bindgen = { path = "../dominator-css-bindgen", version = "0.2.0" }
dwind-base = { path = "../dwind-base", version = "0.1.1" }
dwind-macros = { path = "../dwind-macros", version = "0.3.0" }
futures-signals = { workspace = true}
dwind-macros = { path = "../dwind-macros", version = "0.4.0" }
futures-signals = { workspace = true }
modern-normalize-cssys = { path = "../modern-normalize-cssys", version = "0.2.1" }
once_cell = { workspace = true}
once_cell = { workspace = true }
serde = { workspace = true, features = ["derive"] }

[build-dependencies]
dominator-css-bindgen = { path = "../dominator-css-bindgen", version = "0.1.1" }
dwind-build = { path = "../dwind-build", version = "0.1.1" }
serde = { workspace = true}
serde_json = { workspace = true}
dominator-css-bindgen = { path = "../dominator-css-bindgen", version = "0.2.0" }
dwind-build = { path = "../dwind-build", version = "0.2.0" }
serde = { workspace = true }
serde_json = { workspace = true }
1 change: 1 addition & 0 deletions crates/dwind/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fn main() {
"resources/css/typography.css",
"resources/css/transforms.css",
"resources/css/transition.css",
"resources/css/animations.css",
];

let out_dir = env::var_os("OUT_DIR").unwrap();
Expand Down
59 changes: 59 additions & 0 deletions crates/dwind/resources/css/animations.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* Animation utilities */

.animate-none {
animation: none;
}

.animate-spin {
animation: spin 1s linear infinite;
}

.animate-ping {
animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.animate-pulse {
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
animation: bounce 1s infinite;
}

/* Keyframes */

@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@keyframes ping {
75%, 100% {
transform: scale(2);
opacity: 0;
}
}

@keyframes pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: .5;
}
}

@keyframes bounce {
0%, 100% {
transform: translateY(-25%);
animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
}
50% {
transform: translateY(0);
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
}
}
4 changes: 4 additions & 0 deletions crates/dwind/resources/css/base.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
:root {
color-scheme: dark;
--dw-ring-inset: ;
--dw-ring-offset-width: 0px;
--dw-ring-color: rgb(59 130 246 / 0.5);
--dw-gradient-stops: var(--dw-gradient-from), var(--dw-gradient-to);
}

html {
Expand Down
21 changes: 21 additions & 0 deletions crates/dwind/resources/css/borders.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@
border-left-width: 2px;
}

/* Border color utilities */
.border-inherit {
border-color: inherit;
}

.border-current {
border-color: currentColor;
}

.border-transparent {
border-color: transparent;
}

.border-black {
border-color: rgb(0 0 0);
}

.border-white {
border-color: rgb(255 255 255);
}

/*
rounding
*/
Expand Down
28 changes: 28 additions & 0 deletions crates/dwind/resources/css/box_shadow.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,32 @@

.shadow-none {
box-shadow: none;
}

.ring-0 {
box-shadow: var(--dw-ring-inset) 0 0 0 calc(0px + var(--dw-ring-offset-width)) var(--dw-ring-color);
}

.ring-1 {
box-shadow: var(--dw-ring-inset) 0 0 0 calc(1px + var(--dw-ring-offset-width)) var(--dw-ring-color);
}

.ring-2 {
box-shadow: var(--dw-ring-inset) 0 0 0 calc(2px + var(--dw-ring-offset-width)) var(--dw-ring-color);
}

.ring {
box-shadow: var(--dw-ring-inset) 0 0 0 calc(3px + var(--dw-ring-offset-width)) var(--dw-ring-color);
}

.ring-4 {
box-shadow: var(--dw-ring-inset) 0 0 0 calc(4px + var(--dw-ring-offset-width)) var(--dw-ring-color);
}

.ring-8 {
box-shadow: var(--dw-ring-inset) 0 0 0 calc(8px + var(--dw-ring-offset-width)) var(--dw-ring-color);
}

.ring-inset {
--dw-ring-inset: inset;
}
Loading
Loading