From 8cd384ec1f50089ea6a1b42418de6e4a394225e3 Mon Sep 17 00:00:00 2001 From: Thibaud Colas Date: Thu, 6 Jun 2019 18:00:57 +0100 Subject: [PATCH] Switch legacy icon implementations to use variables instead of hard-coded characters --- client/scss/components/_breadcrumb.scss | 2 +- client/scss/components/_chooser.scss | 8 ++++---- client/scss/components/_forms.scss | 2 +- client/scss/components/_help-block.scss | 6 +++--- client/scss/components/_icons.scss | 2 +- client/scss/components/_loading-mask.scss | 2 +- client/scss/components/_main-nav.scss | 2 +- client/scss/components/_messages.scss | 6 +++--- client/scss/components/_streamfield.scss | 2 +- client/scss/components/_tabs.scss | 2 +- client/scss/components/_tag.scss | 2 +- client/scss/elements/_forms.scss | 6 +++--- client/scss/overrides/_vendor.datetimepicker.scss | 10 +++++----- client/scss/overrides/_vendor.tagit.scss | 2 +- .../wagtailadmin/scss/layouts/page-editor.scss | 8 ++++---- 15 files changed, 31 insertions(+), 31 deletions(-) diff --git a/client/scss/components/_breadcrumb.scss b/client/scss/components/_breadcrumb.scss index dd8b218b49..41f97e7321 100644 --- a/client/scss/components/_breadcrumb.scss +++ b/client/scss/components/_breadcrumb.scss @@ -31,7 +31,7 @@ // z-index: 5; position: absolute; font-family: wagtail; - content: 'n'; + content: map-get($icons, 'arrow-right'); padding-left: 20px; font-size: 2em; color: $color-teal-darker; diff --git a/client/scss/components/_chooser.scss b/client/scss/components/_chooser.scss index abff14c32e..907ea9f3d0 100644 --- a/client/scss/components/_chooser.scss +++ b/client/scss/components/_chooser.scss @@ -85,7 +85,7 @@ overriden here? hmm. .unchosen, .chosen { &:before { - content: 'b'; + content: map-get($icons, 'doc-empty-inverse'); } } } @@ -94,7 +94,7 @@ overriden here? hmm. .unchosen, .chosen { &:before { - content: 'D'; + content: map-get($icons, 'snippet'); } } } @@ -103,7 +103,7 @@ overriden here? hmm. .unchosen, .chosen { &:before { - content: 'r'; + content: map-get($icons, 'doc-full-inverse'); } } } @@ -112,7 +112,7 @@ overriden here? hmm. .unchosen, .chosen { &:before { - content: 'o'; + content: map-get($icons, 'image'); } } diff --git a/client/scss/components/_forms.scss b/client/scss/components/_forms.scss index 60ab2cbca1..81e0e8b64b 100644 --- a/client/scss/components/_forms.scss +++ b/client/scss/components/_forms.scss @@ -92,7 +92,7 @@ select::-ms-expand { bottom: 0; width: 1.5em; font-family: wagtail; - content: 'q'; + content: map-get($icons, 'arrow-down'); border: 1px solid $color-input-border; border-width: 0 0 0 1px; text-align: center; diff --git a/client/scss/components/_help-block.scss b/client/scss/components/_help-block.scss index 20d011b62e..2147cbc1c7 100644 --- a/client/scss/components/_help-block.scss +++ b/client/scss/components/_help-block.scss @@ -30,7 +30,7 @@ position: absolute; left: 1em; top: 0.7em; - content: '?'; + content: map-get($icons, 'help'); font-size: 1.4em; } } @@ -48,7 +48,7 @@ &:before { color: $color-orange; - content: '!'; + content: map-get($icons, 'warning'); } } @@ -57,6 +57,6 @@ &:before { color: $color-red; - content: '!'; + content: map-get($icons, 'warning'); } } diff --git a/client/scss/components/_icons.scss b/client/scss/components/_icons.scss index 1fe6523628..8ea97b5a4a 100644 --- a/client/scss/components/_icons.scss +++ b/client/scss/components/_icons.scss @@ -122,7 +122,7 @@ $size: 15px; &:before { - content: '?'; + content: map-get($icons, 'help'); display: inline-block; width: $size; height: $size; diff --git a/client/scss/components/_loading-mask.scss b/client/scss/components/_loading-mask.scss index 30d7406d55..5947df6f5f 100644 --- a/client/scss/components/_loading-mask.scss +++ b/client/scss/components/_loading-mask.scss @@ -28,7 +28,7 @@ margin: -15px 0 0 -15px; font-family: wagtail; animation: spin 0.5s infinite linear; - content: '1'; + content: map-get($icons, 'spinner'); z-index: 2; color: $color-teal; } diff --git a/client/scss/components/_main-nav.scss b/client/scss/components/_main-nav.scss index 6dd394a65a..5f22b97e95 100644 --- a/client/scss/components/_main-nav.scss +++ b/client/scss/components/_main-nav.scss @@ -232,7 +232,7 @@ font-family: wagtail; font-weight: 200; text-transform: none; - content: 'f'; + content: map-get($icons, 'search'); display: block; height: 100%; line-height: 3.3em; diff --git a/client/scss/components/_messages.scss b/client/scss/components/_messages.scss index 52f1555e25..e16768ee4f 100644 --- a/client/scss/components/_messages.scss +++ b/client/scss/components/_messages.scss @@ -36,7 +36,7 @@ &:before { font-family: wagtail; - content: '!'; + content: map-get($icons, 'warning'); } } @@ -45,7 +45,7 @@ &:before { font-family: wagtail; - content: '!'; + content: map-get($icons, 'warning'); } } @@ -54,7 +54,7 @@ &:before { font-family: wagtail; - content: '9'; + content: map-get($icons, 'success'); } } diff --git a/client/scss/components/_streamfield.scss b/client/scss/components/_streamfield.scss index 2e702e8cc7..05723d3601 100644 --- a/client/scss/components/_streamfield.scss +++ b/client/scss/components/_streamfield.scss @@ -261,7 +261,7 @@ li.sequence-member { transform: rotate(-45deg); position: absolute; font-family: wagtail; - content: 'B'; + content: map-get($icons, 'plus-inverse'); line-height: 1em; text-align: center; } diff --git a/client/scss/components/_tabs.scss b/client/scss/components/_tabs.scss index b607cdfa89..dea54ee946 100644 --- a/client/scss/components/_tabs.scss +++ b/client/scss/components/_tabs.scss @@ -68,7 +68,7 @@ font-family: wagtail; vertical-align: middle; text-transform: none; - content: 'w'; + content: map-get($icons, 'cog'); margin-right: 0.5em; font-size: 1.2em; font-weight: normal; diff --git a/client/scss/components/_tag.scss b/client/scss/components/_tag.scss index 57286a0431..8b561282cc 100644 --- a/client/scss/components/_tag.scss +++ b/client/scss/components/_tag.scss @@ -12,7 +12,7 @@ font-family: wagtail; display: inline-block; color: $color-white; - content: 'u'; + content: map-get($icons, 'tag'); padding-right: 0.5em; } diff --git a/client/scss/elements/_forms.scss b/client/scss/elements/_forms.scss index bf683f9ae2..2e5314b9c9 100644 --- a/client/scss/elements/_forms.scss +++ b/client/scss/elements/_forms.scss @@ -131,7 +131,7 @@ input[type=radio]:before { left: -2px; cursor: pointer; display: block; - content: 'K'; + content: map-get($icons, 'radio-full'); width: 1em; height: 1em; line-height: 1.1em; @@ -142,7 +142,7 @@ input[type=radio]:before { } input[type=radio]:checked:before { - content: 'K'; + content: map-get($icons, 'radio-full'); color: $color-teal; } @@ -161,7 +161,7 @@ input[type=checkbox]:before { top: -5px; cursor: pointer; display: block; - content: 'x'; + content: map-get($icons, 'tick'); line-height: 20px; width: 20px; height: 20px; diff --git a/client/scss/overrides/_vendor.datetimepicker.scss b/client/scss/overrides/_vendor.datetimepicker.scss index cbf22cb812..10f6eeeeda 100644 --- a/client/scss/overrides/_vendor.datetimepicker.scss +++ b/client/scss/overrides/_vendor.datetimepicker.scss @@ -84,7 +84,7 @@ float: left; &:before { - content: 'z'; + content: map-get($icons, 'arrow-left'); } } @@ -93,7 +93,7 @@ margin-left: 5px; &:before { - content: 'W'; + content: map-get($icons, 'home'); } } @@ -101,7 +101,7 @@ float: right; &:before { - content: 'n'; + content: map-get($icons, 'arrow-right'); } } @@ -127,11 +127,11 @@ } .xdsoft_prev:before { - content: 'e'; + content: map-get($icons, 'arrow-up'); } .xdsoft_next:before { - content: 'q'; + content: map-get($icons, 'arrow-down'); } .xdsoft_time_box { diff --git a/client/scss/overrides/_vendor.tagit.scss b/client/scss/overrides/_vendor.tagit.scss index ff659a30f0..88138fa230 100644 --- a/client/scss/overrides/_vendor.tagit.scss +++ b/client/scss/overrides/_vendor.tagit.scss @@ -34,7 +34,7 @@ font-family: wagtail; display: block; color: $color-grey-3; - content: 'g'; + content: map-get($icons, 'cross'); } .ui-icon-close:hover:before { diff --git a/wagtail/admin/static_src/wagtailadmin/scss/layouts/page-editor.scss b/wagtail/admin/static_src/wagtailadmin/scss/layouts/page-editor.scss index b0137bd2e8..12de793042 100644 --- a/wagtail/admin/static_src/wagtailadmin/scss/layouts/page-editor.scss +++ b/wagtail/admin/static_src/wagtailadmin/scss/layouts/page-editor.scss @@ -121,7 +121,7 @@ $object-title-height: 40px; text-shadow: none; font-family: wagtail; text-transform: none; - content: 'q'; + content: map-get($icons, 'arrow-down'); text-align: center; display: block; position: absolute; @@ -219,7 +219,7 @@ $object-title-height: 40px; // special panel for the publishing fields, requires a bit more pizzazz &.publishing { > h2:before { - content: '7'; + content: map-get($icons, 'date'); font-size: 1.8rem; line-height: 1.4em; width: 1.4em; @@ -304,7 +304,7 @@ $object-title-height: 40px; > h2 { &:before, > label:before { - content: '6'; + content: map-get($icons, 'collapse-up'); cursor: pointer; } } @@ -313,7 +313,7 @@ $object-title-height: 40px; > h2 { &:before, > label:before { - content: '5'; + content: map-get($icons, 'collapse-down'); } } }