Skip to content

Instantly share code, notes, and snippets.

@rickychilcott
Created November 4, 2019 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rickychilcott/44baf8e6b90b5ef80d1612d7c5f5fdc8 to your computer and use it in GitHub Desktop.
Save rickychilcott/44baf8e6b90b5ef80d1612d7c5f5fdc8 to your computer and use it in GitHub Desktop.
Trix Editor and Font Awesome Pro Override
@mixin transparent {
color: transparent;
}
@mixin override-trix-icon($icon, $content) {
button.trix-button--icon-#{$icon} {
&::before {
content: $content;
}
}
}
trix-toolbar {
.trix-button-group {
button {
&::before {
background-image: none !important;
font-family: "Font Awesome 5 Pro";
font-weight: 900;
color: black;
}
}
&.trix-button-group--file-tools {
display: none;
}
@include override-trix-icon("bold", "\f032");
@include override-trix-icon("italic", "\f033");
@include override-trix-icon("link", "\f0c1");
@include override-trix-icon("strike", "\f0cc");
@include override-trix-icon("heading-1", "\f1dc");
@include override-trix-icon("quote", "\f10e");
@include override-trix-icon("code", "\f121");
@include override-trix-icon("bullet-list", "\f0ca");
@include override-trix-icon("number-list", "\f0cb");
@include override-trix-icon("decrease-nesting-level", "\f03b");
@include override-trix-icon("increase-nesting-level", "\f03c");
@include override-trix-icon("undo", "\f0e2");
@include override-trix-icon("redo", "\f01e");
}
.trix-button--icon {
text-indent: inherit;
@include transparent;
&.trix-active {
@include transparent;
}
}
.trix-button:disabled {
@include transparent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment