晓仙玄
小狐狸
小狐狸
  • UID46339
  • 注册日期2014-06-12
  • 最后登录2025-06-30
  • 发帖数89
  • 经验116枚
  • 威望0点
  • 贡献值94点
  • 好评度9点
  • 社区居民
  • 忠实会员
阅读:74回复:0

文本框 右键菜单 文字 添加图标

楼主#
更多 发布于:2025-06-18 02:14
/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/iconized_textbox_context_menu.css made available under Mozilla Public License v. 2.0
See the above repository for updates as well as full license text. */
 
/* Adds icons to menuitems in textbox context menus, such as urlbar and searchbar.
 * Note that this won't work if you have native context menus,
 * such as ones used on MacOS */
 
:where(.textbox-contextmenu > menu:not(.menu-iconic))::before,
:where(.textbox-contextmenu > menuitem:not(.menuitem-iconic))::before{
  display: flex;
  padding-inline-end: 8px;
  padding-top: 2px;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  content: url("chrome://browser/skin/tab.svg");
  -moz-context-properties: fill;
  fill: currentColor;
}
:where(.textbox-contextmenu > menu),
:where(.textbox-contextmenu > menuitem){
  padding-inline-start: 1em !important;
}
.textbox-contextmenu > menuitem[type="checkbox"]::before{
  content: url("chrome://devtools/skin/images/checkbox.svg");
}
.textbox-contextmenu > menuitem[type="checkbox"] > :is(.menu-iconic-left,.menu-icon){
  display: none;
}
.textbox-contextmenu > [data-l10n-id="text-action-undo"]::before,
.textbox-contextmenu > [data-l10n-id="text-action-redo"]::before{
  content: url("chrome://global/skin/icons/undo.svg");
}
.textbox-contextmenu > [data-l10n-id="text-action-redo"]::before{
  transform-box: content-box;
  transform: scaleX(-1);
}
.textbox-contextmenu > [data-l10n-id="text-action-copy"]::before{
  content: url("chrome://global/skin/icons/edit-copy.svg");
}
.textbox-contextmenu > [data-l10n-id="text-action-strip-on-share"]::before{
  content: url("chrome://devtools/skin/images/command-always-on-top-window.svg");
}
.textbox-contextmenu > [data-l10n-id="text-action-cut"]::before{
  content: url("chrome://browser/skin/edit-cut.svg");
}
.textbox-contextmenu > [data-l10n-id="text-action-paste"]::before{
  content: url("chrome://browser/skin/edit-paste.svg");
}
.textbox-contextmenu > #paste-and-go::before{
  content: url("chrome://browser/skin/edit-paste.svg");
}
.textbox-contextmenu > .searchbar-paste-and-search::before{
  content: url("chrome://global/skin/icons/search-glass.svg");
}
.textbox-contextmenu > [data-l10n-id="text-action-delete"]::before{
  content: url("chrome://global/skin/icons/delete.svg");
}
.textbox-contextmenu > [data-l10n-id="text-action-select-all"]::before{
  content: url("chrome://global/skin/reader/character-spacing-20.svg");
  transform: scale(0.85);
}

原链接:firefox-csshacks 文本框右键图标
为文本输入框的右键菜单文字添加图标
游客

返回顶部