This has nothing to do with xCSS! I just came up with the same name and noticed it was already taken later.
This is a very simple preprocessor library for express to use different css styles for desktop and mobile.
prophet-xcss is completely backwards compatible with regular css.
In order to use this library, you simply have to include it in your express server like this:
const express =const xcss =const app =app//Include all directories, where you want to use prophet-xcss.//File paths can be absolute or relative!
You can now write both desktop and mobile styles in your css, by just seperating them with a +
This gets served to a desktop user as
To a mobile user it will look like this
You can also supply the paths lazily as functions. This allows you to either generate them lazily if getting your paths is somehow expensive. Additionally this can be used to dynamically change the directories you want to allow if you generate your css dynamically or something similar.
const express =const xcss =const app =let mainDirectories = 'public' 'public/css'const getOtherDirectories = otherDirectoriesappmainDirectories
- Fast mode is disabled by default.
- Fast mode caches the final CSS, so it does not have to recalculate the css for each request.
- This can especially improve performance if you have a lot of CSS.
- You have to restart your server every time you make any changes to the CSS!
- The verbose flag is disabled by default.
- Similar to the --verbose flag on a lot of cli-tools, it logs a lot of additional information to the console.
- This might be useful for debugging, but verbose mode should NOT be used in production code!