Quark #

Modules #

Quark v1.2.0 Documentation


Table of Contents

quark/css #

CSSNameExp #

  • @type CSSNameExp = ".className"

Interface: StyleSheet #

StyleSheet #

stylesheet.time? #

  • time?: number keyframe time or css transition time

stylesheet.curve? #

stylesheet.opacity? #

stylesheet.cursor? #

stylesheet.visible? #

stylesheet.receive? #

stylesheet.clip? #

stylesheet.align? #

stylesheet.width? #

stylesheet.height? #

stylesheet.minWidth? #

stylesheet.minHeight? #

stylesheet.maxWidth? #

stylesheet.maxHeight? #

stylesheet.margin? #

stylesheet.marginTop? #

stylesheet.marginRight? #

stylesheet.marginBottom? #

stylesheet.marginLeft? #

stylesheet.padding? #

stylesheet.paddingTop? #

stylesheet.paddingRight? #

stylesheet.paddingBottom? #

stylesheet.paddingLeft? #

stylesheet.borderRadius? #

stylesheet.borderRadiusLeftTop? #

  • borderRadiusLeftTop?: number

stylesheet.borderRadiusRightTop? #

  • borderRadiusRightTop?: number

stylesheet.borderRadiusRightBottom? #

  • borderRadiusRightBottom?: number

stylesheet.borderRadiusLeftBottom? #

  • borderRadiusLeftBottom?: number

stylesheet.border? #

stylesheet.borderTop? #

stylesheet.borderRight? #

stylesheet.borderBottom? #

stylesheet.borderLeft? #

stylesheet.borderWidth? #

stylesheet.borderColor? #

stylesheet.borderWidthTop? #

  • borderWidthTop?: number border width

stylesheet.borderWidthRight? #

stylesheet.borderWidthBottom? #

stylesheet.borderWidthLeft? #

stylesheet.borderColorTop? #

stylesheet.borderColorRight? #

stylesheet.borderColorBottom? #

stylesheet.borderColorLeft? #

stylesheet.backgroundColor? #

stylesheet.background? #

stylesheet.boxShadow? #

stylesheet.weight? #

stylesheet.direction? #

stylesheet.itemsAlign? #

stylesheet.crossAlign? #

stylesheet.wrap? #

stylesheet.wrapAlign? #

stylesheet.src? #

stylesheet.textAlign? #

stylesheet.textWeight? #

stylesheet.textSlant? #

stylesheet.textDecoration? #

stylesheet.textOverflow? #

stylesheet.textWhiteSpace? #

stylesheet.textWordBreak? #

stylesheet.textSize? #

stylesheet.textBackgroundColor? #

stylesheet.textColor? #

stylesheet.textLineHeight? #

stylesheet.textShadow? #

stylesheet.textFamily? #

stylesheet.security? #

stylesheet.readonly? #

stylesheet.type? #

stylesheet.returnType? #

stylesheet.placeholderColor? #

stylesheet.cursorColor? #

stylesheet.maxLength? #

stylesheet.placeholder? #

stylesheet.scrollbarColor? #

stylesheet.scrollbarWidth? #

stylesheet.scrollbarMargin? #

stylesheet.translate? #

stylesheet.scale? #

stylesheet.skew? #

stylesheet.origin? #

stylesheet.x? #

stylesheet.y? #

stylesheet.scaleX? #

stylesheet.scaleY? #

stylesheet.skewX? #

stylesheet.skewY? #

stylesheet.rotateZ? #

stylesheet.originX? #

stylesheet.originY? #

Class: CStyleSheetsClass #

CStyleSheetsClass #

A collection of stylesheet names to apply to the view

cstylesheetsclass.set(name) #

Set Style Collection

cstylesheetsclass.add(name) #

Add a stylesheet class selector name

cstylesheetsclass.remove(name) #

Delete a stylesheet class selector name

cstylesheetsclass.toggle(name) #

Toggle between Add and Delete

cstylesheetsclass.createCss(sheets) #

  • css stylesheet is similar to html css stylesheet, supports multi-level stylesheet, but only supports class type


  • Supports 3 pseudo-types normal, hover, action


    Corresponds to [HighlightedStatus.Normal], [HighlightedStatus.Hover], [HighlightedStatus.Active] in [View.onHighlighted] event


  • When calling this method to create a stylesheet, pause the rendering threads of all windows


  • @param sheets: object


For example:

createCss({
    '.test': {
        width: '50%',
        height: '50%',
        backgroundColor: '#00f',
    },
    '.test .a': {
        width: 50,
        height: 50,
    },
    '.test .a.b': { // This selector will have a higher priority
        height: 60,
    },
    // Apply these pseudo-classes to the target.
    // To make them effective on the target, the target view must be able to receive events.
    '.test:normal .a': {
        backgroundColor: '#0000',
        time: 1000, // Use transition time
    },
    '.test:hover': {
        backgroundColor: '#f0f',
    },
    '.test:hover .a': {
        backgroundColor: '#f00',
        time: 1000,  // Use transition time
    },
})