Skip to content

Commit

Permalink
alias NONE for TRANSPARENT fills; adjust some style defaults for web …
Browse files Browse the repository at this point in the history
…chassis
  • Loading branch information
zackbrown committed Mar 12, 2024
1 parent 6a01158 commit 85f4363
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pax-chassis-web/interface/src/classes/native-element-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ export class NativeElementPool {

applyTextTyle(textbox, textbox, patch.style);

//We may support styles other than solid in the future; this is a better default than the browser's for now
textbox.style["border-style"] = "solid";

if (patch.background) {
textbox.style.background = toCssColor(patch.background);
}
Expand All @@ -253,6 +256,7 @@ export class NativeElementPool {

if (patch.stroke_width) {
textbox.style["border-width"] = patch.stroke_width + "px";

}

// Apply the content
Expand Down
4 changes: 4 additions & 0 deletions pax-chassis-web/interface/src/styles/pax-web.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,7 @@ html, body, #mount, canvas, .native-overlay{
margin: 0;
padding: 0;
}

input {
padding: 1px 4px 1px 4px;
}
3 changes: 2 additions & 1 deletion pax-compiler/src/pax.pest
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ literal_color_const = {
"ROSE" |
"BLACK" |
"WHITE" |
"TRANSPARENT"
"TRANSPARENT" |
"NONE"
}

////// ////// //////
Expand Down
3 changes: 2 additions & 1 deletion pax-runtime-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,7 @@ pub enum Color {
BLACK,
WHITE,
TRANSPARENT,
NONE,
}

impl Color {
Expand Down Expand Up @@ -1412,7 +1413,7 @@ impl Color {
Numeric::from(0xff).into(),
)
.to_rgba_0_1(),
Self::TRANSPARENT => Self::rgba(
Self::TRANSPARENT | Self::NONE => Self::rgba(
Numeric::from(0xff).into(),
Numeric::from(0xff).into(),
Numeric::from(0xFF).into(),
Expand Down

0 comments on commit 85f4363

Please sign in to comment.