Skip to content

Commit

Permalink
feat: "background-clip"
Browse files Browse the repository at this point in the history
  • Loading branch information
ifiokjr committed May 3, 2023
1 parent 37b8b6d commit cd5cc43
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/skribble_preset/src/data/atoms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,11 @@ lazy_static! {
.values(vec!["background-attachment"])
.styles(indexmap! { "background-attachment" => none })
.build(),
Atom::builder()
.name("bg-clip")
.values(vec!["background-clip"])
.styles(indexmap! { "background-clip" => none })
.build(),
Atom::builder()
.name("bg")
.values(LinkedValues::Color)
Expand Down
9 changes: 9 additions & 0 deletions crates/skribble_preset/src/data/value_sets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,15 @@ lazy_static! {
"scroll" => "scroll",
})
.build(),
ValueSet::builder()
.name("background-clip")
.values(indexmap! {
"border" => "border-box",
"padding" => "padding-box",
"content" => "content-box",
"text" => "text",
})
.build(),
]
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -4447,6 +4447,23 @@ expression: runner_config
]
}
},
"bg-clip": {
"name": "bg-clip",
"description": null,
"priority": 150,
"styles": {
"background-clip": null
},
"modifier": null,
"values": {
"values": [
{
"priority": 150,
"value": "background-clip"
}
]
}
},
"bg": {
"name": "bg",
"description": null,
Expand Down Expand Up @@ -6295,6 +6312,7 @@ expression: runner_config
"break",
"hyphens",
"bg-attachment",
"bg-clip",
"bg"
],
"classes": [
Expand Down Expand Up @@ -12473,6 +12491,12 @@ expression: runner_config
"local",
"scroll"
],
"atom:bg-clip": [
"border",
"padding",
"content",
"text"
],
"atom:bg": [
"primary",
"primary-content",
Expand Down Expand Up @@ -14619,6 +14643,17 @@ expression: runner_config
"local": "local",
"scroll": "scroll"
}
},
"background-clip": {
"name": "background-clip",
"description": null,
"priority": 150,
"values": {
"border": "border-box",
"padding": "padding-box",
"content": "content-box",
"text": "text"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47632,6 +47632,56 @@ pub trait GeneratedValueSetBgAttachment: GeneratedSkribbleValue {
}
}
impl GeneratedValueSetBgAttachment for GeneratedAtomBgAttachment {}
pub struct GeneratedAtomBgClip(String);
impl GeneratedSkribbleValue for GeneratedAtomBgClip {
#[inline]
fn from_ref(value: impl AsRef<str>) -> Self {
Self(value.as_ref().to_string())
}
#[inline]
fn get_skribble_value(&self) -> &String {
&self.0
}
}
pub trait GeneratedValueSetBgClip: GeneratedSkribbleValue {
/// ```css
/// .bg-clip\:\$border {
/// background-clip: border-box;
/// }
/// ```
#[inline]
fn border(&self) -> String {
self.append_value("border")
}
/// ```css
/// .bg-clip\:\$padding {
/// background-clip: padding-box;
/// }
/// ```
#[inline]
fn padding(&self) -> String {
self.append_value("padding")
}
/// ```css
/// .bg-clip\:\$content {
/// background-clip: content-box;
/// }
/// ```
#[inline]
fn content(&self) -> String {
self.append_value("content")
}
/// ```css
/// .bg-clip\:\$text {
/// background-clip: text;
/// }
/// ```
#[inline]
fn text(&self) -> String {
self.append_value("text")
}
}
impl GeneratedValueSetBgClip for GeneratedAtomBgClip {}
pub struct GeneratedAtomBg(String);
impl GeneratedSkribbleValue for GeneratedAtomBg {
#[inline]
Expand Down Expand Up @@ -49173,6 +49223,14 @@ pub trait GeneratedAtom: GeneratedSkribbleValue {
self.append(format!("bg-attachment:[{}]", value.trim()))
}
#[inline]
fn bg_clip(&self) -> GeneratedAtomBgClip {
GeneratedAtomBgClip::from_ref(self.append("bg-clip"))
}
#[inline]
fn bg_clip_(&self, value: &'static str) -> String {
self.append(format!("bg-clip:[{}]", value.trim()))
}
#[inline]
fn bg(&self) -> GeneratedAtomBg {
GeneratedAtomBg::from_ref(self.append("bg"))
}
Expand Down

0 comments on commit cd5cc43

Please sign in to comment.