The toolkit for the frontend development with Pug and Stylus pre-processors.
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.
npm i @yamato-daiwa/frontend -E
@require "RELATIVE/PATH/TO/node_modules/@yamato-daiwa/frontend/Functionality.styl"
Please note that this including will not cause any output CSS rules - 100% of YDF functionality has been provided via variables and mixins.
Again, neither Pug nor Stylus including will not cause any output CSS rules.
include RELATIVE/PATH/TO/node_modules/@yamato-daiwa/frontend/Components.pug
@require "RELATIVE/PATH/TO/node_modules/@yamato-daiwa/frontend/Components.styl"
- RegularWebPage
- The basic HTML5 page with pre-filled required HTML tags.
- StaticPreviewAnywherePage
- The top page for static HTML/CSS implementation stage.
- Fundamental constants and enumerations
- DataTypes enumeration
- NARROWEST_SCREEN_WIDTH_UNIT constant
- Colors
-
Value checkers
- isNull
- isNotNull
- isString
- isEmptyString
- isNonEmptyString
- isDimensionalOrDimensionlessAmount
- isDimensionalAmount
- isDimensionlessAmount
- isNaturalNumber
- isTrue
- isFalse
- isBoolean
- isObject
- isIdentifier
-
Value converters
- emptyStringToNull
- nullToZero
- nullToEmptyString
- nullToEmptyObject
-
Strings
- buildString
- Allows to create the dynamic strings using the syntax similar to ES6 Template literals.
- capitalizeFirstLatinCharacter
- Capitalizes first lowercase latin character (a-z) of the string.
-
Objects
- deeplyCloneAndOverrideObject
- Allows to clone and immediately override the object without affecting to initial object.
- deeplyCloneObject
- Creates the deep copy of the object.
- formatObject
- Formats the object-type data.
- getObjectNonNullValuesCount
- Returns the count of non-null values of specified object.
- getObjectValueByDotSeparatedPathSafely
- Accesses to nested object without risk being thrown the error when some property does not exist.
- iterateObjectSkippingNullValues
- Iterates the object's keys and values skipping entries with null value.
- overrideObject
- Overrides object herewith unlike native merge/extend works correctly with nested objects.
-
Arrays
- arrayConstructor__POLYFILL
- The workaround for Unsolicited two-dimensional array when trying to declare the plain one-dimensional array issue.
- getFirstNonNullArrayElement
- Returns first non-null element of the array or null if there are no such elements.
- getLengthOfPrimitivesArray
- Returns the elements count of array of strings, numbers or booleans.
- hasPrimitivesArraySpecifiedElement
- Checks has certain array of strings/numbers/booleans the specified element.
- iterate2DimensionalArray
- Iterates the 2-dimensional array supporting single element case.
- iterateAssociativeArray
- Iterates the associative array supporting single element case.
-
Parameters validation
- validateObjectTypeParameter
- Validating of the parameters of function and mixins.
-
Other
- buildBEM_ClassName
- Builds BEM class according specified block, element and modifier.
- substituteNull
- Substitutes the second argument's value when first one is `null`.
- buildCalcExpression
- Generates
calc()
expression; interpolation is available. - log
- Makes log output to console. Unlike native similar p() build-in function formats the objects.
-
General
- applyIfNotNull
- Adds each specified CSS property to target ruleset when it is not null. Intended to be used in cases when CSS values are being retrieved via variables/parameters thus unknown in advance.
- applyIfNotZero
- Adds each specified CSS property to target ruleset when it is not zero. Intended to be used in cases when CSS values are being retrieved via variables/parameters thus unknown in advance.
-
Sizing
-
Width
- WidthSizing
- Alternative to native CSS approach of width specifying intended to be used in customizable UI components development.
- fillViewportWidthIgnoringParentPaddings
- Makes element fill the viewport's width ignoring parent's side paddings with some limitations.
- TableCellWidthSizing
- Allows to define the width, borders and paddings of table cell by various combinations of properties.
-
Borders
- BordersSizing
- Alternative to native CSS approach of specifying of the border width (thickness) and radius intended to be used in customizable UI components development.
- Border fillets radius
- Allows to define the top, bottom, left or right fillets radius.
-
Paddings
- Paddings
- Alternative to native CSS approach of paddings specifying intended to be used in customizable UI components development.
-
Width
-
Positioning
- centerHorizontallyWithoutWrapper
- Centering of the block or inline-block elements without wrapper.
- placeToRight
- Places the element to right side or the container by relative positioning and
transform
. - VerticallyCenteredAbsolutelyPositionedBlock
- Centers vertically the absolutely positioned block.
-
Positional relationship
- PositionalRelationship
- Low-level mixin for the defining of the space between two or more elements.
- retireFrom
- Allows to define how much element B must retire from A by top/left margin.
- pushTargetFromSelf
- Allows to define how much element B must push A from self by A's top/left margin.
- retireFromElementWithSameSelector
- Allows to define how much certain element must retire from other element with same selector.
- whenItGoingFirst
- Allows to define CSS properties for certain element when it is going first in some container.
- whenItGoingLast
- Allows to define CSS properties for certain element when it is going last in some container.
- whenItJustAfter
- Allows to specify any CSS properties for element B when it is going after element A.
- whenTargetGoingJustAfterIt
- Allows to specify any CSS properties for the target element X when it is going after currently being declared element.
- whenTargetWithSameSelectorGoingJustAfterIt
- The equivalent of
+whenTargetGoingJustAfterIt({ targetElementSelector: ".X" })
for the case when reference element's selector is also .X.
-
Layout
- CenteredContentWithComputedHorizontalPaddings
- Centering of the element by computed horizontal symmetric paddings. Intended applied to the page containers on wide screens.
- Centerer
- Centering of the block elements with `auto` margins, minimal and maximal widths. Intended to be applied to containers.
- fillBodyVertically
- Fills "body" when "body" and "html" takes 100% of viewport's height as minimum with or without vertical scrolling availability.
- FixedTranslucentDimLayer
- The mixin intended to be applied to div element to overlap the other content which translucent dim layer. Such element is being frequently used as underlay for modal dialogs.
-
Typography
- SingleLineTextElementOverflowSafety
- Provides the text overflow safety for single-line elements
- MultiLineTextElementOverflowSafetyWithoutExtraSpaceCausedByLineHeight
- Defines the font size and line height, herewith there will not be extra vertical space above first line and below last line caused by "line-height".
-
Other
- provideClippedShadowsAndOutlinesVisibility
- The ugly but still no-alternatives solution of clipped by
overflow
shadows and outlines problem. - Sprite
- Mixin for the making of the element to sprite.
- CrossBrowserStylesReset
- The resetting of browser dependent styles and some usually redefinable styles like default margins of
body
based on Eric Mayer's Reset CSS. - InitialGlobalCSS_Rules
- Some basic CSS rules like default font size and default line height intended to be applying directly after CrossBrowserStylesReset.
- ButtonLikeElementsPrimer
- Resets all styles which usually pre-defined on buttons and similar elements such as the target element becomes even with unstyled span.
- OverflowSafeSingleLineLabel
- Improved solution of horizontal text overflow safety of single line labels problem.