Fix vertical alignment using flex

- Firefox displayed the icon above the legend
 - Use `display: flex;` and `align-items: center;` to vertical align icon and text
This commit is contained in:
Jean-Baptiste Bellet
2021-03-01 16:37:27 +01:00
parent 36573701dc
commit d6cf69df34
5 changed files with 14 additions and 5 deletions

View File

@@ -8,7 +8,7 @@
"price-breakdown-placement" => "bottom",
"price-breakdown-animation" => true}
{{ variant.price_with_fees | localizeCurrency }}
.variant-unit-price
.unit-price.variant-unit-price
%question-mark-with-tooltip{"question-mark-with-tooltip" => "_",
"question-mark-with-tooltip-append-to-body" => "true",
"question-mark-with-tooltip-placement" => "top",

View File

@@ -67,8 +67,10 @@
.variant-unit-price {
color: $grey-700;
font-size: 0.9rem;
font-size: 0.85rem;
margin-top: 15px;
position: relative;
left: -1px;
}
// Total price

View File

@@ -55,7 +55,6 @@
.unit-price {
justify-content: flex-end;
align-items: baseline;
}
}

View File

@@ -1,12 +1,20 @@
.unit-price {
display: flex;
align-items: center;
}
.question-mark-icon {
position: relative;
top: 6px;
right: 1px;
background-image: image-url("question-mark-icon.svg");
background-size: cover;
background-repeat: no-repeat;
// Reset button element css attributes
padding: 0;
margin: 0;
width: 20px;
min-width: 20px;
height: 20px;
background-color: transparent;

View File

@@ -24,7 +24,7 @@
%td
.total-price.text-right {{ line_item.total_price | localizeCurrency }}
- if feature? :unit_price, spree_current_user
.flex.unit-price
.unit-price
%div{:style => "margin-right: 5px"}
%question-mark-with-tooltip{"question-mark-with-tooltip" => "_",
"question-mark-with-tooltip-append-to-body" => "true",