inherit
236313
0
Sept 10, 2016 9:12:20 GMT -8
wubzer
1
August 2016
wubzer
|
Post by wubzer on Aug 25, 2016 16:31:07 GMT -8
While making my plugin I was wondering, how do I implement a Variable ID? I am using CSS and I am trying to implement a color picker. Thanks ahead of time for helping!
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,022
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 26, 2016 16:11:25 GMT -8
While making my plugin I was wondering, how do I implement a Variable ID? I am using CSS and I am trying to implement a color picker. Thanks ahead of time for helping! A CSS component won't be able to take a variable but if you instead use a header/footer component and add your CSS as HTML you can then include plugin variables that reflect choices the user has made in the plugin settings. This of course means you'll be adding weight to the page since it is loading as part of the forum's HTML instead of as a separate file and of course with no caching. example (in a header component): <!-- Here is the CSS for my plugin --> <style type="text/css"> .message .bar1{ background-color: $[plugin.settings.bar1_background_color]; color: $[plugin.settings.bar1_foreground_color]; } </style>
Edit: I should point out it is literally the "plugin" in $[plugin.settings.blah] that should be used and not some placeholder where you substitute $[mypluginID.settings.blah] since it occurred to me that I had assumed that was what was being implied when it was first explained to me.
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Aug 27, 2016 1:58:46 GMT -8
While making my plugin I was wondering, how do I implement a Variable ID? I am using CSS and I am trying to implement a color picker. Thanks ahead of time for helping! Why use an ID? If you are gonna set one up, you should know exactly what it is pertaining to. If you have lots of IDs maybe you could settle with a class instead and Add all the unique needed CSS in each element individually.
|
|