Skip to content

Commit

Permalink
! The :where() automation code worked fine, but the world may not be …
Browse files Browse the repository at this point in the history
…ready for it, so I'm removing it for now. It might break some existing CSS, hopefully it won't be worse than what :where() used to break. (Subs-Cache.php)

@ Full explanation: https://wedge.org/pub/feats/6108/new-revs/msg297990/#msg297990
  • Loading branch information
Nao committed Mar 27, 2021
1 parent 8b2fd86 commit 750c3a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/app/Subs-Cache.php
Expand Up @@ -742,16 +742,18 @@ function wedge_cache_css_files($folder, $ids, $latest_date, $css, $gzip = false,
$final
);

/*
// Group as many selectors as we can into a :where() selector. This is preferred over :is() because of specificity reasons,
// meaning :where(), unlike :is(), doesn't affect any overrides you would want to apply to one of its components.
// For this reason, support for earlier implementations (:any and :matches) was dropped from Wedge.
// !! Disabling this for now, as it's causing problems with existing skins that were built with :is() in mind.
$selector = '([abipqsu]|[!+>&#*@:.a-z0-9][^{};,\n"()\~+> ]+?)'; // like $selector_regex, but lazy (+?) and without compounds (\~+> ).
if (we::is('chrome[88-],firefox[78-],safari[14-]') && preg_match_all('~(?:^|})' . $selector . '([>+: ][^,{]+)(?:,' . $selector . '\2)+(?={)~', $final, $matches, PREG_SET_ORDER))
{
foreach ($matches as $m)
{
// The spec says pseudo-elements aren't allowed INSIDE :matches, but implementations seem to also refuse them NEXT to :matches.
// !! Note: should check whether this is still the case with :where().
// !! Note: should check whether this is still the case with :where(), as they're now allowed inside :is().
if (strpos($m[0], ':') !== false && strhas($m[0], [':before', ':after', ':first-letter', ':first-line', ':selection']))
continue;
$final = str_replace(
Expand All @@ -765,6 +767,7 @@ function wedge_cache_css_files($folder, $ids, $latest_date, $css, $gzip = false,
);
}
}
*/

wedge_process_css_replacements($final);

Expand Down

0 comments on commit 750c3a6

Please sign in to comment.