Consolidate button styles
This patchset will create consistent button styling according
to the styleguide and remove redundant button styles by creating
reusable button classes.
This patchset also implements a consistent strategy for including
icon assets. Currently, svg icons are imported as CSS background
images or inlined into the markup. Inlining an svg is preferred,
especially when used with buttons or links so the colors can
be easily changed for different states (hover, focus, disabled)
without having to request variants.
The icon provider allows us to inline svgs without cluttering
the markup. Webpack config was adjusted to use svg-inline-loader
when resolving svgs that are used by the icon provider directive.
- All svgs were optimized to remove unncessary information.
- Removed unused svg color variants
- Moved icons used by icon provider to separate directory to
avoid Webpack parsing the files twice
- Small changes to navigation icons
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I1ca214b74fc502e6b6e760cfee88b48110237c43
diff --git a/app/configuration/controllers/snmp-controller.html b/app/configuration/controllers/snmp-controller.html
index 35cd1f4..aa61f64 100644
--- a/app/configuration/controllers/snmp-controller.html
+++ b/app/configuration/controllers/snmp-controller.html
@@ -69,28 +69,29 @@
</fieldset>
</div>
<div class="small-2 align-self-center snmp__buttons">
- <button class="edit_button" type="button">
- <img src="../../assets/images/icon-edit-blue.svg" alt="Edit">
+ <button class="btn edit_button" type="button">
+ <icon file="icon-edit.svg" aria-label="Edit"></icon>
</button>
</div>
</div>
</div>
<div class="small-1 align-self-center snmp__buttons trash">
- <button class="trash_button" type="button" ng-click="removeSNMPManager($index)">
- <img src="../../assets/images/icon-trashcan-blue.svg" alt="Remove">
+ <button class="btn trash_button" type="button" ng-click="removeSNMPManager($index)">
+ <icon file="icon-trashcan.svg" aria-label="Remove"></icon>
</button>
</div>
</div>
<div class="row column">
- <button class="btn-add" type="button" ng-click="submitted=false; addNewSNMPManager();"><img class="add__icon" src="../../assets/images/icon-plus.svg" alt=""/> Add manager</button>
+ <button class="btn btn-tertiary btn-add" type="button" ng-click="submitted=false; addNewSNMPManager();">
+ <icon file="icon-plus.svg"></icon>Add manager</button>
</div>
</form>
</div>
</div>
<div class="row column">
<div class="snmp__submit-wrapper">
- <button type="button" ng-click="submitted=true; snmp__form.$valid && setSNMP();" class="btn-primary inline">Save settings</button>
- <button type="button" class="btn-secondary inline" ng-click="refresh()">Cancel</button>
+ <button type="button" ng-click="submitted=true; snmp__form.$valid && setSNMP();" class="btn btn-primary">Save settings</button>
+ <button type="button" class="btn btn-secondary" ng-click="refresh()">Cancel</button>
</div>
</div>
</div>
\ No newline at end of file