Skip to content

Instantly share code, notes, and snippets.

View thibaudcolas's full-sized avatar
😀

Thibaud Colas thibaudcolas

😀
View GitHub Profile
@thibaudcolas
thibaudcolas / README.md
Last active July 4, 2022 16:04
Windows Contrast themes / High contrast mode in media queries

Windows Contrast themes / High contrast mode in media queries

Here are all relevant media queries to consider when supporting Contrast Themes / Windows High Contrast Mode.

Results

MS Edge 101, Windows 10 Pro 21H2

  • No High Contrast:
    • (forced-colors: none), (prefers-color-scheme: light), (prefers-contrast: no-preference)
class TestHeaderBreadcrumbs(TestCase, WagtailTestUtils):
def test_choose_parent_page(self):
response = self.client.get("/admin/tests/eventpage/choose_parent/")
# check that home breadcrumb link exists
expected = """
<li class="breadcrumb-item home">
<a href="/admin/" class="breadcrumb-link">
<svg class="icon icon-home home_icon" aria-hidden="true">
<use href="#icon-home"></use>
@thibaudcolas
thibaudcolas / README.md
Created May 18, 2022 13:43
Indigo color overrides for Wagtail 3.0 admin interface

The Wagtail 3.0 admin interface introduces two new indigo shades which are currently not customisable. This can be problematic for Wagtail sites currently customising Wagtail’s primary color.

To make those shades customisable, we can override Wagtail’s built-in CSS files with specially-crafted alternatives which use CSS variables for those new colors.

Full color override

The simplest way to change colors is to change them for the whole of the Wagtail admin at once. First-clone this gist as a sub-folder in your Wagtail project:

@thibaudcolas
thibaudcolas / core-plugins.md
Last active May 4, 2022 15:27
Tailwind core plugins creating a lot of variables for questionable value

Consider disabling those core plugins in the Tailwind configuration, so the variables don’t appear in DevTools.

touchAction

'--tw-pan-x': ' ',
'--tw-pan-y': ' ',
'--tw-pinch-zoom': ' ',
@thibaudcolas
thibaudcolas / README.md
Last active May 4, 2022 12:32
Reproduction case for Poetry issue: Unwanted updates in dependencies with extras when updating another dependency #5536

See

@thibaudcolas
thibaudcolas / README.md
Last active April 22, 2022 11:38
Upcoming breaking changes affecting Wagtail community projects

Upcoming breaking changes affecting Wagtail community projects

This review inspects the code of 63 Wagtail packages, to check for patterns which will need to be reworked as part of our UI roadmap.

Feedback and discussions

Please join #package-maintainers on the Wagtail Slack.

Customisations checked to date

@thibaudcolas
thibaudcolas / README.md
Last active February 14, 2022 11:49
GitHub Actions w/ node_modules and virtual env cache bypassing installations on hit, not restoring cache at all on miss

This caching setup will store the output of npm and Poetry installations, rather than both tools’ respective cache folders.

  • Thus the installation steps can be completely skipped when the cache is hit (if: steps.poetry-cache.outputs.cache-hit != 'true')
  • It also means the cache should only be reused on exact key matches (using key only rather than restore-keys).
  • And the key needs to be a truthful representation of the installation (including OS, language version, installer version, lockfile hash).
  • To make the most of this, the key also shouldn’t be dependent on the branch / PR build identifiers.

This will perfom:

  • Much faster than storing the cache folders on projects where dependencies rarely update. Assuming downloading and extracting a large folder is faster than the installation step.
@thibaudcolas
thibaudcolas / cron.yaml
Created January 28, 2022 10:11
GCP App Engine scheduled Django management commands
cron:
- description: 'publish_scheduled_pages running every hour'
url: /commands/publish-scheduled-pages/
schedule: every 1 hours
{% extends "base.html" %}
{% load wagtailcore_tags %}
{% load wagtailimages_tags %}
{% load wagtailpictureproposal_tags %}
{% block body_class %}template-homepage{% endblock %}
{% block content %}
<style>