mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Move files from darkswarm to shared
- As this directive is now used by Darkswarm and admin, move files in shared/ folders - Needs some css variable in admin part : as question-mark-with-tooltip is used in admin part, it needs some css variable - Add own scss variables file with all needed variables for question-mark-icon. Some duplication, but now really independant and shared between both darkswarm and admin. - Remove strange border around the button, rendered by chrome when button is focused.
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
Darkswarm.directive "questionMarkWithTooltip", ($tooltip)->
|
||||
|
||||
OFNShared.directive "questionMarkWithTooltip", ($tooltip)->
|
||||
# We use the $tooltip service from Angular foundation to give us boilerplate
|
||||
# Subsequently we patch the scope, template and restrictions
|
||||
tooltip = $tooltip 'questionMarkWithTooltip', 'questionMarkWithTooltip', 'click'
|
||||
tooltip.scope =
|
||||
context: "="
|
||||
tooltip.templateUrl = "question_mark_with_tooltip_icon.html"
|
||||
variant: "="
|
||||
tooltip.templateUrl = "shared/question_mark_with_tooltip_icon.html"
|
||||
tooltip.replace = true
|
||||
tooltip.restrict = 'E'
|
||||
tooltip
|
||||
|
||||
# This is automatically referenced via naming convention in $tooltip
|
||||
Darkswarm.directive 'questionMarkWithTooltipPopup', ->
|
||||
OFNShared.directive 'questionMarkWithTooltipPopup', ->
|
||||
restrict: 'EA'
|
||||
replace: true
|
||||
templateUrl: 'question_mark_with_tooltip.html'
|
||||
templateUrl: 'shared/question_mark_with_tooltip.html'
|
||||
scope: false
|
||||
@@ -48,3 +48,5 @@
|
||||
@import 'components/*';
|
||||
@import 'pages/*';
|
||||
@import '*';
|
||||
|
||||
@import "../shared/question-mark-icon";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@import "variables/variables";
|
||||
|
||||
.unit-price {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -26,6 +28,10 @@
|
||||
background-image: none;
|
||||
background-color: $teal-500;
|
||||
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
&::before {
|
||||
@include icon-font;
|
||||
content: "";
|
||||
14
app/assets/stylesheets/shared/variables/variables.scss
Normal file
14
app/assets/stylesheets/shared/variables/variables.scss
Normal file
@@ -0,0 +1,14 @@
|
||||
$padding-small: 0.5rem;
|
||||
$radius-small: 0.25em;
|
||||
$white: #fff;
|
||||
$dynamic-blue: #3d8dd1;
|
||||
$teal-500: #0096ad;
|
||||
@import "../../darkswarm/style"; // Import "OFN" font
|
||||
@mixin icon-font {
|
||||
font-family: "OFN";
|
||||
display: inline-block;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
Reference in New Issue
Block a user