Changeset 3480456
- Timestamp:
- 03/11/2026 05:29:05 PM (2 weeks ago)
- Location:
- hero-color-picker
- Files:
-
- 8 edited
- 1 copied
-
tags/1.0.12 (copied) (copied from hero-color-picker/trunk)
-
tags/1.0.12/build/index.asset.php (modified) (1 diff)
-
tags/1.0.12/build/index.js (modified) (1 diff)
-
tags/1.0.12/hero-color-picker.php (modified) (1 diff)
-
tags/1.0.12/readme.txt (modified) (3 diffs)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (1 diff)
-
trunk/hero-color-picker.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hero-color-picker/tags/1.0.12/build/index.asset.php
r3477790 r3480456 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-data', 'wp-editor', 'wp-i18n', 'wp-plugins'), 'version' => ' 739b140a54442486d5ba');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-data', 'wp-editor', 'wp-i18n', 'wp-plugins'), 'version' => '9e9518b9b8bbc11cc155'); -
hero-color-picker/tags/1.0.12/build/index.js
r3477790 r3480456 1 (()=>{"use strict";const e=window.wp.plugins,o=window.wp.editor,r=window.wp.i18n,t=window.wp.components,n=window.wp.data,i=window.ReactJSXRuntime,l="hero_color_picker_hero_color",s="hero_color_picker_font_color",{useEffect:c}=window.wp.element;function a(e,o){"undefined"!=typeof document&&document.querySelectorAll(".editor-post-summary").forEach(r=>{e?r.style.setProperty("background-color",e,"important"):r.style.removeProperty("background-color"),o?r.style.setProperty("color",o,"important"):r.style.removeProperty("color")})}function d(e){"undefined"!=typeof document&&document.querySelectorAll(".editor-post-featured-image__preview").forEach(o=>{e?o.style.setProperty("outline","none","important"):o.style.removeProperty("outline")})}function p(e){if("string"!=typeof e)return null;const o=e.trim().replace("#",""),r=3===o.length?o.split("").map(e=>e+e).join(""):o;return/^[0-9a-fA-F]{6}$/.test(r)?{r:parseInt(r.slice(0,2),16),g:parseInt(r.slice(2,4),16),b:parseInt(r.slice(4,6),16)}:null}function u(e){const o=e/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4}function h(e){return.2126*u(e.r)+.7152*u(e.g)+.0722*u(e.b)}function m({label:e,value:o,onChange:n,onReset:l,resetText:s}){return(0,i.jsxs)("div",{style:{marginBottom:16},children:[(0,i.jsx)("div",{style:{marginBottom:8},children:e}),(0,i.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,i.jsx)(t.Dropdown,{popoverProps:{placement:"left-start"},renderToggle:({isOpen:e,onToggle:n})=>(0,i.jsxs)(t.Button,{variant:"secondary",onClick:n,"aria-expanded":e,style:{flex:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,i.jsx)("span",{children:o||(0,r.__)("Select color","hero-color-picker")}),(0,i.jsx)("span",{"aria-hidden":!0,style:{display:"inline-block",marginLeft:8,width:14,height:14,borderRadius:2,border:"1px solid #ccc",backgroundColor:o||"transparent"}})]}),renderContent:()=>(0,i.jsx)("div",{style:{padding:8},children:(0,i.jsx)(t.ColorPicker,{color:o||"#111111",enableAlpha:!1,onChange:n})})}),(0,i.jsx)(t.Button,{variant:"secondary",isDestructive:!0,onClick:l,disabled:!o,children:s})]})]})}(0,e.registerPlugin)("hero-color-picker",{render:function(){const{meta:e,postType:u}=(0,n.useSelect)(e=>{const o=e("core/editor");return{meta:o.getEditedPostAttribute("meta")||{},postType:o.getCurrentPostType()}},[]),{editPost:g}=(0,n.useDispatch)("core/editor"),y=e[l]||"",x=e[s]||"",f=function(e,o){const r=p(e),t=p(o);if(!r||!t)return null;const n=h(r),i=h(t);return(Math.max(n,i)+.05)/(Math.min(n,i)+.05)}(x,y),_=Boolean(y&&x),k=_&&null!==f&&f>=7;let w=(0,r.__)("Not applicable","hero-color-picker"),j="info";return _&&(k?(w=(0,r.__)("PASS","hero-color-picker"),j="success"):(w=(0,r.__)("FAILED","hero-color-picker"),j="error")),c(()=>{if("post"!==u)return a("",""),void d("");a(y,x),d(y)},[y,x,u]),c(()=>()=>{a("",""),d("")},[]),"post"!==u?null:(0,i.jsx)(o.PluginDocumentSettingPanel,{name:"hero-color-picker",title:"Hero Color Picker",className:"hero-color",children:(0,i.jsx)(t.PanelRow,{children:(0,i.jsxs)("div",{style:{width:"100%"},children:[(0,i.jsx)(m,{label:(0,r.__)("Background Color","hero-color-picker"),value:y,onChange:o=>{g({meta:{...e,[l]:o}})},onReset:()=>{g({meta:{...e,[l]:""}})},resetText:(0,r.__)("Unset","hero-color-picker")}),(0,i.jsx)(m,{label:(0,r.__)("Font Color","hero-color-picker"),value:x,onChange:o=>{g({meta:{...e,[s]:o}})},onReset:()=>{g({meta:{...e,[s]:""}})},resetText:(0,r.__)("Unset","hero-color-picker")}),(0,i.jsxs)("div",{style:{padding:10,borderRadius:4,border:"1px solid #dcdcde",backgroundColor:y||"#f0f0f1",color:x||"#1e1e1e",marginBottom:10},children:[(0,i.jsx)("strong",{children:(0,r.__)("Preview","hero-color-picker")}),(0,i.jsx)("p",{style:{margin:"6px 0 0"},children:(0,r.__)("This is how background and font color look together.","hero-color-picker")})]}),(0,i.jsxs)(t.BaseControl,{id:"hero-color-picker-contrast-check",label:(0,r.__)("Contrast Check","hero-color-picker"),children:[(0,i.jsx)(t.Notice,{status:j,isDismissible:!1,style:{margin:"6px 0 0"},children:(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8,width:"100%"},children:[(0,i.jsx)("strong",{children:w}),null!==f?(0,i.jsx)("span",{children:"("+f.toFixed(2)+":1)"}):null]})}),(0,i.jsx)("p",{style:{margin:"10px 0 0",color:"#50575e"},children:(0,r.__)("WCAG AAA, normal text, minimum ratio 7:1.","hero-color-picker")})]})]})})})}})})();1 (()=>{"use strict";const e=window.wp.plugins,o=window.wp.editor,r=window.wp.i18n,t=window.wp.components,n=window.wp.data,i=window.ReactJSXRuntime,l="hero_color_picker_hero_color",s="hero_color_picker_font_color",{useEffect:c}=window.wp.element;function a(e,o){"undefined"!=typeof document&&document.querySelectorAll(".editor-post-summary").forEach(r=>{e?r.style.setProperty("background-color",e,"important"):r.style.removeProperty("background-color"),o?r.style.setProperty("color",o,"important"):r.style.removeProperty("color")})}function d(e){"undefined"!=typeof document&&document.querySelectorAll(".editor-post-featured-image__preview").forEach(o=>{e?o.style.setProperty("outline","none","important"):o.style.removeProperty("outline")})}function p(e){if("string"!=typeof e)return null;const o=e.trim().replace("#",""),r=3===o.length?o.split("").map(e=>e+e).join(""):o;return/^[0-9a-fA-F]{6}$/.test(r)?{r:parseInt(r.slice(0,2),16),g:parseInt(r.slice(2,4),16),b:parseInt(r.slice(4,6),16)}:null}function h(e){const o=e/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4}function u(e){return.2126*h(e.r)+.7152*h(e.g)+.0722*h(e.b)}function m({label:e,value:o,onChange:n,onReset:l,resetText:s}){return(0,i.jsxs)("div",{style:{marginBottom:16},children:[(0,i.jsx)("div",{style:{marginBottom:8},children:e}),(0,i.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,i.jsx)(t.Dropdown,{popoverProps:{placement:"left-start"},renderToggle:({isOpen:e,onToggle:n})=>(0,i.jsxs)(t.Button,{variant:"secondary",onClick:n,"aria-expanded":e,style:{flex:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,i.jsx)("span",{children:o||(0,r.__)("Select color","hero-color-picker")}),(0,i.jsx)("span",{"aria-hidden":!0,style:{display:"inline-block",marginLeft:8,width:14,height:14,borderRadius:2,border:"1px solid #ccc",backgroundColor:o||"transparent"}})]}),renderContent:()=>(0,i.jsx)("div",{style:{padding:8},children:(0,i.jsx)(t.ColorPicker,{color:o||"#111111",enableAlpha:!1,onChange:n})})}),(0,i.jsx)(t.Button,{variant:"secondary",isDestructive:!0,onClick:l,disabled:!o,children:s})]})]})}(0,e.registerPlugin)("hero-color-picker",{render:function(){const{meta:e,postType:h}=(0,n.useSelect)(e=>{const o=e("core/editor");return{meta:o.getEditedPostAttribute("meta")||{},postType:o.getCurrentPostType()}},[]),{editPost:g}=(0,n.useDispatch)("core/editor"),x=e[l]||"",y=e[s]||"",f=function(e,o){const r=p(e),t=p(o);if(!r||!t)return null;const n=u(r),i=u(t);return(Math.max(n,i)+.05)/(Math.min(n,i)+.05)}(y,x),_=Boolean(x&&y),k=_&&null!==f&&f>=7;let w=(0,r.__)("Not applicable","hero-color-picker"),j="info";return _&&(k?(w=(0,r.__)("PASS","hero-color-picker"),j="success"):(w=(0,r.__)("FAILED","hero-color-picker"),j="error")),c(()=>{if("post"!==h)return a("",""),void d("");a(x,y),d(x)},[x,y,h]),c(()=>()=>{a("",""),d("")},[]),"post"!==h?null:(0,i.jsx)(o.PluginDocumentSettingPanel,{name:"hero-color-picker",title:"Hero Color Picker",className:"hero-color",children:(0,i.jsx)(t.PanelRow,{children:(0,i.jsxs)("div",{style:{width:"100%"},children:[(0,i.jsx)(m,{label:(0,r.__)("Background Color","hero-color-picker"),value:x,onChange:o=>{g({meta:{...e,[l]:o}})},onReset:()=>{g({meta:{...e,[l]:""}})},resetText:(0,r.__)("Unset","hero-color-picker")}),(0,i.jsx)(m,{label:(0,r.__)("Font Color","hero-color-picker"),value:y,onChange:o=>{g({meta:{...e,[s]:o}})},onReset:()=>{g({meta:{...e,[s]:""}})},resetText:(0,r.__)("Unset","hero-color-picker")}),(0,i.jsxs)("div",{style:{padding:10,borderRadius:4,border:"1px solid #dcdcde",backgroundColor:x||"#f0f0f1",color:y||"#1e1e1e",marginBottom:10},children:[(0,i.jsx)("strong",{children:(0,r.__)("Preview","hero-color-picker")}),(0,i.jsx)("p",{style:{margin:"6px 0 0"},children:(0,r.__)("This is how background and font color look together.","hero-color-picker")})]}),(0,i.jsxs)(t.BaseControl,{id:"hero-color-picker-contrast-check",label:(0,r.__)("Contrast Check","hero-color-picker"),children:[(0,i.jsx)(t.Notice,{status:j,isDismissible:!1,style:{margin:"6px 0 0"},children:(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8,width:"100%"},children:[(0,i.jsx)("strong",{children:w}),null!==f?(0,i.jsx)("span",{children:"("+f.toFixed(2)+":1)"}):null]})}),(0,i.jsx)("p",{style:{margin:"10px 0 0",color:"#50575e"},children:(0,r.__)("WCAG AAA, normal text, minimum ratio 7:1.","hero-color-picker")})]}),(0,i.jsx)(t.Notice,{status:"info",isDismissible:!1,style:{margin:"12px 0 0"},children:(0,i.jsx)("p",{style:{margin:0},children:(0,i.jsx)(t.ExternalLink,{href:"https://wordpress.org/plugins/hero-color-picker/",children:(0,r.__)("Colors not showing on frontend? Read the FAQ.","hero-color-picker")})})})]})})})}})})(); -
hero-color-picker/tags/1.0.12/hero-color-picker.php
r3478440 r3480456 4 4 * Plugin URI: https://github.com/mtoensing/hero-color-picker 5 5 * Description: Adds a per-post color picker in the editor sidebar for hero styling. 6 * Version: 1.0.1 16 * Version: 1.0.12 7 7 * Author: Marc Tönsing 8 8 * Author URI: https://toensing.com -
hero-color-picker/tags/1.0.12/readme.txt
r3478440 r3480456 4 4 Requires at least: 5.9 5 5 Tested up to: 6.9 6 Stable tag: 1.0.1 16 Stable tag: 1.0.12 7 7 Requires PHP: 7.3 8 8 License: GPLv2 or later … … 51 51 5. Optional: open `Posts > All Posts` and click `Hero Background` to list posts with a custom hero background. 52 52 53 == Frequently Asked Questions == 54 55 = How do I add the `hero-colored` CSS class in templates? = 56 57 1. Go to `Appearance > Editor` and open the template you use for posts (for example `Single`). 58 2. Select the block that should receive the hero styles (usually a wrapping `Group` block). 59 3. Open block settings, expand `Advanced`, and enter `hero-colored` in `Additional CSS class(es)`. 60 4. Save the template. 61 53 62 == Screenshots == 54 63 … … 56 65 57 66 == Changelog == 67 68 = 1.0.12 = 69 * Added an editor FAQ link for frontend setup troubleshooting. 70 * Expanded the WordPress.org FAQ with template setup instructions. 58 71 59 72 = 1.0.11 = -
hero-color-picker/trunk/build/index.asset.php
r3477790 r3480456 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-data', 'wp-editor', 'wp-i18n', 'wp-plugins'), 'version' => ' 739b140a54442486d5ba');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-data', 'wp-editor', 'wp-i18n', 'wp-plugins'), 'version' => '9e9518b9b8bbc11cc155'); -
hero-color-picker/trunk/build/index.js
r3477790 r3480456 1 (()=>{"use strict";const e=window.wp.plugins,o=window.wp.editor,r=window.wp.i18n,t=window.wp.components,n=window.wp.data,i=window.ReactJSXRuntime,l="hero_color_picker_hero_color",s="hero_color_picker_font_color",{useEffect:c}=window.wp.element;function a(e,o){"undefined"!=typeof document&&document.querySelectorAll(".editor-post-summary").forEach(r=>{e?r.style.setProperty("background-color",e,"important"):r.style.removeProperty("background-color"),o?r.style.setProperty("color",o,"important"):r.style.removeProperty("color")})}function d(e){"undefined"!=typeof document&&document.querySelectorAll(".editor-post-featured-image__preview").forEach(o=>{e?o.style.setProperty("outline","none","important"):o.style.removeProperty("outline")})}function p(e){if("string"!=typeof e)return null;const o=e.trim().replace("#",""),r=3===o.length?o.split("").map(e=>e+e).join(""):o;return/^[0-9a-fA-F]{6}$/.test(r)?{r:parseInt(r.slice(0,2),16),g:parseInt(r.slice(2,4),16),b:parseInt(r.slice(4,6),16)}:null}function u(e){const o=e/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4}function h(e){return.2126*u(e.r)+.7152*u(e.g)+.0722*u(e.b)}function m({label:e,value:o,onChange:n,onReset:l,resetText:s}){return(0,i.jsxs)("div",{style:{marginBottom:16},children:[(0,i.jsx)("div",{style:{marginBottom:8},children:e}),(0,i.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,i.jsx)(t.Dropdown,{popoverProps:{placement:"left-start"},renderToggle:({isOpen:e,onToggle:n})=>(0,i.jsxs)(t.Button,{variant:"secondary",onClick:n,"aria-expanded":e,style:{flex:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,i.jsx)("span",{children:o||(0,r.__)("Select color","hero-color-picker")}),(0,i.jsx)("span",{"aria-hidden":!0,style:{display:"inline-block",marginLeft:8,width:14,height:14,borderRadius:2,border:"1px solid #ccc",backgroundColor:o||"transparent"}})]}),renderContent:()=>(0,i.jsx)("div",{style:{padding:8},children:(0,i.jsx)(t.ColorPicker,{color:o||"#111111",enableAlpha:!1,onChange:n})})}),(0,i.jsx)(t.Button,{variant:"secondary",isDestructive:!0,onClick:l,disabled:!o,children:s})]})]})}(0,e.registerPlugin)("hero-color-picker",{render:function(){const{meta:e,postType:u}=(0,n.useSelect)(e=>{const o=e("core/editor");return{meta:o.getEditedPostAttribute("meta")||{},postType:o.getCurrentPostType()}},[]),{editPost:g}=(0,n.useDispatch)("core/editor"),y=e[l]||"",x=e[s]||"",f=function(e,o){const r=p(e),t=p(o);if(!r||!t)return null;const n=h(r),i=h(t);return(Math.max(n,i)+.05)/(Math.min(n,i)+.05)}(x,y),_=Boolean(y&&x),k=_&&null!==f&&f>=7;let w=(0,r.__)("Not applicable","hero-color-picker"),j="info";return _&&(k?(w=(0,r.__)("PASS","hero-color-picker"),j="success"):(w=(0,r.__)("FAILED","hero-color-picker"),j="error")),c(()=>{if("post"!==u)return a("",""),void d("");a(y,x),d(y)},[y,x,u]),c(()=>()=>{a("",""),d("")},[]),"post"!==u?null:(0,i.jsx)(o.PluginDocumentSettingPanel,{name:"hero-color-picker",title:"Hero Color Picker",className:"hero-color",children:(0,i.jsx)(t.PanelRow,{children:(0,i.jsxs)("div",{style:{width:"100%"},children:[(0,i.jsx)(m,{label:(0,r.__)("Background Color","hero-color-picker"),value:y,onChange:o=>{g({meta:{...e,[l]:o}})},onReset:()=>{g({meta:{...e,[l]:""}})},resetText:(0,r.__)("Unset","hero-color-picker")}),(0,i.jsx)(m,{label:(0,r.__)("Font Color","hero-color-picker"),value:x,onChange:o=>{g({meta:{...e,[s]:o}})},onReset:()=>{g({meta:{...e,[s]:""}})},resetText:(0,r.__)("Unset","hero-color-picker")}),(0,i.jsxs)("div",{style:{padding:10,borderRadius:4,border:"1px solid #dcdcde",backgroundColor:y||"#f0f0f1",color:x||"#1e1e1e",marginBottom:10},children:[(0,i.jsx)("strong",{children:(0,r.__)("Preview","hero-color-picker")}),(0,i.jsx)("p",{style:{margin:"6px 0 0"},children:(0,r.__)("This is how background and font color look together.","hero-color-picker")})]}),(0,i.jsxs)(t.BaseControl,{id:"hero-color-picker-contrast-check",label:(0,r.__)("Contrast Check","hero-color-picker"),children:[(0,i.jsx)(t.Notice,{status:j,isDismissible:!1,style:{margin:"6px 0 0"},children:(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8,width:"100%"},children:[(0,i.jsx)("strong",{children:w}),null!==f?(0,i.jsx)("span",{children:"("+f.toFixed(2)+":1)"}):null]})}),(0,i.jsx)("p",{style:{margin:"10px 0 0",color:"#50575e"},children:(0,r.__)("WCAG AAA, normal text, minimum ratio 7:1.","hero-color-picker")})]})]})})})}})})();1 (()=>{"use strict";const e=window.wp.plugins,o=window.wp.editor,r=window.wp.i18n,t=window.wp.components,n=window.wp.data,i=window.ReactJSXRuntime,l="hero_color_picker_hero_color",s="hero_color_picker_font_color",{useEffect:c}=window.wp.element;function a(e,o){"undefined"!=typeof document&&document.querySelectorAll(".editor-post-summary").forEach(r=>{e?r.style.setProperty("background-color",e,"important"):r.style.removeProperty("background-color"),o?r.style.setProperty("color",o,"important"):r.style.removeProperty("color")})}function d(e){"undefined"!=typeof document&&document.querySelectorAll(".editor-post-featured-image__preview").forEach(o=>{e?o.style.setProperty("outline","none","important"):o.style.removeProperty("outline")})}function p(e){if("string"!=typeof e)return null;const o=e.trim().replace("#",""),r=3===o.length?o.split("").map(e=>e+e).join(""):o;return/^[0-9a-fA-F]{6}$/.test(r)?{r:parseInt(r.slice(0,2),16),g:parseInt(r.slice(2,4),16),b:parseInt(r.slice(4,6),16)}:null}function h(e){const o=e/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4}function u(e){return.2126*h(e.r)+.7152*h(e.g)+.0722*h(e.b)}function m({label:e,value:o,onChange:n,onReset:l,resetText:s}){return(0,i.jsxs)("div",{style:{marginBottom:16},children:[(0,i.jsx)("div",{style:{marginBottom:8},children:e}),(0,i.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,i.jsx)(t.Dropdown,{popoverProps:{placement:"left-start"},renderToggle:({isOpen:e,onToggle:n})=>(0,i.jsxs)(t.Button,{variant:"secondary",onClick:n,"aria-expanded":e,style:{flex:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,i.jsx)("span",{children:o||(0,r.__)("Select color","hero-color-picker")}),(0,i.jsx)("span",{"aria-hidden":!0,style:{display:"inline-block",marginLeft:8,width:14,height:14,borderRadius:2,border:"1px solid #ccc",backgroundColor:o||"transparent"}})]}),renderContent:()=>(0,i.jsx)("div",{style:{padding:8},children:(0,i.jsx)(t.ColorPicker,{color:o||"#111111",enableAlpha:!1,onChange:n})})}),(0,i.jsx)(t.Button,{variant:"secondary",isDestructive:!0,onClick:l,disabled:!o,children:s})]})]})}(0,e.registerPlugin)("hero-color-picker",{render:function(){const{meta:e,postType:h}=(0,n.useSelect)(e=>{const o=e("core/editor");return{meta:o.getEditedPostAttribute("meta")||{},postType:o.getCurrentPostType()}},[]),{editPost:g}=(0,n.useDispatch)("core/editor"),x=e[l]||"",y=e[s]||"",f=function(e,o){const r=p(e),t=p(o);if(!r||!t)return null;const n=u(r),i=u(t);return(Math.max(n,i)+.05)/(Math.min(n,i)+.05)}(y,x),_=Boolean(x&&y),k=_&&null!==f&&f>=7;let w=(0,r.__)("Not applicable","hero-color-picker"),j="info";return _&&(k?(w=(0,r.__)("PASS","hero-color-picker"),j="success"):(w=(0,r.__)("FAILED","hero-color-picker"),j="error")),c(()=>{if("post"!==h)return a("",""),void d("");a(x,y),d(x)},[x,y,h]),c(()=>()=>{a("",""),d("")},[]),"post"!==h?null:(0,i.jsx)(o.PluginDocumentSettingPanel,{name:"hero-color-picker",title:"Hero Color Picker",className:"hero-color",children:(0,i.jsx)(t.PanelRow,{children:(0,i.jsxs)("div",{style:{width:"100%"},children:[(0,i.jsx)(m,{label:(0,r.__)("Background Color","hero-color-picker"),value:x,onChange:o=>{g({meta:{...e,[l]:o}})},onReset:()=>{g({meta:{...e,[l]:""}})},resetText:(0,r.__)("Unset","hero-color-picker")}),(0,i.jsx)(m,{label:(0,r.__)("Font Color","hero-color-picker"),value:y,onChange:o=>{g({meta:{...e,[s]:o}})},onReset:()=>{g({meta:{...e,[s]:""}})},resetText:(0,r.__)("Unset","hero-color-picker")}),(0,i.jsxs)("div",{style:{padding:10,borderRadius:4,border:"1px solid #dcdcde",backgroundColor:x||"#f0f0f1",color:y||"#1e1e1e",marginBottom:10},children:[(0,i.jsx)("strong",{children:(0,r.__)("Preview","hero-color-picker")}),(0,i.jsx)("p",{style:{margin:"6px 0 0"},children:(0,r.__)("This is how background and font color look together.","hero-color-picker")})]}),(0,i.jsxs)(t.BaseControl,{id:"hero-color-picker-contrast-check",label:(0,r.__)("Contrast Check","hero-color-picker"),children:[(0,i.jsx)(t.Notice,{status:j,isDismissible:!1,style:{margin:"6px 0 0"},children:(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8,width:"100%"},children:[(0,i.jsx)("strong",{children:w}),null!==f?(0,i.jsx)("span",{children:"("+f.toFixed(2)+":1)"}):null]})}),(0,i.jsx)("p",{style:{margin:"10px 0 0",color:"#50575e"},children:(0,r.__)("WCAG AAA, normal text, minimum ratio 7:1.","hero-color-picker")})]}),(0,i.jsx)(t.Notice,{status:"info",isDismissible:!1,style:{margin:"12px 0 0"},children:(0,i.jsx)("p",{style:{margin:0},children:(0,i.jsx)(t.ExternalLink,{href:"https://wordpress.org/plugins/hero-color-picker/",children:(0,r.__)("Colors not showing on frontend? Read the FAQ.","hero-color-picker")})})})]})})})}})})(); -
hero-color-picker/trunk/hero-color-picker.php
r3478440 r3480456 4 4 * Plugin URI: https://github.com/mtoensing/hero-color-picker 5 5 * Description: Adds a per-post color picker in the editor sidebar for hero styling. 6 * Version: 1.0.1 16 * Version: 1.0.12 7 7 * Author: Marc Tönsing 8 8 * Author URI: https://toensing.com -
hero-color-picker/trunk/readme.txt
r3478440 r3480456 4 4 Requires at least: 5.9 5 5 Tested up to: 6.9 6 Stable tag: 1.0.1 16 Stable tag: 1.0.12 7 7 Requires PHP: 7.3 8 8 License: GPLv2 or later … … 51 51 5. Optional: open `Posts > All Posts` and click `Hero Background` to list posts with a custom hero background. 52 52 53 == Frequently Asked Questions == 54 55 = How do I add the `hero-colored` CSS class in templates? = 56 57 1. Go to `Appearance > Editor` and open the template you use for posts (for example `Single`). 58 2. Select the block that should receive the hero styles (usually a wrapping `Group` block). 59 3. Open block settings, expand `Advanced`, and enter `hero-colored` in `Additional CSS class(es)`. 60 4. Save the template. 61 53 62 == Screenshots == 54 63 … … 56 65 57 66 == Changelog == 67 68 = 1.0.12 = 69 * Added an editor FAQ link for frontend setup troubleshooting. 70 * Expanded the WordPress.org FAQ with template setup instructions. 58 71 59 72 = 1.0.11 =
Note: See TracChangeset
for help on using the changeset viewer.