File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed
Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77
88## [ Unreleased]
99
10+ ### Added
11+
12+ * ` attr::style `
13+
1014
1115## [ 1.5.0] - 2024-12-16
1216
Original file line number Diff line number Diff line change @@ -141,6 +141,11 @@ pub fn height_int(value: i32) -> Attribute {
141141 Attribute :: new_int ( "height" , value)
142142}
143143
144+ /// `style` attribute
145+ pub fn style ( value : impl Into < Cow < ' static , str > > ) -> Attribute {
146+ Attribute :: new ( "style" , value)
147+ }
148+
144149/// `cols` attribute
145150pub fn cols ( value : i32 ) -> Attribute {
146151 Attribute :: new_int ( "cols" , value)
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ fn should_render_html_document() {
9999#[ case( attr:: placeholder( "hello" ) , "placeholder=\" hello\" " ) ]
100100#[ case( attr:: rows( 10 ) , "rows=\" 10\" " ) ]
101101#[ case( attr:: cols( 10 ) , "cols=\" 10\" " ) ]
102+ #[ case( attr:: style( "width: 5px" ) , "style=\" width: 5px\" " ) ]
102103fn should_render_attribute ( #[ case] attr : Attribute , #[ case] expected : & str ) {
103104 assert_eq ! ( attr. to_string( ) , expected) ;
104105}
You can’t perform that action at this time.
0 commit comments