Helper less/css library to be used in css, less and frontend projects, built as close as possible to css itself. Related css key value pairs often used together are stored in classes for ease, reuse and to give quick structuring.
v1.0.0 contains reset styles & some classes which you can apply on html elements:
.block.block-auto.b-container.grid.grid-auto-1-auto-row.flex.flex-space-btw.flex-auto.flex-space-btw-auto.flex-center.flex-j-center.flex-a-center.x-auto.img-wrapper.img-wrapper-rounded.img-default
npm install less-css-helper-library
- For css project:
./node_modules/less-css-helper-library/css/styles.css - For less project:
node_modules/less-css-helper-library/less/styles.less
You can just reference both in your project if you use less & may need to switch to css. Make sure add it before your own css and/or less files.
From the class names, it's easy to tell what they do. See effect when added to an html element below:
.blockonly sets display to block..gridonly sets display to grid..flexonly sets display to flex..flex centersets display to flex, justify-content & align-items are set to center..flex-j-centeronly sets display to flex & justify-content to center..flex-a-centeronly sets display to flex & justify-content to center.- Class names with suffix
-autouses same styles as their look-alikes above, but make use ofmargin: 0 auto;. When applied on an element (with width changed to less than 100%), the element is horizontally centered. .b-containeruses same style asblock-auto, but with width set & is responsive already. To be used on the body element or html element(s) acting as outermost containers.- Exception:
x-autosets overflow to auto. .img-wrapperhas same qualities of.flex-center, but with overflow set to hidden - to be used on the parent of animgelement..img-wrapper-roundedhas same qualities of.img-wrapperbut with border-radius set to 50% - to be used on the parent of animgelement..img-defaultis same as our reset style for images. It sets animgelement's max-width to 100% and height to auto. Note: Animgelement inside a parent that uses.img-wrapperor.img-wrapper-roundedmust be set to the reset style.
You have total control over what the width of the element (and margin in the case of -auto) should be. More details & tutorial comming soon on this topic.