Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make icons look better #461

Merged
merged 3 commits into from
Feb 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/webapp/frontend/src/components/search-bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@

<div class="row">
<vaadin-text-field id="field" class="field" placeholder="[[fieldPlaceholder]]" value="{{fieldValue}}" focused="{{_fieldFocused}}" on-value-changed="_filterChanged">
<iron-icon icon="[[fieldIcon]]" slot="prefix"></iron-icon>
<iron-icon icon$="[[fieldIcon]]" slot="prefix"></iron-icon>
</vaadin-text-field>
<vaadin-checkbox class="checkbox" checked="{{checkboxChecked}}" focused="{{_checkboxFocused}}" hidden$="[[!_desktopView]]">[[checkboxText]]</vaadin-checkbox>
<vaadin-button id="clear" class="extra-filter" theme="tertiary">
[[clearText]]
</vaadin-button>
<vaadin-button id="action" class="extra-action" theme="primary">
<iron-icon icon="[[buttonIcon]]"></iron-icon>
<span>[[buttonText]]</span>
<iron-icon icon$="[[buttonIcon]]" slot="prefix"></iron-icon>
[[buttonText]]
</vaadin-button>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ <h3>[[item.customer.phoneNumber]]</h3>

<div slot="info" class="total">Total [[item.totalPrice]]</div>

<vaadin-button slot="right" id="save" theme="primary success" class="edit-button" hidden="[[!review]]">Place Order ✓</vaadin-button>
<vaadin-button slot="right" id="edit" theme="primary" class="edit-button" hidden="[[review]]">
<span>Edit order</span>
<iron-icon icon="vaadin:edit"></iron-icon>
<vaadin-button slot="right" id="save" theme="primary success" hidden="[[!review]]">Place Order ✓</vaadin-button>
<vaadin-button slot="right" id="edit" theme="primary" hidden="[[review]]">
Edit order
<iron-icon icon="vaadin:edit" slot="suffix"></iron-icon>
</vaadin-button>
</buttons-bar>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
padding: 2px 8px;
}

:host([status="delivered"]) #wrapper span,
:host(:not([status="delivered"])) #wrapper iron-icon {
display: none;
}

:host([small]) #wrapper {
padding: 0 5px;
}
Expand All @@ -49,7 +54,11 @@
}
</style>

<div id="wrapper" inner-h-t-m-l="{{_getContent(status)}}"></div>
<div id="wrapper">
<span>[[status]]</span>
<iron-icon icon="vaadin:check"></iron-icon>
</div>

</template>

<script>
Expand All @@ -69,19 +78,9 @@
}

_onStatusChanged(current) {
const lowercase = current ? current.toLowerCase() : current;
if (lowercase != current) {
this.status = lowercase;
}
this.status = current && current.toLowerCase();
}

_getContent(status) {
if (status === 'delivered') {
return '<iron-icon icon="vaadin:check"></iron-icon>';
}

return status;
}
}

window.customElements.define(OrderStatusBadge.is, OrderStatusBadge);
Expand Down
19 changes: 15 additions & 4 deletions src/main/webapp/frontend/styles/shared-styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@
</template>
</dom-module>

<!-- Theme for icons inside text-field and buttons, 'vaadin:' icons have custom rules
in lumo theme that make icons look wrong, by overriding width and height but not
padding the look ok -->
<dom-module id="bakery-text-buttons-theme-icons" theme-for="vaadin-text-field vaadin-button">
<template>
<style>
[part="input-field"] ::slotted(iron-icon[icon^="vaadin:"]) ,
:host ::slotted(iron-icon[icon^="vaadin:"]) {
width: var(--iron-icon-width, 24px);
height: var(--iron-icon-height, 24px);
}
</style>
</template>
</dom-module>

<!-- Theme for the vaadin-grid -->
<dom-module id="bakery-grid-theme" theme-for="vaadin-grid">
<template>
Expand Down Expand Up @@ -173,10 +188,6 @@
box-sizing: border-box;
}

iron-icon {
box-sizing: content-box;
}

:host([hidden]),
[hidden] {
display: none !important;
Expand Down