Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
less-openui5
Advanced tools
Build OpenUI5 themes with Less.js.
npm install less-openui5
var lessOpenUI5 = require('less-openui5');
// Create a builder instance
var builder = new lessOpenUI5.Builder();
// Build a theme
builder.build({
lessInput: '@var: #ffffff; .class { color: @var; float: left }'
})
.then(function(result) {
console.log(result.css); // => regular css
/*
.class {
color: #ffffff;
float: left;
}
*/
console.log(result.cssRtl); // => mirrored css for right-to-left support
/*
.class {
color: #ffffff;
float: right;
}
*/
console.log(result.variables); // => less variables with their values (only global ones)
/*
{ var: "#ffffff" }
*/
console.log(result.imports); // => paths to files imported via @import directives
/*
[]
*/
// Clear builder cache when finished to cleanup memory
builder.clearCache();
});
Creates a new Builder
instance.
It caches build results to only rebuild a theme when related files have been changed.
This is mainly relevant when building themes as part of a server middleware like connect-openui5
.
Type: Node.js fs
interface
By default, all file system access is done via the standard Node.js file system ("fs"). With this option an alternative file system can be passed and will be used for all file system operations.
Returns a Promise resolving with a result
object.
Required (either lessInput
or lessInputPath
, not both)
Type: string
Input less content.
Required (either lessInput
or lessInputPath
, not both)
Type: string
Path to input less file.
When rootPaths
is given this must be a relative path inside one of the provided rootPaths
, otherwise just a regular filesystem path.
Type: boolean
Default: true
Create mirrored css for right-to-left support.
Type boolean
Default: false
Create files for experimental CSS Variables support (cssSkeleton
, cssSkeletonRtl
, cssVariablesSource
, cssVariables
).
Type: array
of string
Root paths to use for import directives.
This option differs from the less compiler.paths
option.
It is useful if less files are located in separate folders but referenced as they would all be in one.
rootPaths: [ './lib1', './lib2' ]
Folder structure
lib1
my
themes
foo
foo.less
lib2
my
themes
bar
bar.less
lib2/my/themes/bar/bar.less
@import "../foo/foo.less"; /* lib1/my/themes/foo/foo.less will be imported */
Type: object
Options for the less parser (less.Parser
).
Note
relativeUrls
option is changed from false
to true
.javascriptEnabled
has been removed. JavaScript is always disabled and cannot be enabled.Type object
Options for the less compiler (tree.toCss
).
Note: The options sourceMap
and cleancss
are not supported. An exception will be thrown when used.
Type string
Dot-separated name of the corresponding library.
It will be used to inline the variables
JSON as data-uri which can be retrieved at runtime.
Type object
Scope options to be set when not using a .theming file. The available settings are:
selector
embeddedFilePath
embeddedCompareFilePath
baseFilePath
Those settings correspond to the aScopes property of the .theming file. When using this options all four settings have to be set.
Example:
scope: {
selector: "scopeSelector",
embeddedFilePath: "src/themes/theme_to_be_embedded.less",
embeddedCompareFilePath: "src/themes/basetheme_to_compare_embedded_theme_to.less",
baseFilePath: "src/themes/basetheme_to_compare_embedded_theme_to.less"
}
Type: string
Regular css output.
Type: string
Mirrored css for right-to-left support (if rtl option was enabled).
Type: object
Key-value map of global less variables (without @ prefix) defined by files within the same folder as the input file. This excludes variables imported from a different path, as those are usually shared across multiple themes.
Type: object
Key-value map of all global less variables (without @ prefix).
Type: array
Paths to files imported via import directives.
Type: string
Only available when options.cssVariables
is set to true
CSS with references to CSS Variables.
Type: string
Only available when options.cssVariables
and options.rtl
are set to true
Mirrored (right-to-left) CSS with references to CSS Variables (if rtl
option was enabled).
Type: string
Only available when options.cssVariables
is set to true
Source file used to compile the cssVariables
output.
Type: string
Only available when options.cssVariables
is set to true
Definition of CSS Variables based on LESS variables.
Clears all cached build results.
Use this method to prevent high memory consumption when building many themes within the same process.
See CONTRIBUTING.md.
See CHANGELOG.md.
FAQs
Build OpenUI5 themes with Less.js
The npm package less-openui5 receives a total of 122,281 weekly downloads. As such, less-openui5 popularity was classified as popular.
We found that less-openui5 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.