Skip to content

Commit

Permalink
Update to HTML disabled attr instead of is-disabled CSS class
Browse files Browse the repository at this point in the history
Update README to point to Bulma 0.9.1
  • Loading branch information
thedodd committed Oct 18, 2020
1 parent 3b76a28 commit 8e6e905
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ This changelog follows the patterns described here: https://keepachangelog.com/e

## Unreleased

## 0.1.5
### fixed
- Fixed a few of the button & button-like components to use the HTML `disabled` attribute instead of the Bulma `is-disabled` CSS class. The latter has been deprecated for some time.
- Update docs in the README to point to the latest Bulma 0.9.1 release.

## 0.1.4
### added
- Add prop `padded` to Navbar. Setting this to true will wrap the contents of the navbar in a container to add padding to the contents under some circumstances.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ybc"
version = "0.1.4"
version = "0.1.5"
description = "A Yew component library based on the Bulma CSS framework."
authors = ["Anthony Dodd <dodd.anthonyjosiah@gmail.com>"]
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ybc = "*"

### add bulma
#### add bulma css (no customizations)
This project works perfectly well if you just include the Bulma CSS in your HTML, [as described here](https://bulma.io/documentation/overview/start/). The following link in your HTML head should do the trick: `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.0/css/bulma.min.css"/>`.
This project works perfectly well if you just include the Bulma CSS in your HTML, [as described here](https://bulma.io/documentation/overview/start/). The following link in your HTML head should do the trick: `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css"/>`.

#### add bulma sass (allows customization & themes)
However, if you want to customize Bulma to match your style guidelines, then you will need to have a copy of the Bulma SASS locally, and then import Bulma after you've defined your customizations, [as described here](https://bulma.io/documentation/customize/).
Expand Down
19 changes: 4 additions & 15 deletions src/elements/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,8 @@ impl Component for Button {
if self.props.r#static {
classes.push("is-static")
}
if self.props.disabled {
classes.push("is-disabled")
}
html! {
<button class=classes onclick=self.props.onclick.clone()>
<button class=classes onclick=self.props.onclick.clone() disabled=self.props.disabled>
{self.props.children.clone()}
</button>
}
Expand Down Expand Up @@ -325,16 +322,14 @@ impl Component for ButtonAnchor {
if self.props.r#static {
classes.push("is-static")
}
if self.props.disabled {
classes.push("is-disabled")
}
html! {
<a
class=classes
onclick=self.props.onclick.clone()
href=self.props.href.clone()
rel=self.props.rel.clone().unwrap_or_default()
target=self.props.target.clone().unwrap_or_default()
disabled=self.props.disabled
>
{self.props.children.clone()}
</a>
Expand Down Expand Up @@ -397,11 +392,8 @@ impl Component for ButtonInputSubmit {
if self.props.r#static {
classes.push("is-static")
}
if self.props.disabled {
classes.push("is-disabled")
}
html! {
<input type="submit" class=classes onsubmit=self.props.onsubmit.clone()/>
<input type="submit" class=classes onsubmit=self.props.onsubmit.clone() disabled=self.props.disabled/>
}
}
}
Expand Down Expand Up @@ -461,11 +453,8 @@ impl Component for ButtonInputReset {
if self.props.r#static {
classes.push("is-static")
}
if self.props.disabled {
classes.push("is-disabled")
}
html! {
<input type="reset" class=classes onreset=self.props.onreset.clone()/>
<input type="reset" class=classes onreset=self.props.onreset.clone() disabled=self.props.disabled/>
}
}
}

0 comments on commit 8e6e905

Please sign in to comment.