{"id":6140,"date":"2024-04-14T14:00:32","date_gmt":"2024-04-14T06:00:32","guid":{"rendered":"https:\/\/webflow.tenten.co\/?p=6140"},"modified":"2024-04-14T14:00:32","modified_gmt":"2024-04-14T06:00:32","slug":"custom-properties","status":"publish","type":"post","link":"https:\/\/webflow.tenten.co\/en\/custom-properties\/","title":{"rendered":"Custom properties"},"content":{"rendered":"\n<div class=\"docs_rich-text w-richtext\">\n<p>HTML properties define attributes (i.e., the behavior or look) of an HTML element. For instance, <code>category<\/code> is an HTML trait that provides a method to classify similar elements, and is employed with CSS to include styles to elements that share that category. <code>url<\/code> is another HTML trait that specifies a link\u2019s target URL.<\/p>\n<p>You can produce some HTML properties using native Webflow elements, styles, and configurations (e.g., links, categories, ids, etc.). You can develop others using <strong>custom properties<\/strong>, which are beneficial for a variety of purposes \u2014 building tooltips, boosting your site\u2019s accessibility with ARIA characteristics, expanding custom code and page styling capabilities with CMS data, and more.<\/p>\n<p>Throughout this tutorial, you will understand:<\/p>\n<ol start=\"1\" role=\"list\">\n<li>How to craft custom properties<\/li>\n<li>How to utilize CMS data in custom properties<\/li>\n<li>How to utilize component features in custom properties<\/li>\n<li>How to design components and CMS data with the category property<\/li>\n<li>How to control custom properties<\/li>\n<\/ol>\n<h6><strong>Remember: <\/strong>Some custom properties are reserved, as you are already able to generate them using native Webflow elements, styles, and configurations. For example, you can&#8217;t designate <code>url<\/code> as a custom property to an existing element to mimic a link, but you can define a link target URL on link elements using link settings.<\/h6>\n<h2>How to craft custom properties<\/h2>\n<p>To formulate a new custom property:<\/p>\n<ol start=\"1\" role=\"list\">\n<li>Select the element for which you wish to create a custom property<\/li>\n<li>Head over to <strong>Element settings panel<\/strong> &gt; <strong>Custom properties<\/strong><\/li>\n<li>Press the \u201c<strong>plus<\/strong>\u201d icon<\/li>\n<li>Enter the <strong>title<\/strong> of your custom property (e.g., <code>tooltip<\/code>, <code>aria-label<\/code>, etc.) along with its <strong>content<\/strong><\/li>\n<\/ol>\n<h6><strong>Pro tip: <\/strong>You can access a complete list of HTML attributes in the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Attributes\">Mozilla HTML attribute reference<\/a>.<\/h6>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div><img decoding=\"async\" src=\"https:\/\/webflow.tenten.co\/wp-content\/uploads\/2024\/04\/64b94a0b98510a9d2dee6a10_64270816eeb5d1296a2607e7__psriapasbdt5hobkw0x86u99f11hx6_uaaacgddg9-ekk3wmmsee8wvkr_73zafmioekd3ychxxp4eg6xy-d97qftd1xmaryhtbmrlaakmju6bmzfryn4tlpvuzf_evomozhizg_hdip4vw6r_pq7.png\" alt=\"A new custom property being created in the Custom properties section of the Element settings panel. Its title is \u201cidentifier\u201d and its content is \u201cI\u2019m a tooltip.\u201d\" title=\"64b94a0b98510a9d2dee6a10_64270816eeb5d1296a2607e7__psriapasbdt5hobkw0x86u99f11hx6_uaaacgddg9-ekk3wmmsee8wvkr_73zafmioekd3ychxxp4eg6xy-d97qftd1xmaryhtbmrlaakmju6bmzfryn4tlpvuzf_evomozhizg_hdip4vw6r_pq7\"><\/div>\n<\/figure>\n<h2>How to utilize CMS data in custom properties<\/h2>\n<p>You can link your CMS data to custom properties to form a connection between design, code, and dynamic data \u2014 and empower more strength and flexibility in your design. This enables you to manage integrations or widgets that utilize HTML data properties (e.g., maps or social widget previews), employ custom CSS to adjust page styling based on the value of a CMS field, enhance site accessibility by employing CMS data to populate ARIA properties, and more.<\/p>\n<blockquote><p><strong>Essential: <\/strong>You can exclusively link CMS data to custom properties on Collection pages or within Collection lists.<\/p><\/blockquote>\n<p>To link your CMS data to custom properties:<\/p>\n<ol start=\"1\" role=\"list\">\n<li>Select the element for which you want to craft a custom property<\/li>\n<li>Visit <strong>Element settings panel<\/strong> &gt; <strong>Custom properties<\/strong><\/li>\n<li>Click the \u201c<strong>plus<\/strong>\u201d icon<\/li>\n<li>Enter the <strong>title<\/strong> of your custom property (e.g., <code>tooltip<\/code>, <code>aria-label<\/code>, etc.)<\/li>\n<li>Click the violet \u201c<strong>dot<\/strong>\u201d icon in the <strong>content<\/strong> field<\/li>\n<li>Choose the Collection field you desire to link to your custom property<\/li>\n<\/ol>\n<h6><strong>Pro tip: <\/strong>You can also attach your CMS data to ID properties, which are handled separately from custom properties in the <strong>Element settings panel<\/strong>. This allows you to set up unique IDs to recognize specific CMS items, which you can utilize to target those items with custom code.<\/h6>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div><img decoding=\"async\" src=\"https:\/\/webflow.tenten.co\/wp-content\/uploads\/2024\/04\/64b94a0b98510a9d2dee6a15_64270816a8adac93b3338ec8_ozxdok5ufzmwtbm79atuzxw115qgscqiqt4czg4vczmgmkh7j5kox4kfyv-lf9m9vgehufdd0ilotod3pic_ppmtiyjmakxjy7d2b1yqrppq63waliakvzbzpnge-vfmw82-wn6gmm0uip7t0bl3tz\" alt=\"A new custom property is related to a \u201cName\u201d Collection field from a Collection named \u201cBlog posts.\u201d\" title=\"64b94a0b98510a9d2dee6a15_64270816a8adac93b3338ec8_ozxdok5ufzmwtbm79atuzxw115qgscqiqt4czg4vczmgmkh7j5kox4kfyv-lf9m9vgehufdd0ilotod3pic_ppmtiyjmakxjy7d2b1yqrppq63waliakvzbzpnge-vfmw82-wn6gmm0uip7t0bl3tz\"><\/div>\n<\/figure>\n<h2>How to utilize component attributes in custom properties<\/h2>\n<p>You can also relate custom properties to component attributes. These can be utilized, for example, to facilitate and regulate complex styling and CMS fields. Discover more about component attributes.<\/p>\n<p>To connect component attributes to custom properties:<\/p>\n<ol start=\"1\" role=\"list\">\n<li>Modify the primary component that embraces the element for which you want to craft a custom property<\/li>\n<li>Select the element for which you want to forge a custom property<\/li>\n<li>Go to <strong>Element settings panel<\/strong> &gt; <strong>Custom properties<\/strong><\/li>\n<li>Click the \u201c<strong>plus<\/strong>\u201d icon<\/li>\n<li>Enter the <strong>title<\/strong> of your custom property (e.g., <code>tooltip<\/code>, <code>aria-label<\/code>, etc.)<\/li>\n<li>Click the violet \u201c<strong>dot<\/strong>\u201d icon in the <strong>content<\/strong> field<\/li>\n<li>(Optional) Establish a new component attribute<\/li>\n<li>Choose the component attribute you want to link to your custom property<\/li>\n<\/ol>\n<figure class=\"w-richtext-align-fullwidth w-richtext-figure-type-image\">\n<div><img decoding=\"async\" src=\"https:\/\/webflow.tenten.co\/wp-content\/uploads\/2024\/04\/64b94a0b98510a9d2dee6a18_6427081653709218faf21848_iqtoqugoka6-tp8a2vqxvmf5mfqjca_vq1boiqwcksltltapdpbe8lqiiify-snlt3vm9xhbo202lgojbwayl76bie2w1unclgu87ootrqxifp-cgio1d1wyyibky2gmv-jmqcf_bfvgnjido6oww3\" title=\"64b94a0b98510a9d2dee6a18_6427081653709218faf21848_iqtoqugoka6-tp8a2vqxvmf5mfqjca_vq1boiqwcksltltapdpbe8lqiiify-snlt3vm9xhbo202lgojbwayl76bie2w1unclgu87ootrqxifp-cgio1d1wyyibky2gmv-jmqcf_bfvgnjido6oww3\"><\/div>\n<\/figure>\n<h2>How to design CMS data and components with the <code>category<\/code> attribute<\/h2>\n<p>You  can apply the <code>category<\/code> attribute to generate style variations on CMS data and components with custom code classes or classes you&#8217;ve established in Webflow (i.e., crafted in the Styling panel). For example, you could apply the <code>category<\/code> attribute to employ light and dark themes on card components throughout your site.<\/p>\n<h6><strong>Remember: <\/strong>The <code>category<\/code> attribute can solely be utilized with text-based CMS data and component attributes.<\/h6>\n<p>Note that the classes you devise in Webflow are lowercase and exclude spaces. For instance, if you generate a class in the Styling panel known as <code>my awesome class<\/code>, the derived class is <code>my-awesome-class<\/code> \u2014 thus to reference its styles in the <code>category<\/code> attribute, you would input <code>my-awesome-class<\/code>.<\/p>\n<p>Moreover, Webflow adds an underscore to single-letter classes produced in the Designer (e.g., a class named <code>c<\/code> turns into <code>_c<\/code>).<\/p>\n<blockquote><p><strong>Essential: <\/strong>The <strong>Style selectors panel<\/strong> doesn&#8217;t recognize any classes referenced on CMS data or component attributes. Before clearing out unused styles, make certain unused classes listedin the <strong>Panel of Style selectors<\/strong>, they are not utilized in any custom attributes on your website.  <\/p><\/blockquote>\n<h3>Data of Content Management System<\/h3>\n<p>To customize CMS data with the <code>class<\/code> attribute: <\/p>\n<ol start=\"1\" role=\"list\">\n<li>Choose the element for which you desire to generate a specialized attribute <\/li>\n<li>Head to <strong>Panel of Element settings<\/strong> &gt; <strong>Special attributes<\/strong><\/li>\n<li>Tap on the \u201c<strong>add<\/strong>\u201d symbol<\/li>\n<li>Insert <code>class<\/code> into the <strong>Identifier<\/strong> section<\/li>\n<li>Tap on the purple \u201c<strong>dot<\/strong>\u201d symbol within the <strong>Value<\/strong> section <\/li>\n<li>Select the Collection section which you desire to link to the <code>class<\/code> attribute<\/li>\n<\/ol>\n<h6><strong>Reminder: <\/strong>You are only able to associate CMS data with customized attributes on Collection pages or inside Collection lists.<\/h6>\n<h3>Elements<\/h3>\n<p>To customize components with the <code>class<\/code> attribute: <\/p>\n<ol start=\"1\" role=\"list\">\n<li>Edit the primary component that encompasses the element in which you want to include a <code>class<\/code> attribute<\/li>\n<li>Select the element where you wish to incorporate a <code>class<\/code> attribute<\/li>\n<li>Proceed to <strong>Panel of Element settings<\/strong> &gt; <strong>Special attributes<\/strong><\/li>\n<li>Tap on the \u201c<strong>add<\/strong>\u201d symbol<\/li>\n<li>Insert <code>class<\/code> into the <strong>Identifier<\/strong> section<\/li>\n<li>Tap on the purple \u201c<strong>dot<\/strong>\u201d symbol in the <strong>Value<\/strong> section <\/li>\n<li>(Optional) Form a fresh aspect of the component<\/li>\n<li>Select the feature of the component you wish to connect to the <code>class<\/code> attribute (e.g., \u201cTheme\u201d)<\/li>\n<\/ol>\n<p>After that, to apply styles to this element within a component instance: \u00a0<\/p>\n<ol start=\"1\" role=\"list\">\n<li>Select the component instance on the canvas<\/li>\n<li>Access the <strong>Panel of Props<\/strong><\/li>\n<li>Insert a class title (one you&#8217;ve specified in Webflow or in tailored code) as the content for the component feature attached to the <code>class<\/code> attribute (e.g., you could insert <code>dark<\/code> as the content for the \u201cTheme\u201d component feature) <\/li>\n<\/ol>\n<p>Explore further into component aspects.<\/p>\n<h2>Techniques to handle bespoke attributes <\/h2>\n<p>To amend a customized attribute: <\/p>\n<ol start=\"1\" role=\"list\">\n<li>Select the element where you need to revise a customized attribute<\/li>\n<li>Head to <strong>Panel of Element settings<\/strong> &gt; <strong>Special attributes<\/strong><\/li>\n<li>Tap on the customized attribute you wish to amend<\/li>\n<li>Renew the <strong>identifier<\/strong> and\/or <strong>contents<\/strong> of the customized attribute<\/li>\n<\/ol>\n<p>To erase a customized attribute: <\/p>\n<ol start=\"1\" role=\"list\">\n<li>Select the element where you seek to remove a customized attribute<\/li>\n<li>Access the <strong>Panel of Element settings<\/strong> &gt; <strong>Special attributes<\/strong><\/li>\n<li>Tap on the \u201c<strong>garbage bin<\/strong>\u201d symbol adjacent to the customized attribute you intend to erase<\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"Use custom attributes to define characteristics of an HTML element.","protected":false},"author":2,"featured_media":5249,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"csco_display_header_overlay":false,"csco_singular_sidebar":"","csco_page_header_type":"","footnotes":""},"categories":[290],"tags":[],"class_list":{"0":"post-6140","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-elements","8":"cs-entry"},"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/posts\/6140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/comments?post=6140"}],"version-history":[{"count":0,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/posts\/6140\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/media\/5164"}],"wp:attachment":[{"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/media?parent=6140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/categories?post=6140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webflow.tenten.co\/en\/wp-json\/wp\/v2\/tags?post=6140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}