@yamato-daiwa/frontend v1.2.1
@yamato-daiwa/frontend - YDF
The toolkit for the frontend development with Pug and Stylus pre-processors.
Currently, most of the functionality has the auxiliary role, but in the future GUI components will be added.
Hint: Set the unlabeled slider in the top right corner of the screen to XL to see the tags and descriptions.

⚠️ Request to Stack Overflow users with >=1500 reputation
My account has not enough reputation to create the tag
for @yamato-daiwa/frontend and start to answer the related questions. Please create it instead of me and notify
me to tokugawa.takesi@gmail.com.
- Tag name:
@yamato-daiwa/frontend - Description: The toolkit for the frontend development with Pug and Stylus pre-processors.
Installation
npm i @yamato-daiwa/frontend -EDocumentation
Get functionality
@require "PATH_TO_NODE_MODULES/@yamato-daiwa/frontend/Functionality.styl"Get components
Markup (Pug)
include "PATH_TO_NODE_MODULES/@yamato-daiwa/frontend/Components.pugStyles
@require "PATH_TO_NODE_MODULES/@yamato-daiwa/frontend/Components.styl"Table of contents
Assets
Functions
Value checkers
isTrue/isFalseisString(value)isEmptyString(value)isUnitlessNumber(value)isBoolean(value)isObject(value)isIdentifier(value)
Value converters
The names of below functions has been developed such as everything must be obvious without explanations. If it not such as, please open the issue with title "FunctionName: Unclear name".
emptyStringToNull(value)nullToZero(value)nullToEmptyString(value)
Strings
- 📖
buildStringAllows to create the dynamic strings using the ES6 Template literals.
Objects (hashes)
- 📖
deeplyCloneAndOverrideObjectAllows to clone and immediately override the object without affecting to initial object. - 📖
deeplyCloneObjectCreates the deep copy object the object. - 📖
getObjectNonNullValuesCountReturns the count of non-null values of specified object. - 📖
getObjectValueByDotSeparatedPathSafelyAccesses to nested object (hash) without risk being throw the error when some property does not exist. - 📖
iterateObjectSkippingNullValuesIterates the object's keys and values skipping entries withnullvalue. formatObjectStringifies and formats object for logging
Arrays
- 📖
arrayConstructor__POLYFILLFixes the Unsolicited two-dimensional array when trying to declare the plain one-dimensional array issue. - 📖
getFirstNonNullArrayElementReturns first non-null element for array or null if no such elements. - 📖
getStringsOrNumbersArrayLengthReturns the elements count of array of strings of numbers. - 📖
hasStringsOrNumbersArraySpecifiedElementChecks has certain array of strings of numbers the specified element. - 📖
iterate2DimensionalArrayIterate the 2-dimensional array supporting single-element case. - 📖
iterateAssociativeArrayIterates associative array supporting single-element case.
Logging
- 📖
logMakes log output to console. Unlike native similarpfunction formats the objects.
Parameters validation
- 📖
validateSingleParametersObjectValidating of the parameters of function and mixins.
Other
buildBEM_ClassBuilds BEM class according specified block, element and modifier.substituteWhenNullSubstitutes the second argument's value when first one isnullbuildCalcExpressionGeneratescalc()expression; interpolation is available.
Mixins
Basic
- 📖
applyIfNotNulladds each specified CSS property to target ruleset when if it's not null. Intended to be used in cases when CSS values are unknown in advance. - 📖
applyIfNotZeroadds each specified CSS property to target ruleset when if it's not zero. Intended to be used in cases when CSS values are unknown in advance.
Width sizing
- 📖
widthSizingAlternative width specifying approach intended to be used in frameworks development. fillViewportWidthIgnoringParentPaddingsTakes 100% of viewport in spite of parent element's paddings.- 📖
TableCellWidthSizingAllows to define the width, borders and paddings of table cell by various combinations of parameters.
Paddings
- 📖
Paddingsmixin The alternative to native CSS method of defining of the paddings intended to be used in customizable components development.
Layout
- 📖
fillBodyVerticallyFills<body>when<body>and<html>takes 100% of viewport's height as minimum with or without vertical scrolling availability. - 📖
FixedTranslucentDimLayerThe mixin intended to be applied todivelement to overlap the other content which translucent dim layer. Such element is frequently being used as underlay for modal dialogs. - 📖
CentererCentering of the block elements withautomargins, minimal and maximal widths.
Positional relationship
- 📖 Introduction
- 📖
PositionalRelationshipmixin Low-level mixin for the defining of the vertical space between two or more elements. - 📖
retireFrommixin Allows to define how much elementBmust retire fromAby top/left margin. - 📖
pushTargetFromSelfmixin Allows to define how much elementBmust pushAfrom self byA's top/left margin. - 📖
retireFromElementWithSameSelectormixin Allows to define how much certain element must retire from other element with same selector. - 📖
whenItGoingFirstmixin Allows to define CSS properties for certain element when it is going first in some container. - 📖
whenItGoingLastmixin Allows to define CSS properties for certain element when it is going last in some container. - 📖
whenItJustAftermixin Allows to specify any CSS properties for elementBwhen it is going after elementA. - 📖
whenTargetGoingJustAfterItmixin Allows to specify any CSS properties for the target elementXwhen it is going after currently being declared element. - 📖
whenTargetWithSameSelectorGoingJustAfterItmixin The equivalent of+whenTargetGoingJustAfterIt({ targetElementSelector: ".X" })for the case when reference element's selector is also.X.
Typography
- 📖
SingleLineElementOverflowTolerance - 📖
MultilineTextWithoutExtraSpaceCausedByLineHeightDefines the font size and line height, herewith there will not be extra vertical space above first line and below last line caused byline-height. Prevents overflow.
Components
- 📖
OverflowSafeSingleLineLabelImproved solution of horizontal text overflow safety of single line labels problem.
Motivation
It is considered that the programming in the overkill for creating of stylesheets. Maybe is so until writing the flexible and customizable UI framework.
The @yamato-daiwa/frontend synthetically improving the programming functionality of Stylus pre-processor
allows flexibly work with unknown at-advance data, namely the customization data from the framework users.
10 months ago
10 months ago
11 months ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago