{"id":33823,"date":"2019-03-01T10:58:49","date_gmt":"2019-03-01T10:58:49","guid":{"rendered":"http:\/\/getshortcodes.com\/?post_type=docs&#038;p=33823"},"modified":"2019-12-20T04:29:18","modified_gmt":"2019-12-20T04:29:18","slug":"how-to-use-custom-css-editor","status":"publish","type":"docs","link":"https:\/\/getshortcodes.com\/docs\/how-to-use-custom-css-editor\/","title":{"rendered":"How to use Custom CSS editor"},"content":{"rendered":"\n<p class=\"has-medium-font-size\">Shortcodes Ultimate plugin includes custom CSS editor, which you can use to easily change the appearance of shortcodes.<\/p>\n\n\n<p class=\"h2\">Table of contents<\/p>\n\n<ol><li><a href=\"#getting-started\">Getting started<\/a><\/li><li><a href=\"#find-correct-shortcode-selector\">Find correct shortcode selector<\/a><\/li><li><a href=\"#use-of-shortcode-custom-classes\">Use of shortcode custom classes<\/a><\/li><li><a href=\"#use-of-variables-in-the-editor\">Use of variables in the editor<\/a><\/li><\/ol><\/li><\/ol>\n\n\n<h2 class=\"wp-block-heading\" id=\"getting-started\">Getting started<\/h2>\n\n\n\n<p>Navigate to&nbsp;<em>Dashboard \u2192 Shortcodes \u2192 Settings<\/em>&nbsp;and find <em>Custom CSS code<\/em> field.<\/p>\n\n\n\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"742\" src=\"https:\/\/getshortcodes.com\/wp-content\/uploads\/2019\/12\/custom-css-editor.png\" alt=\"\" class=\"wp-image-35126\" srcset=\"https:\/\/getshortcodes.com\/wp-content\/uploads\/2019\/12\/custom-css-editor.png 960w, https:\/\/getshortcodes.com\/wp-content\/uploads\/2019\/12\/custom-css-editor-512x396.png 512w, https:\/\/getshortcodes.com\/wp-content\/uploads\/2019\/12\/custom-css-editor-128x99.png 128w, https:\/\/getshortcodes.com\/wp-content\/uploads\/2019\/12\/custom-css-editor-768x594.png 768w, https:\/\/getshortcodes.com\/wp-content\/uploads\/2019\/12\/custom-css-editor-80x62.png 80w, https:\/\/getshortcodes.com\/wp-content\/uploads\/2019\/12\/custom-css-editor-24x19.png 24w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><figcaption>Screenshot: Custom CSS code field<\/figcaption><\/figure>\n\n\n\n<p>Here you can start writing custom styles. Styles written in custom CSS editor will have priority and will override default styles of shortcodes. Some tips for writing custom CSS code are given below. Please read them to facilitate your work.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"find-correct-shortcode-selector\">Find correct shortcode selector<\/h2>\n\n\n\n<p>To change the appearance of some specific shortcode or its element, first, you should find the CSS class of this shortcode\/element. To do this you can use the inspector.<\/p>\n\n\n\n<p>Inspector is a developer&#8217;s tool provided with web-browsers, which allows seeing the source code of the page. Inspectors may look a bit different in different browsers, but the main function looks and works similarly.<\/p>\n\n\n\n<p>Open the inspector and press the &#8220;Find element&#8221; button. Click the required element on the page to see its selector. More information can be found in&nbsp;<a href=\"https:\/\/dailypost.wordpress.com\/2013\/07\/25\/css-selectors\/\">this article<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"use-of-shortcode-custom-classes\">Use of shortcode custom classes<\/h2>\n\n\n\n<p>When writing custom styles it is recommended to use additional CSS classes. The majority of plugin shortcodes allow using additional CSS classes. An additional CSS class can be added with the help of a special class attribute. The following shortcode should be inserted into post editor:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><div class=\"su-divider su-divider-style-default my-custom-divider\" style=\"margin:15px 0;border-width:3px;border-color:#999999\"><a href=\"#\" style=\"color:#999999\">Go to top<\/a><\/div><\/pre>\n\n\n\n<p>Now additional CSS class may be used to change the shortcode appearance. The next shortcode should be inserted into custom CSS editor:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.my-custom-divider {<br>  width: 50%;<br>}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"use-of-variables-in-the-editor\">Use of variables in the editor<\/h2>\n\n\n\n<p>The editor allows using some variables in CSS code. Variables can be used for the display of links on the code, e.g. links to background images or font files. Available variables are listed below.<\/p>\n\n\n\n<p><strong>%home_url%<\/strong><br>Description: link to the main page of the site.<br>Result:&nbsp;<em>http:\/\/example.com<\/em><\/p>\n\n\n\n<p><strong>%theme_url%<\/strong><br>Description: link to active theme folder.<br>Result:&nbsp;<em>http:\/\/example.com\/wp-content\/themes\/twentysixteen<\/em><\/p>\n\n\n\n<p><strong>%plugin_url%<\/strong><br>Description: link to the folder with Shortcodes Ultimate plugin.<br>Result:&nbsp;<em>http:\/\/example.com\/wp-content\/plugins\/shortcodes-ultimate<\/em><\/p>\n\n\n\n<p class=\"has-text-color has-background has-black-color has-light-background-color\">All links will be displayed without a trailing slash.<\/p>\n\n\n\n<p>Example of a variable used in CSS code:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.my-custom-spoiler .su-spoiler-title {<br>  background-image: url( '%theme_url%\/images\/custom-spoiler.png' );<br>}<\/pre>\n","protected":false},"featured_media":0,"template":"","docs_category":[23,20],"class_list":["post-33823","docs","type-docs","status-publish","hentry","docs_category-customization","docs_category-getting-started"],"_links":{"self":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs\/33823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/types\/docs"}],"wp:attachment":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/media?parent=33823"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs_category?post=33823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}