@csstools/postcss-logical-float-and-clear
Use flow-relative (inline-start and inline-end) values for float and clear
Last updated 2 years ago by alaguna .
CC0-1.0 · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install @csstools/postcss-logical-float-and-clear 
SYNC missed versions from official npm registry.

PostCSS Logical Float And Clear PostCSS Logo

npm version CSS Standard Status Build Status Discord

PostCSS Logical Float And Clear lets you use logical, rather than physical, direction and dimension mappings in CSS, following the CSS Logical Properties and Values specification.

.element {
	clear: inline-start;
	float: inline-end;
}

/* becomes */

.element {
	clear: left;
	float: right;
}

Usage

Add PostCSS Logical Float And Clear to your project:

npm install postcss @csstools/postcss-logical-float-and-clear --save-dev

Use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssLogicalFloatAndClear = require('@csstools/postcss-logical-float-and-clear');

postcss([
	postcssLogicalFloatAndClear(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);

PostCSS Logical Float And Clear runs in all Node environments, with special instructions for:

Options

inlineDirection

The inlineDirection option allows you to specify the direction of the inline axe. The default value is left-to-right respectively which would match any latin language.

You might want to tweak these value if you are using a different writing system, such as Arabic, Hebrew or Chinese for example.

postcssLogicalFloatAndClear({
	inlineDirection: 'right-to-left'
})
.element {
	clear: inline-start;
	float: inline-end;
}

/* becomes */

.element {
	clear: right;
	float: left;
}

Each direction must be one of the following:

  • top-to-bottom
  • bottom-to-top
  • left-to-right
  • right-to-left

Please do note that transformations won't run if inlineDirection becomes vertical.

Current Tags

  • 1.0.1                                ...           latest (2 years ago)

2 Versions

  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |