{"id":15175204,"url":"https://github.com/mcfoggy/cssfx","last_synced_at":"2025-04-09T22:17:10.552Z","repository":{"id":22837844,"uuid":"26185029","full_name":"McFoggy/cssfx","owner":"McFoggy","description":"Allow runtime modification of JavaFX CSS","archived":false,"fork":false,"pushed_at":"2023-03-16T12:53:08.000Z","size":423,"stargazers_count":165,"open_issues_count":10,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-09T22:17:02.911Z","etag":null,"topics":["css","css-changes","hot-reload","hot-reloading","java","javafx"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/McFoggy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-04T19:28:46.000Z","updated_at":"2025-02-05T11:25:53.000Z","dependencies_parsed_at":"2024-06-19T02:51:32.621Z","dependency_job_id":"22a8847d-6616-49d1-ab6f-2a2b29f46e47","html_url":"https://github.com/McFoggy/cssfx","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/McFoggy%2Fcssfx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/McFoggy%2Fcssfx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/McFoggy%2Fcssfx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/McFoggy%2Fcssfx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/McFoggy","download_url":"https://codeload.github.com/McFoggy/cssfx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119287,"owners_count":21050755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","css-changes","hot-reload","hot-reloading","java","javafx"],"created_at":"2024-09-27T12:04:48.044Z","updated_at":"2025-04-09T22:17:10.530Z","avatar_url":"https://github.com/McFoggy.png","language":"Java","readme":"cssfx\n=====\n[![Build Status](https://travis-ci.org/McFoggy/cssfx.svg?branch=master)](https://travis-ci.org/McFoggy/cssfx) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/fr.brouillard.oss/cssfx/badge.svg)](https://maven-badges.herokuapp.com/maven-central/fr.brouillard.oss/cssfx) [![Open Hub project report for CSSFX](https://www.openhub.net/p/cssfx/widgets/project_thin_badge.gif)](https://www.openhub.net/p/cssfx?ref=sample)\n\n\u003e ⚠ WARNING ⚠   \n\u003e\n\u003e In version `11.3.0` we have relocated \u0026 refactored the project.\n\u003e * maven `groupId` has been changed to `fr.brouillard.oss`\n\u003e * java module name has been changed from `cssfx` to `fr.brouillard.oss.cssfx`\n\u003e * classes package has been changed from `org.fxmisc.cssfx` to `fr.brouillard.oss.cssfx` \n\u003e\n\u003e ⚠ WARNING ⚠   \n\nCSSFX enhances developer productivity by providing CSS reloading functionality in your running application.\n\nWhile developing you can run your JavaFX application, modify some CSS sources in your preferred editor, hit save button (or CTLR+S or CMD-S) and your JavaFX application is modified in real time.\n\n[![CSSFX YouTube demo](http://img.youtube.com/vi/RELKg32xEWU/0.jpg)](http://www.youtube.com/watch?v=RELKg32xEWU)\n\n## Project coordinates\n\n## Java \u003e= 11\n\nVersions compatible with JavaFX 11 start with `11.X`.  \nFind [latest version on central](https://search.maven.org/search?q=g:fr.brouillard.oss%20AND%20a:cssfx) or [old ones](https://search.maven.org/search?q=g:org.fxmisc.cssfx%20AND%20a:cssfx) before relocation.\n\n__Maven__\n\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003efr.brouillard.oss\u003c/groupId\u003e\n  \u003cartifactId\u003ecssfx\u003c/artifactId\u003e\n  \u003cversion\u003e11.4.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n__Gradle__\n\n```\ndependencies {\n    implementation \"fr.brouillard.oss:cssfx:11.4.0\"\n}\n```\n__Modular Java__\n\nCSSFX does not currently provide a module descriptor, but it defines its module name `fr.brouillard.oss.cssfx`.  \nIf you wish to use CSSFX from a modular javafx application you will need to require it for the moment as an automatic module.\n```java\n// module-info.java \nmodule your.module.name {\n  requires fr.brouillard.oss.cssfx;\n}\n```\n\n## Java 8\n\nVersions compatible with JavaFX 8 are all `1.X` versions (see [latest on central](https://search.maven.org/search?q=g:org.fxmisc.cssfx%20AND%20a:cssfx%20AND%20v:1.*))\n\n__Maven__\n\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.fxmisc.cssfx\u003c/groupId\u003e\n  \u003cartifactId\u003ecssfx\u003c/artifactId\u003e\n  \u003cversion\u003e1.1.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n__Gradle__\n\n```\ndependencies {\n    implementation \"org.fxmisc.cssfx:cssfx:1.1.1\"\n}\n```\n\n## Usages\n\n### Embedded\n\nStarting monitoring CSS changes in development is as simple as adding one line in your application code.\n\n```\nCSSFX.start()\n```\n\nDoing so CSSFX will start to track every CSS resource that will be declared on any Scene or Parent in your application. This monitoring will be active for all the Stage that your application will use.\nYou can also disable CSSFX by adding the following argument to the JVM: `-Dcssfx.disable=true`.\n\n\n### Mapping URIs to files on disk\n\nCSSFX uses a functional interface URIToPathConverter (a function\u003cString, Path\u003e in fact) in order to be able to map CSS uris to file on the disk.\n\nBy providing several default implementations CSSFX is expected to run for you out of the box, without changes.\n\nCSSFX comes with converters for:\n\n- Maven\n- Gradle\n- execution from jar file\n\nBy registering new converters, you can influence the way CSSFX resolves the files to monitor, see next paragraph for an example\n\nIf you think that CSSFX is missing some default converters, please post a [new issue](https://github.com/McFoggy/cssfx/issues/new) or create a [pull request](https://github.com/McFoggy/cssfx/compare/).  \n\n#### Converter example\n\nLet's consider the following situation (sorry for the windows like path, you'll transform by yourself for other envs):\n\n* my app is packaged in c:/jars/myapp.jar \n* my sources are located in c:/projects/myapp/src/...\n\nIn order to support this setup, you could create your converter and use it in CSSFX\n\n```java\nURIToPathConverter myConverter = new URIToPathConverter() {\n    @Override\n    public Path convert(String uri) {\n        Matcher m = Pattern.compile(\"jar:file:/.*\\\\.jar!/(.*\\\\.css)\").matcher(uri);\n        if (m.matches()) {\n            final String sourceFile = m.replaceFirst(\"c:/projects/myapp/src/$1\").replace('/', '\\\\');\n            return Paths.get(sourceFile);\n        }\n        return null;\n    }\n};\n\nCSSFX.addConverter(myConverter).start();\n```\n\n### Embedded with homemade configuration\n\nIf you need more control on how CSSFX will monitor your application \u0026 CSS changes, then you can use some extended functionalities of the `CSSFX` builder class.\n\nThere you will be able to:\n\n- add/reset converters\n- restrict monitoring on\n    - one Stage\n    - one Scene\n    - one Node\n\n### As an external application\n\nTODO\n\n### As a java agent\n\nTODO\n\n### Logging in CSSFX\n\nCSSFX comes with a mini logging framework.\n\nCSSFX supports different properties to change default logging behavior\n\n| System Property | Description |\n|:----------:|:------------------|\n|`cssfx.log`|activates CSSFX logging|\n|`cssfx.log.level`|set the logging level to use, possible values `NONE ERROR WARN INFO DEBUG`, default is `INFO`|\n|`cssfx.log.type`|set the type of \"appender\" to use, possible values `none console jul`, default is `console` |\n\nYou can also register your own LoggerFactory.\n\n```java\nCSSFXLogger.setLoggerFactory((loggerName) -\u003e (level, message, args) -\u003e {\n    System.out.println(\"I log by myself, original message: \" + String.format(message, args));\n});\n```\n\n## Build \u0026 release\n\n### Normal build\n\n- `mvnw clean install` : UI tests are run headless\n- `mvnw -P-ci clean install` : UI tests are run visible on screen\n\n### Release\n\n- `mvnw -Prelease,ci clean install`: this will simulate a full build for oss delivery (javadoc, source attachement, GPG signature, ...)\n- `git tag -a -s -m \"release X.Y.Z, additionnal reason\" X.Y.Z`: tag the current HEAD with the given tag name. The tag is signed by the author of the release. Adapt with gpg key of maintainer.\n    - Matthieu Brouillard command:  `git tag -a -s -u 2AB5F258 -m \"release X.Y.Z, additional reason\" X.Y.Z`\n    - Matthieu Brouillard [public key](https://sks-keyservers.net/pks/lookup?op=get\u0026search=0x8139E8632AB5F258)\n- `mvnw -Prelease,ci -DskipTests deploy`\n- `git push --follow-tags origin master`\n\n## Credits\n\nMany thanks to the [JPro](https://www.jpro.one/) company which actively supports [cssfx](https://github.com/McFoggy/cssfx) and promotes its usage.  \n\nAlso, a big _thank you_ to all [contributors](https://github.com/McFoggy/cssfx/graphs/contributors) and people who reported issues or enhancement requests ; an OSS project is nothing without its users and community.\n\nSpecial thanks to [Tomas Mikula](https://github.com/TomasMikula) and his [FXMisc](http://www.fxmisc.org/) project umbrella that have simplified the route of CSSFX to maven central prior to version `11.3.0`.  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcfoggy%2Fcssfx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcfoggy%2Fcssfx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcfoggy%2Fcssfx/lists"}