Développer avec RBS Change : [Résolu] Création de habillage (skin)

  • 80979.1

    25/09/2013 12:40


    guiom
    Rang : Expert
    Bonjour,

    J'essai de définir l'habillage d'un thème que j'ai créé. Il me semble avoir tout déclarer, mais le CSS généré ne remplacement pas les définition var(..) par la valeur voulut.
    Voici des morceaux de mes déclaration :
    CSS
    @import url(/themes/.../style/variables.css);
    h1 {
            border: none;
            font-family: var(h1-font-family);
            font-weight: var(h1-font-weight);
            font-style: var(h1-font-style);
            font-size: var(h1-font-size);
            color: var(heading-one-color);
    }

    variables.css
    :root {
           var-h1-font-family: 'Lucida bright','themixboldplain' /* @var h1fontfamily */;
            var-h1-font-style: italic /* @var h1fontstyle */;
            var-h1-font-size: 3em /* @var h1fontsize */;
            var-h1-font-weight: normal /* @var h1fontweight */;
    }


    skin.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <sections>
      <section name="section-h1">
        <field name="h1fontfamily" type="text" initialvalue="'Lucida bright','themixboldplain'"/>
        <field name="h1fontstyle" type="text" initialvalue="italic"/>
        <field name="h1fontsize" type="text" initialvalue="3em"/>
        <field name="headingonecolor" type="color" initialvalue="#000"/>
        <field name="h1fontweight" type="text" initialvalue="normal"/>
      </section>
    </sections>


    J'ai procéder a diverse commande :
    clear-all, compile-all --clear, theme.install, theme.generate-skin ...

    Mais le CSS est toujour généré ainsi :
    h1{border: none;font-family: var(h1-font-family);font-weight: var(h1-font-weight);font-style: var(h1-font-style);font-size: var(h1-font-size);color: #3CB371;}


    Il y a quelque chose que j'ai raté ? Je ne comprend pas pourquoi heading-one-color est bien inséré et pas les autres.
  • 80979.2 en réponse à 80979.1 écrit par guiom

    26/09/2013 15:50


    Jean-Michel
    Titre : Community Manager
    Rang : Expert
    Bonjour,

    Après relecture du parser CSS il s'avère que l'utilisation des chiffres n'est pas autorisée dans le nom des variables. Ce qui nous amène donc aux morceaux de code suivants.

    Fichier CSS :
    @import url(/themes/.../style/variables.css);
    h1 {
    	border: none;
    	font-family: var(heading-one-font-family);
    	font-weight: var(heading-one-font-weight);
    	font-style: var(heading-one-font-style);
    	font-size: var(heading-one-font-size);
    	color: var(heading-one-color);
    }

    Fichier variables.css :
    :root {
    	var-heading-one-font-family: 'Lucida bright','themixboldplain' /* @var headingonefontfamily */;
    	var-heading-one-font-style: italic /* @var headingonefontstyle */;
    	var-heading-one-font-size: 3em /* @var headingonefontsize */;
    	var-heading-one-font-weight: normal /* @var headingonefontweight */;
    }

    Fichier skin.xml :
    <section name="section-h1">
        <field name="headingonefontfamily" type="text" initialvalue="'Lucida bright themixboldplain'"/>
        <field name="headingonefontstyle" type="text" initialvalue="italic"/>
        <field name="headingonefontsize" type="text" initialvalue="3em"/>
        <field name="headingonecolor" type="color" initialvalue="#000"/>
        <field name="headingonefontweight" type="text" initialvalue="normal"/>
    </section>



    Pour une meilleure réponse, pensez à indiquer la version sur laquelle vous rencontrez des difficultés, ainsi que son type (CMS ou eCommerce core).
    Pour tout problème d'installation indiquez le nom de l'hébergeur et s'il s'agit d'un serveur mutualisé ou dédié.
  • 80979.3 en réponse à 80979.2 écrit par Jean-Michel

    27/09/2013 09:29


    guiom
    Rang : Expert
    Bonjour,

    Merci pour votre intervention, j’avoue que je commençai à désespérer de ne pas trouver pourquoi ça ne fonctionnait pas.

    Tout fonctionne correctement maintenant.
 
Merci de prendre connaissance et de respecter les règles des forums.
 
1471 membres
Aucun membre connecté