From f26c88721614d1c25bcd26740b8fb20a7a97bd05 Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Tue, 14 Apr 2020 12:19:29 +0300 Subject: [PATCH] Implement 'selector-append' sass function 'selector-append' is used in xstatic-mdi [1] but it isn't supported by the latest pyScss. As a workaround we use 'append-selector' function from pyScss until 'selector-append' will be supported. This patch also reverts Ia9e1e807591d4428f585177f521d4cb9d463b917 because we don't need it anymore. [1] https://opendev.org/openstack/xstatic-mdi/src/tag/1.6.50.2/xstatic/pkg/mdi/data/scss/_functions.scss#L2 stable/train backport: A release note on the known issue is now removed as it is fixed by this commit. Instead, a note on the workaround by this commit is added. Change-Id: Ib8ca0fcfe339cb68d6a157a00cbc2d34854ef4c5 Closes-Bug: #1771559 (cherry picked from commit 74d76e900f28e88190a35bff921c56349077ca53) --- .../themes/material/static/horizon/_styles.scss | 9 +++++++++ .../pyscss-and-setuptools-7634dcee9d62bde9.yaml | 12 ++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/openstack_dashboard/themes/material/static/horizon/_styles.scss b/openstack_dashboard/themes/material/static/horizon/_styles.scss index 047af99431..8b07757271 100644 --- a/openstack_dashboard/themes/material/static/horizon/_styles.scss +++ b/openstack_dashboard/themes/material/static/horizon/_styles.scss @@ -1,3 +1,12 @@ +// NOTE(e0ne): it's temporary workaround to until specified function will +// be supported by pyScss. We need to define this function before any MDI +// usage. +@if not function-exists("selector-append") { + @function selector-append($selector, $to-append) { + @return append-selector($selector, $to-append); + } +} + @import "animations"; @import "icons"; @import "components/checkboxes"; diff --git a/releasenotes/notes/pyscss-and-setuptools-7634dcee9d62bde9.yaml b/releasenotes/notes/pyscss-and-setuptools-7634dcee9d62bde9.yaml index cdf8a2a0c6..ed0b351180 100644 --- a/releasenotes/notes/pyscss-and-setuptools-7634dcee9d62bde9.yaml +++ b/releasenotes/notes/pyscss-and-setuptools-7634dcee9d62bde9.yaml @@ -1,13 +1,9 @@ --- -issues: - - | - The material design theme is now broken with pyScss 1.3.7 - (also see the upgrade notice section). - If you really depends on the material design theme, keep using - pyScss 1.3.4 with setuptools<45 (while the horizon dependencies list - says pyScss>=1.3.7 is required). - The issue is tracked via [:bug:`1771559`]. upgrade: - | pyScss 1.3.7 is now required due to the incompatibility that pyScss 1.3.4 used before in horizon does not work with setuptools 46. + - | + Along with the upgrade of pyScss to 1.3.7, a workaround for the + material design theme is added to make it work properly. + See [:bug:`1771559`] for detail.