Skip to content

Commit 247025d

Browse files
authored
Merge pull request #302 from wpmudev/docs/tag
Docs/tag
2 parents 3519dba + ed28878 commit 247025d

File tree

1 file changed

+72
-1
lines changed

1 file changed

+72
-1
lines changed

packages/ui/tag/stories/tabs/TabCode.mdx

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Section, Row, Col, Table, List, Code, Tag, PackageInstallGuide, PropSection, CommonPropsNotice } from '@wpmudev/sui-docs';
1+
import { Section, Row, Col, Table, List, Code, Tag, PackageInstallGuide, PropSection, CommonPropsNotice, Snippet } from '@wpmudev/sui-docs';
22

33
<PackageInstallGuide packageName="@wpmudev/sui-tag" />
44

@@ -64,4 +64,75 @@ import { Section, Row, Col, Table, List, Code, Tag, PackageInstallGuide, PropSec
6464

6565
</Section>
6666

67+
<Section title="Function to add tags in plugin menu." border={true}>
68+
<p>Use this function to use tags in plugin menu.</p>
69+
<List>
70+
<span label={"Replace plugin_id with the unique id of the plugin in the body tag."} />
71+
<span label={<><Code small={true}>li:nth-child(3)</Code> the number should be the item number in the list which to target. </>} />
72+
</List>
73+
<Snippet language="console" hideToggle={true}>
74+
{`<?php
75+
public function print_menu_styles() {
76+
?>
77+
<style>
78+
#adminmenu #plugin_id li span.menu-tag {
79+
background-color: #737373;
80+
border-radius: 12px;
81+
color: #ffffff;
82+
font-size: 10px;
83+
font-style: normal;
84+
font-weight: 700;
85+
height: 16px;
86+
letter-spacing: -0.1px;
87+
line-height: 12px;
88+
padding: 2px 8px;
89+
text-align: center;
90+
width: 38px;
91+
}
92+
93+
#adminmenu #plugin_id li span.menu-tag.menu-tag--green {
94+
background-color: #138639;
95+
}
96+
97+
#adminmenu #plugin_id li span.menu-tag.menu-tag--blue {
98+
background-color: #0059ff;
99+
}
100+
101+
#adminmenu #plugin_id li span.menu-tag.menu-tag--navy {
102+
background-color: #0045c4;
103+
}
104+
105+
#adminmenu #plugin_id li span.menu-tag.menu-tag--yellow {
106+
background-color: #ffcc20;
107+
color: #1a1a1a;
108+
}
109+
110+
#adminmenu #plugin_id li span.menu-tag.menu-tag--red {
111+
background-color: #f45c59;
112+
}
113+
114+
#adminmenu #plugin_id li span.menu-tag.menu-tag--black {
115+
background-color: #1a1a1a;
116+
}
117+
118+
#adminmenu #plugin_id li span.menu-tag.menu-tag--white {
119+
background-color: #ffffff;
120+
color: #1a1a1a;
121+
}
122+
123+
#adminmenu #plugin_id ul.wp-submenu li:nth-child(3) a {
124+
color: #138639;
125+
}
126+
</style>
127+
<?php
128+
}
129+
?>`}
130+
</Snippet>
131+
<Snippet language="php" hideToggle={true}>
132+
{`public static function get_menu_title() {
133+
return esc_html__( 'Reseller', 'thc' ) . '&nbsp;<span class="menu-tag menu-tag--green">' . esc_html__( 'NEW', 'plugin-name' ) . '</span>';
134+
}`}
135+
</Snippet>
136+
</Section>
137+
67138
<CommonPropsNotice />

0 commit comments

Comments
 (0)