<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abhishek Dwevedi on Medium]]></title>
        <description><![CDATA[Stories by Abhishek Dwevedi on Medium]]></description>
        <link>https://medium.com/@abhishekdwevedi?source=rss-ca7bf54f91be------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Sdsnl6-ndQqLN0Ge_iMwBA.jpeg</url>
            <title>Stories by Abhishek Dwevedi on Medium</title>
            <link>https://medium.com/@abhishekdwevedi?source=rss-ca7bf54f91be------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 05:42:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhishekdwevedi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using the AEM Style System to Increase Reusability of Components]]></title>
            <link>https://medium.com/adobetech/using-aem-style-system-to-increase-reusability-of-components-8177c5b65c9e?source=rss-ca7bf54f91be------2</link>
            <guid isPermaLink="false">https://medium.com/p/8177c5b65c9e</guid>
            <category><![CDATA[core-components]]></category>
            <category><![CDATA[adobe-experience-manager]]></category>
            <category><![CDATA[aem]]></category>
            <category><![CDATA[adobe-products]]></category>
            <category><![CDATA[style-system]]></category>
            <dc:creator><![CDATA[Abhishek Dwevedi]]></dc:creator>
            <pubDate>Fri, 26 Oct 2018 12:45:02 GMT</pubDate>
            <atom:updated>2018-11-16T18:01:14.203Z</atom:updated>
            <content:encoded><![CDATA[<p>The <a href="https://www.adobe.io/apis/experiencecloud/aem.html">Adobe Experience Manager</a> style system allows developers to create visual variations of components with zero back-end development, allowing better reuse of AEM components. Authors can switch between styles available as components through an action in the toolbar, and preview the changes before the drop-down is even closed.</p><p>Here’s a simple example to show how it works. Authors use images for different use cases like:</p><ul><li>Adding a hero image to make a great landing page</li><li>Using an image as a card to link to another experience</li><li>Identifying individuals is an avatar or other user-generated images</li><li>Representing an event with a snapshot</li><li>Illustrating product functionality with product images</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*ThJ7MsuPkv3dom6hT055Lg.jpeg" /><figcaption>One image component showing multiple visual variations</figcaption></figure><p>All these images have different visual requirements and, as a developer, if you are not using the AEM style system you may end up creating separate, duplicate components or doing lots of backend development for each requirement.</p><p>Now let’s see how we can create just one image component to use in different scenarios.</p><h3><strong>Personas</strong></h3><p>The following user types would benefit from and interact with the image component in different ways.</p><ul><li><strong>Developer:</strong> Creating a component and adding CSS or LESS code</li><li><strong>Template author:</strong> Configuring component to allow visual variations to be used by authors</li><li><strong>Author: </strong>Using component and available visual variations.</li></ul><h3><strong>Requirements</strong></h3><ul><li>AEM 6.4 or AEM 6.3 with Service Pack 2</li><li>Core Components v2 (<em>Core components v2 are enabled with style tab in design dialog by default. If you are creating your component from scratch, you will need to create style tab in the design dialog.</em>)</li></ul><h3>Steps: Developer</h3><p>In this demo, we will be using we.retail sample site and adding styles to the image component.</p><ol><li>Go to <strong>/apps/weretail/components/content/image</strong>. This component is a proxy component of <strong>/apps/core/wcm/components/image/v2/image.</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*PChSzVlmhH7nivhcNjk6zw.jpeg" /></figure><p>2. Here let’s review the image core component as well. The design dialog of this component contains a style tab . If you are creating a new component from scratch you can copy this style tab and add it your own design dialog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dG5mUmgKu7ABEEhTV2z6ug.jpeg" /></figure><p>3. Go to <strong>/apps/weretail/components/content/image </strong>and create a client library to contain CSS of all required visual variations.</p><ul><li>3.1. Create node of Type<strong> cq:clientLibraryFolder , </strong>Name<strong> clientlibs</strong></li><li>3.2. Add property</li><li><strong>categories | String [] | we.retail.components.base, we-retail.components.style.image</strong></li><li>3.3 Create two files, css.txt and image.less</li><li>3.4 Open css.txt in CRXDe and add image.less as code. Save All.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*VKSnJpuFteaW0Jdqa6P7Ag.jpeg" /></figure><p>4. Now we need to add CSS code as per our style requirements. The following is syntax for creating the css/less file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6ab04776715a41805d86934626a62bbc/href">https://medium.com/media/6ab04776715a41805d86934626a62bbc/href</a></iframe><p>4.1 Copy the following code and paste in image.less file in client library folder .</p><p><em>Note: For the sake of simplicity, we have used CSS in this demo. You can use LESS as well.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/17187c6e0166218a386cb80731e12e41/href">https://medium.com/media/17187c6e0166218a386cb80731e12e41/href</a></iframe><h3>Steps: Template author</h3><p>The style defined by the developer is not available to the author directly. The template author needs to add style classnames to the policy of the component.</p><ol><li>Go to <strong>AEM &gt; Tools &gt; General &gt; Templates &gt; We.Retail</strong></li><li>Edit <strong>Content Page</strong> template.</li><li>Select <strong>policy</strong> icon of image component &gt; Select <strong>Styles</strong> tab in <strong>Properties</strong> section.</li><li>In <strong>Default CSS Classes </strong>text field, provide the default style class name without the dot (e.g., cardLayout)</li><li>Click the <strong>Add</strong> button to create two groups: Layout and Text</li><li>In the <strong>Layout</strong> group, add three styles and provide class name</li><li>In the <strong>Text</strong> group, add one style and provide class name.</li></ol><p>Refer to following the screenshot to review, and then click done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*t2Xv_uMvAn3mvPhgusF99A.jpeg" /></figure><h3>Steps: Author</h3><ol><li>Create a page using <strong>Content Page</strong> template in We.Retail Site.</li><li>Add a few image components to the page. Add images and edit captions by configuring the component.</li><li>Select the image component. Now you should see a paint brush icon that lists all the styles.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*OjWZCabdbrwna1i3BKMOag.jpeg" /><figcaption>Style Icon ( Paint Brush )</figcaption></figure><p>4. Now you can toggle your image to be a hero image, a simple card or a Polaroid image. You can also show or hide text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*bJjFykLyynPy2wAdcHwjZw.jpeg" /><figcaption>Images with different layouts</figcaption></figure><h3>Conclusion</h3><p>The AEM style system, when used in conjunction with the core components, the template editor, and the responsive layout, offers powerful capabilities to very flexibly compose rich experiences.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8177c5b65c9e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adobetech/using-aem-style-system-to-increase-reusability-of-components-8177c5b65c9e">Using the AEM Style System to Increase Reusability of Components</a> was originally published in <a href="https://medium.com/adobetech">Adobe Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>