The package exports a set of CSS that can be imported in your app or serve as a reference for your own styles.
The PublicationGrid and StatefulLoader are not part of StatefulReader in practice, so their styles are exported in the misc package.
import "@edrlab/thorium-web/misc/styles";When using the StatefulReader component for EPUB, the styles are exported in the epub package.
Note
This stylesheet contains styles for html and body, as well as a necessary reset for buttons and inputs. Please bear in mind that it may override styles for these elements if the stylesheet is imported last in your page.
import "@edrlab/thorium-web/epub/styles";When using the StatefulPlayer component for audio, the styles are exported in the audio package.
import "@edrlab/thorium-web/audio/styles";When using the StatefulReader component for WebPub, the styles are exported in the webpub package.
Note
This stylesheet contains styles for html and body, as well as a necessary reset for buttons and inputs. Please bear in mind that it may override styles for these elements if the stylesheet is imported last in your page.
import "@edrlab/thorium-web/webpub/styles";Although easily importable, you can also copy the styles from:
dist/components/Audio/index.cssdist/components/Misc/index.cssdist/components/Epub/index.cssdist/components/WebPub/index.css
And customize them as needed.
The entire list of class names is available in the API docs.
Classes are following pattern thorium_web_ + module name + component name e.g. .thorium_web_button_icon, .thorium_web_overflow_menu, or .thorium_web_sheets_popover.
StatefulReader (Epub/WebPub) provides the following layouts and states:
.thorium_web_stackedUI/.thorium_web_layeredUI: the type of layout used, derived from preferencelayout.ui.thorium_web_isReflow/.thorium_web_isFXL: whether the EPUB reader is in reflow or fixed-layout mode.thorium_web_isScroll/.thorium_web_isPaged: whether the EPUB reader is in scroll or paged mode.thorium_web_isImmersive: whether immersive mode is enabled.thorium_web_isHovering: whether the top or bottom bars are being hovered.thorium_web_is{Breakpoint}: whether the reader is in a given breakpoint:.thorium_web_isCompact.thorium_web_isMedium.thorium_web_isExpanded.thorium_web_isLarge.thorium_web_isXLarge
.thorium_web_container_is{Breakpoint}: whether the publication’s container is in a given breakpoint:thorium_web_container_isCompactthorium_web_container_isMediumthorium_web_container_isExpandedthorium_web_container_isLargethorium_web_container_isXLarge
Note
StatefulPlayer (Audio) uses its own layout independent of StatefulReader. None of the above layout classes or states (thorium_web_stackedUI, thorium_web_layeredUI, thorium_web_isImmersive, thorium_web_isHovering, etc.) apply to the audio player. See Audio App Structure for audio-specific layout classes.
For components themselves, you can use the data attribute referenced in React Aria documentation e.g. [data-pressed], [data-hovered], [data-focus-visible], [data-disabled]
StatefulReader exposes the following custom properties for theming, layout, and other purposes.
--th-theme-background: The background color of the current theme--th-theme-text: The text color of the current theme--th-theme-link: The link color of the current theme--th-theme-visited: The visited link color of the current theme--th-theme-subdue: The subdue color of the current theme--th-theme-disable: The disable color of the current theme--th-theme-hover: The hover color of the current theme--th-theme-onHover: The on-hover color for text/icons of the current theme--th-theme-select: The select background color of the current theme--th-theme-onSelect: The on-select text color of the current theme--th-theme-focus: The focus outline color of the current theme--th-theme-elevate: The drop shadow color of the current theme--th-theme-immerse: The immersive mode opacity of the current theme
--th-layout-spacing: The spacing base for margins/paddings of the reader derived from preferences--th-layout-radius: The border-radius of icons, containers, etc. of the reader derived from preferences--th-icon-size: The size of icons in the reader derived from preferences--th-arrow-size: The size of navigation arrows derived from preferences--th-arrow-offset: The offset of navigation arrows derived from preferences--visual-viewport-height: The height of the visual viewport of the reader (provided by React Aria)
--th-sheet-sticky-header: The height of the sticky header of sheets--th-layout-constraints-popover: The max-width of popover sheets derived from preferences--th-layout-constraints-modal: The max-width of modal sheets derived from preferences--th-layout-constraints-bottomSheet: The max-width of draggable bottom sheets derived from preferences--th-layout-constraints-pagination: The max-width for pagination components derived from preferences--th-layout-defaults-scrim: The default scrim/underlay background-color of sheets derived from preferences