<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>(How) is yeoman generated sample fragment color choice supposed to work?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120814947" />
  <subtitle>(How) is yeoman generated sample fragment color choice supposed to work?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120814947</id>
  <updated>2026-06-20T05:02:48Z</updated>
  <dc:date>2026-06-20T05:02:48Z</dc:date>
  <entry>
    <title>(How) is yeoman generated sample fragment color choice supposed to work?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120814946" />
    <author>
      <name>Philipp Kunz</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120814946</id>
    <updated>2021-06-02T15:07:59Z</updated>
    <published>2021-06-02T06:50:53Z</published>
    <summary type="html">&lt;p&gt;i created a fragments project with yeoman. in the page editor it
  shows a color choice but that color has no effect.&lt;/p&gt;
&lt;p&gt;i quickly found two ways to make it work but which is the correct approach?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;1. change html:&lt;/p&gt;
&lt;pre&gt; &amp;lt;div class=&amp;quot;sample-fragment&amp;quot;&amp;gt;
-  &amp;lt;h1&amp;gt; 
+  &amp;lt;h1 style=&amp;quot;color: ${configuration.textColor.rgbValue}&amp;quot;&amp;gt; 
     &amp;lt;lfr-editable id=&amp;quot;title&amp;quot; type=&amp;quot;text&amp;quot;&amp;gt;
       Sample fragment
     &amp;lt;/lfr-editable&amp;gt;
   &amp;lt;/h1&amp;gt;
 &amp;lt;/div&amp;gt;
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;2. (alternative) change js&lt;/p&gt;
&lt;pre&gt; console.group('Sample fragment');
 console.log('fragmentElement', fragmentElement);
 console.log('configuration', configuration);
+fragmentElement.style.color = configuration.textColor.rgbValue;
 console.groupEnd();
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;i have not found so far a document that describes how that should
  work. glad for any hint.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;setup details:&lt;/p&gt;
&lt;p&gt;created a sample fragments project with
  &amp;quot;generator-liferay-fragments&amp;quot;: &amp;quot;1.9.1&amp;quot; &lt;/p&gt;
&lt;p&gt;yarn global add yo generator-liferay-fragments&lt;/p&gt;
&lt;p&gt;yo liferay-fragments&lt;/p&gt;
&lt;p&gt;yarn run import&lt;/p&gt;
&lt;p&gt;and docker run ... liferay/portal:7.4.0-ga1&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Philipp Kunz</dc:creator>
    <dc:date>2021-06-02T06:50:53Z</dc:date>
  </entry>
</feed>
