1818 Other <a href =" https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Attributes" >
1919 valid HTML attributes</a > may be passed as well.
2020</p >
21+ <p >
22+ Buttons can contain icons with text. Add <code class =" format-code" >.wds-has-icon</code > class to apply proper styles
23+ for using <code class =" format-code" >.wds-icon</code > inside the button. We assume that standard and stretched
24+ buttons contain small icons (18x18) and squished buttons contain tiny icons (12x12).
25+ </p >
2126
2227<section >
2328 <h2 id =" primary" >Primary buttons</h2 >
2429 <p >Default version for general use.</p >
2530 {{ #component-demo }}
2631 {{ #wds-button }} Primary button{{ /wds-button }}
32+ {{ #wds-button class =' wds-has-icon' }}
33+ {{ wds-icon name =' fandom-heart' size =' small' }}
34+ Primary button
35+ {{ /wds-button }}
2736 {{ #wds-button disabled =true }} Primary disabled{{ /wds-button }}
2837 {{ /component-demo }}
2938</section >
3342 <p >Adding class <code class =" format-code" >.wds-is-secondary</code > changes the button's looks. It is used to create a button that draws less user's attention.</p >
3443 {{ #component-demo }}
3544 {{ #wds-button class =' wds-is-secondary' }} Secondary button{{ /wds-button }}
45+ {{ #wds-button class =' wds-is-secondary wds-has-icon' }}
46+ {{ wds-icon name =' fandom-heart' size =' small' }}
47+ Secondary button
48+ {{ /wds-button }}
3649 {{ #wds-button class =' wds-is-secondary' disabled =true }} Secondary disabled{{ /wds-button }}
3750 {{ /component-demo }}
3851</section >
4255 <p >These buttons are denoted with <code class =" format-code" >.wds-is-text</code > class. They are the least obtrusive. Nevertheless, their paddings remain untouched, which provides the same clickable area.</p >
4356 {{ #component-demo }}
4457 {{ #wds-button class =' wds-is-text' }} Text button{{ /wds-button }}
58+ {{ #wds-button class =' wds-is-text wds-has-icon' }}
59+ {{ wds-icon name =' fandom-heart' size =' small' }}
60+ Text button
61+ {{ /wds-button }}
4562 {{ #wds-button class =' wds-is-text' disabled =true }} Text disabled{{ /wds-button }}
4663 {{ /component-demo }}
4764</section >
5168 <p >Size of the button of any aforementioned variant can be adjusted. These are the default sizes of the buttons — for comparison.</p >
5269 {{ #component-demo }}
5370 {{ #wds-button }} Primary{{ /wds-button }}
71+ {{ #wds-button class =' wds-has-icon' }}
72+ {{ wds-icon name =' fandom-heart' size =' small' }}
73+ Primary button
74+ {{ /wds-button }}
5475 {{ #wds-button class =' wds-is-secondary' }} Secondary{{ /wds-button }}
5576 {{ #wds-button class =' wds-is-text' }} Text{{ /wds-button }}
5677 {{ /component-demo }}
6182 <p >To make the button smaller use <code class =" format-code" >.wds-is-squished</code > class. This can help with fitting a button in tighter layouts.</p >
6283 {{ #component-demo }}
6384 {{ #wds-button class =' wds-is-squished' }} Primary{{ /wds-button }}
85+ {{ #wds-button class =' wds-is-squished wds-has-icon' }}
86+ {{ wds-icon name =' fandom-heart-small' class =' wds-icon-tiny' }}
87+ Primary
88+ {{ /wds-button }}
6489 {{ #wds-button class =' wds-is-secondary wds-is-squished' }} Secondary{{ /wds-button }}
6590 {{ #wds-button class =' wds-is-text wds-is-squished' }} Text{{ /wds-button }}
6691 {{ /component-demo }}
@@ -85,6 +110,10 @@ html[lang^='zh'] &__start-a-wiki-button {
85110 <p >For a button greater in size use <code class =" format-code" >.wds-is-stretched</code > class. This may come in handy to draw more user's attention to the button and increase the clickable area around the label.</p >
86111 {{ #component-demo }}
87112 {{ #wds-button class =' wds-is-stretched' }} Primary{{ /wds-button }}
113+ {{ #wds-button class =' wds-is-stretched wds-has-icon' }}
114+ {{ wds-icon name =' fandom-heart' size =' small' }}
115+ Primary button
116+ {{ /wds-button }}
88117 {{ #wds-button class =' wds-is-secondary wds-is-stretched' }} Secondary{{ /wds-button }}
89118 {{ #wds-button class =' wds-is-text wds-is-stretched' }} Text{{ /wds-button }}
90119 {{ /component-demo }}
@@ -104,6 +133,10 @@ html[lang^='zh'] &__start-a-wiki-button {
104133 <p >Button labels can wrap to multiple lines.</p >
105134 {{ #component-demo }}
106135 {{ #wds-button class =' fixed-width-140px' }} Multiline button label with 3rd line{{ /wds-button }}
136+ {{ #wds-button class =' fixed-width-180px wds-has-icon' }}
137+ {{ wds-icon name =' fandom-heart' size =' small' }}
138+ Multiline button label
139+ {{ /wds-button }}
107140 {{ /component-demo }}
108141</section >
109142
@@ -112,6 +145,10 @@ html[lang^='zh'] &__start-a-wiki-button {
112145 <p >When no special handlers of the click event are needed — just navigation to a certain URL, consider using an anchor tag <code >< a> </code > styled as a button. It is achieved by adding a <code class =" format-code" >.wds-button</code > class just like for the <code >< button> </code > element. Optionally add any other desired button classes.</p >
113146 {{ #component-demo }}
114147 {{ #wds-button tagName =' a' href =' #' }} Link button{{ /wds-button }}
148+ {{ #wds-button tagName =' a' href =' #' class =' wds-has-icon' }}
149+ {{ wds-icon name =' fandom-heart' size =' small' }}
150+ Link button
151+ {{ /wds-button }}
115152 {{ #wds-button tagName =' a' href =' #' class =' wds-is-secondary' }} Secondary link button{{ /wds-button }}
116153 {{ /component-demo }}
117154</section >
0 commit comments