Stylesheet

class Stylesheet(href: String = DEFAULT_HREF, css: String, id: String? = null) : Resource(source)

A CSS Resource. Sugar over the raw Resource constructor with the right media type, a sensible default href, and a css accessor.

Register on a Book with Book.addStylesheet to also have it auto-linked from every XHTML page at write time (via io.documentnode.epub4kmp.epub.StylesheetLinker).

Constructors

Link copied to clipboard
constructor(href: String = DEFAULT_HREF, css: String, id: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val css: String

The CSS source.

Link copied to clipboard
open var data: ByteArray?
Link copied to clipboard
var href: String?
Link copied to clipboard
var id: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val size: Long

Functions

Link copied to clipboard

Returns the resource's bytes decoded as a String using the resource's inputEncoding.

Link copied to clipboard
open fun bytes(): ByteArray

Returns the resource's bytes (loading them if lazy).

Link copied to clipboard
open fun close()

Tells this resource to release its cached data.

Link copied to clipboard
open fun source(): Source

Gets the contents of the Resource as an okio Source.