Commit c7835704 authored by Randall Leeds's avatar Randall Leeds

Restore PDF.js highlight color overrides

parent b1bedc79
...@@ -9,6 +9,9 @@ class PDF extends Annotator.Plugin ...@@ -9,6 +9,9 @@ class PDF extends Annotator.Plugin
documentPromise: null documentPromise: null
pluginInit: -> pluginInit: ->
viewer = PDFViewerApplication.pdfViewer.viewer
viewer.classList.add('has-transparent-text-layer')
if PDFViewerApplication.loading if PDFViewerApplication.loading
@documentLoaded = new Promise (resolve) -> @documentLoaded = new Promise (resolve) ->
finish = (evt) -> finish = (evt) ->
......
@import "../variables"; @import "../variables";
// Newer versions of PDFjs use apply a transparency to the textLayer element. // In order for our highlights to be visible we need to use solid colors.
// In order for our highlights to be visible we need to use solid colors. The #viewer.has-transparent-text-layer .textLayer {
// PDFjs plugin provides a compatibility class to the PDFjs container that opacity: 1;
// we can use to detect this. ::selection { background: rgba(0, 0, 255, .2); }
.has-transparent-text-layer { ::-moz-selection { background: rgba(0 , 0 , 255, .2); }
.annotator-highlights-always-on & .annotator-hl {
background: rgba($highlight-color, 1);
.annotator-hl {
background-color: rgba($highlight-color-second, 1);
}
.annotator-hl .annotator-hl {
background-color: rgba($highlight-color-third, 1);
}
}
.annotator-hl.annotator-hl-focused {
background-color: rgb(192, 236, 253);
.annotator-hl {
background-color: transparent !important;
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment