Browse Source

@supports ne fonctionnait pas (?)

master v4.1.0
ARNO* 8 months ago
parent
commit
17fdb468a9
  1. 25
      css_imbriques_fonctions.php
  2. 2
      paquet.xml

25
css_imbriques_fonctions.php

@ -7,6 +7,7 @@ if (!defined("_UTILISER_BOXSIZING_HTC")) define("_UTILISER_BOXSIZING_HTC", false
$GLOBALS["css_imbriques_medias_queries"] = array();
$GLOBALS["css_imbriques_supports"] = array();
// filtre couleur_rgba converti une mention de couleur hexadecimale
// en couleur semi_transparente rgba
@ -481,13 +482,21 @@ function css_imbriques_decouper ($css) {
// Rechercher les media_queries
$css = preg_replace_callback(",(.*(@(media|supports) .* (media|supports)@).*)\{(.*)\}\n?,", "css_imbriques_traiter_media", $css);
$css = preg_replace_callback(",(.*(@(media) .* (media)@).*)\{(.*)\}\n?,", "css_imbriques_traiter_media", $css);
if (count($GLOBALS["css_imbriques_medias_queries"]) > 0) {
foreach($GLOBALS["css_imbriques_medias_queries"] as $k=>$val) {
$css .= $k ."{\n". $val . "}\n";
}
$GLOBALS["css_imbriques_medias_queries"] = array();
}
// Rechercher les @supports
$css = preg_replace_callback(",(.*(@(supports) .* (supports)@).*)\{(.*)\}\n?,", "css_imbriques_traiter_supports", $css);
if (count($GLOBALS["css_imbriques_supports"]) > 0) {
foreach($GLOBALS["css_imbriques_supports"] as $k=>$val) {
$css .= $k ."{\n". $val . "}\n";
}
$GLOBALS["css_imbriques_supports"] = array();
}
return $css;
}
@ -499,6 +508,7 @@ function css_imbriques_traiter_media($reg) {
$intitule = str_replace($reg[2], "", $reg[1]);
$intitule = trim(preg_replace(",\ +,", " ", $intitule));
$definition = $reg[5];
@ -507,6 +517,19 @@ function css_imbriques_traiter_media($reg) {
$GLOBALS["css_imbriques_medias_queries"]["$query"] .= $intitule."{".$definition."}\n";
return;
}
function css_imbriques_traiter_supports($reg) {
$query = $reg[2];
$query = trim(substr(trim($query), 0, strlen($query) - (strlen($reg[3])+1)));
$intitule = str_replace($reg[2], "", $reg[1]);
$intitule = trim(preg_replace(",\ +,", " ", $intitule));
$definition = $reg[5];
if (!isset($GLOBALS["css_imbriques_supports"]["$query"])) $GLOBALS["css_imbriques_supports"]["$query"] = "";
$GLOBALS["css_imbriques_supports"]["$query"] .= $intitule."{".$definition."}\n";
return;
}
function css_imbriques_traiter_keyframe ($flux) {
print_r($flux);
die();

2
paquet.xml

@ -1,7 +1,7 @@
<paquet
prefix="css_imbriques"
categorie="outil"
version="4.0.0"
version="4.1.0"
etat="stable"
compatibilite="[3.2.0;4.1.*]"
logo="css_imbriques-128.png"

Loading…
Cancel
Save