Replace SCSS compilation with CSS variables (#4191)

* Replace SCSS compilation with CSS variables

* Update tests

* Update src/pretix/presale/style.py

Co-authored-by: Mira <weller@rami.io>

* Update src/pretix/presale/context.py

Co-authored-by: Mira <weller@rami.io>

* Update src/pretix/presale/views/widget.py

Co-authored-by: Mira <weller@rami.io>

* Update src/pretix/presale/context.py

Co-authored-by: Mira <weller@rami.io>

* Update src/pretix/static/pretixbase/scss/_variables.scss

Co-authored-by: Richard Schreiber <schreiber@rami.io>

* Last minor changes

* Rename file

---------

Co-authored-by: Mira <weller@rami.io>
Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
Raphael Michel
2024-06-25 13:01:20 +02:00
committed by GitHub
parent 7672e6274d
commit f0a06cd9fe
72 changed files with 867 additions and 1600 deletions

View File

@@ -31,7 +31,6 @@ from django_scopes import scopes_disabled
from freezegun import freeze_time
from pretix.base.models import Order, OrderPosition
from pretix.presale.style import regenerate_css, regenerate_organizer_css
from .test_cart import CartTestMixin
@@ -544,23 +543,23 @@ class WidgetCartTest(CartTestMixin, TestCase):
def test_css_customized(self):
response = self.client.get('/%s/%s/widget/v1.css' % (self.orga.slug, self.event.slug))
c = b"".join(response.streaming_content).decode()
assert '#7f5a91' in c
assert '#8E44B3' in c
assert '#33c33c' not in c
assert '#34c34c' not in c
self.orga.settings.primary_color = "#33c33c"
regenerate_organizer_css.apply(args=(self.orga.pk,))
self.orga.cache.clear()
response = self.client.get('/%s/%s/widget/v1.css' % (self.orga.slug, self.event.slug))
c = b"".join(response.streaming_content).decode()
assert '#7f5a91' not in c
assert '#8E44B3' not in c
assert '#33c33c' in c
assert '#34c34c' not in c
self.event.settings.primary_color = "#34c34c"
regenerate_css.apply(args=(self.event.pk,))
self.event.cache.clear()
response = self.client.get('/%s/%s/widget/v1.css' % (self.orga.slug, self.event.slug))
c = b"".join(response.streaming_content).decode()
assert '#7f5a91' not in c
assert '#8E44B3' not in c
assert '#33c33c' not in c
assert '#34c34c' in c