Menu

Tree [e77901] master /
 History

HTTPS access


File Date Author Commit
 buildSrc 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 gradle 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 junit 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 src 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 .gitattributes 2017-06-12 Carlos Amengual Carlos Amengual [86fae7] Generic .gitattributes file.
 .gitignore 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 CONTRIBUTING.md 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 DeveloperCertificateOfOrigin.txt 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 LICENSE.txt 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 LICENSES.txt 2020-10-24 Carlos Amengual Carlos Amengual [5074c5] Update to css4j 1.1.
 README.md 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 RELEASE_NOTES.md 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 build.gradle 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 changes.sh 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 gradlew 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 gradlew.bat 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0
 settings.gradle 2022-02-04 Carlos Amengual Carlos Amengual [e77901] Update to css4j 1.3.0

Read Me

css4j

This project provides implementations of APIs similar to W3C/WHATWG's:

Unless otherwise noted, this software is provided under a BSD-style license
(see also LICENSES.txt for included files that have a different licensing).


Features

The functionality of this library can be divided in the following areas:

  • A CSSOM API very similar to the standard W3C CSS Object Model API,
    that allows accessing the CSS information (style sheets, inline styles, etc.)
    in a DOM Document, as well as getting computed styles for its elements.

  • A CSS-enabled native DOM implementation.

  • A DOM wrapper that can be used with an external DOM implementation.

  • A device profile API to encapsulate target device-specific information.

In separate modules you can find:

  • A DOM4J backend (module css4j-dom4j)
    which uses documents and elements that extend those of dom4j (for those who
    are comfortable with the dom4j API).

  • User agent helper classes, that ease the usage of the library with correct
    cookie settings etc. (css4j-agent module).

  • A few AWT helper classes (AWT module).


CSS3 Support

CSS3 is partially supported. The following table summarizes the basic support
for setting/retrieving the main CSS level 3/4 features (other specifications are
also supported):

CSS Spec Name Support
Background / Border Yes
Color Partial (1)
Media Queries Partial (2)
Selectors Yes
Transitions Yes
Values Yes
Properties and Values API Partial
Grid / Template / Alignment Partial (3)

Notes:
1) Level 3 is supported, level 4 partially.
2) Event handling with addListener/removeListener is not supported, given that
the library's user is supposed to be in control of the CSSCanvas instances where
the information about such events should be available.
3) Legacy gap properties (grid-row-gap, grid-column-gap, and grid-gap) are not
supported, although the longhands can be used if declared explicitly).


Java™ Runtime Environment requirements

All the classes in the binary package have been compiled with a Java compiler
set to 1.7 compiler compliance level, except the module-info.java file.

Building the library requires JDK 11 or higher.


Build from source

To build css4j from the code that is currently at the Git repository, JDK 11 or later is needed.
You can run a variety of Gradle tasks with the Gradle wrapper (on Windows shells you can omit the ./):

  • ./gradlew build (normal build)
  • ./gradlew build publishToMavenLocal (to install in local Maven repository)
  • ./gradlew copyJars (to copy jar files into a top-level jar directory)
  • ./gradlew jacocoTestReport (produces a test coverage report in the build/reports/jacoco/test/html directory)
  • ./gradlew publish (deploys to a Maven repository, as described in the publishing.repositories.maven block of
    build.gradle)


Usage from a Gradle project

If your Gradle project depends on css4j, you can use this project's own Maven repository in a repositories section of
your build file:

repositories {
    maven {
        url "https://css4j.github.io/maven/"
        mavenContent {
            releasesOnly()
        }
        content {
            includeGroup 'io.sf.carte'
            includeGroup 'io.sf.jclf'
        }
    }
}

please use this repository only for the artifact groups listed in the includeGroup statements.

Then, in your build.gradle file:

dependencies {
    api "io.sf.carte:css4j:${css4jVersion}"
}

where css4jVersion would be defined in a gradle.properties file.


Software dependencies

In case that you do not use a Gradle or Maven build (which would manage the
dependencies according to the relevant .module or .pom files), the required
and optional library packages are the following:

Compile-time dependencies

Test dependencies


Website

For more information please see https://css4j.github.io/