Polymer - Elemente cu stiluri diferite

postat acum 3 ani de Stefanescu Mihai in categorie Polymer

Pana acum am facut un element polymer si se pare ca functioneaza perfect, dar ce putem face daca dorim sa avem diverse stiluri (CSS) pentru acel element?

Pai,putem scrie acest CSS ca facand parte din element.

Bineinteles, aceste stiluri pot fi suprascrise, dar poate avem nevoie ca elemental nostrum sa arate intr-un anumit mod in mod default.

Cum putem face acest lucru? Pai exact cum am fi facut in HTML normal, folosindu-ne de tag-ul <style> in template.

Iar in interiorul acestui style punem CSS-ul necesar acestui element polymer:

<link rel="import" href="../bower_components/polymer/polymer.html">

<dom-module id="salut-ip">
  <template>
    <style>
      .element-heading{
          font-family: monospace;
          text-shadow: 1px 1px 3px black;
      }
    </style>
	<h1 class="element-heading">Salut www.Invata-Programare.Ro</h1>
  </template>
  <script>
    Polymer({is: "salut-ip"});
  </script>
</dom-module>

Acum, daca mergem in browser si apasam F5 se poate observa schimbarea:

Sunt un tanar programator din Bucuresti ce lucreaza in PHP/Mysql (MySqli/PDO), Laravel, CodeIgniter, MySQL, PostgreSQL, Wordpress, HTML5/CSS3, Sass, Photoshop si multe altele.
Google+ Community Facebook Group

Comentariu postate de download minecraft for free la data de 15.05.2019
We're a group of volunteers and opening a new scheme in our community. Your website provided us with valuable information to work on. You've done a formidable job and our whole community will be thankful to you.
Comentariu postate de download minecraft for free la data de 16.05.2019
Excellent goods from you, man. I've understand your stuff previous to and you're just extremely fantastic. I really like what you've acquired here, certainly like what you are saying and the way in which you say it. You make it entertaining and you still care for to keep it wise. I can't wait to read far more from you. This is really a wonderful website.