[ADF-2296] Background color on form buttons (#2953)

* add a targeting ID for any Form button

* custom outcome style ID
This commit is contained in:
Eugenio Romano 2018-02-15 10:08:46 +00:00 committed by Denys Vuika
parent 6e57cd3e17
commit ae0994edf1
3 changed files with 35 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -269,6 +269,40 @@ formService.formEvents.subscribe((event: Event) => {
});
```
#### Customize form outcomes (buttons) styles
If you want custtomize the outcoumes style of your form you can do it using plain css selectors.
Any outcome has an Id that is composed in the following way:
```
adf-form-YOUR_OUTCAME_NAME
```
Using the CSS you can target any outcome ID and change the style as in this example:
```css
#adf-form-complete {
background-color: blue !important;
color: white;
}
#adf-form-save {
background-color: green !important;
color: white;
}
#adf-form-customoutcome {
background-color: yellow !important;
color: white;
}
```
![](docassets/images/form-style-sample.png)
## See also
- [Stencils](stencils.md)

View File

@ -30,7 +30,7 @@
</mat-card-content>
<mat-card-actions *ngIf="form.hasOutcomes()" class="adf-form-mat-card-actions">
<!--[class.mdl-button--colored]="!outcome.isSystem"-->
<button *ngFor="let outcome of form.outcomes"
<button [id]="'adf-form-'+ outcome.name | lowercase" *ngFor="let outcome of form.outcomes"
[color]="getColorForOutcome(outcome.name)"
mat-button
[disabled]="!isOutcomeButtonEnabled(outcome)"