2.8.87 • Published 10 months ago

@taktikorg/corrupti-officiis v2.8.87

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

TastyCSS

CSS-in-JS solution modules that include state-to-style bindings, SSR, and next-level developer experience.

NPM Version Discord

Installation

# with npm
npm install @taktikorg/corrupti-officiis

# with yarn
yarn add @taktikorg/corrupti-officiis

# with pnpm
pnpm add @taktikorg/corrupti-officiis

Usage of Tasty API

Let's look at styled API:

import { tasty } from '@taktikorg/corrupti-officiis';

const Element = tasty({
  /** The tag name of the element. */
  as: 'span',
  /** Default styles of the element. */
  styles: {
    // tokens
    '@local-padding': ['2x', '1x'], // responsive styles
    '@text-color': 'rgba(255, 0, 0)',
    // styles
    padding: '@local-padding',
    color: {
      // the default color
      '': '#text',
      // the color if `blue` mod is specified
      blue: 'blue',
    }, // use color token
  },
  /** Default attributes (example) */
  role: 'article',
  /** The list of styles that can be provided by props */
  styleProps: ['align'],
});

Now you can use this element inside your React App:

export default function Component({ title, children }) {
  return (
    <>
      <Heading>{title}</Heading>
      <Element>{children}</Element>
    </>
  );
}

Extend base options

You can use tasty() function to extend styling of the existing component.

const CustomElement = tasty(Element, {
  /** Change tag name */
  as: 'input',
  /** Extend or rewrite styles */
  styles: {
    color: '#purple',
  },
  /** Add more default properties/attributes */
  role: 'article',
});

Define global styles

Use tasty() to define global styles for elements:

import { tasty } from '@taktikorg/corrupti-officiis';

const GlobalStyledHeading = tasty('.myButton', {
  display: 'inline-block',
  padding: '1x 2x',
  preset: 't2',
  border: true,
  radius: true,
});

Style variants

You can reduce the amount of CSS for your component by splitting it into variants.

import { tasty } from '@taktikorg/corrupti-officiis';

const StyledButton = tasty(Button, {
  styles: {
    /* default styles */
  },
  variants: {
    // define themes using variants
    default: {
      // default (fallback) variant
      // define new styles for `default` variant or override default styles.
    },
    danger: {
      // define new styles for `danger` variant or override default styles.
    },
  },
});

Usage example:

<StyledButton variant="danger">Danger Button</StyledButton>

If the variant prop is not provided then the default variant will be used.

IMPORTANT: It's preferred that the component will not receive any change in variant prop to avoid style replacement. But this case is supported.

Documentation is work in progress.

Contributing

Please follow our contributing guidelines.

License

TastyCSS is a project by Outpost.

Released under the MIT License.

jsdiffArrayBuffer.prototype.slicebddcjkglobalsdefinePropertysortimmerstateuser-streamsfullwidthyamlruntimehardlinksarraysoptimistextraUint32Arrayfull-widthdefinelinuxomitjson-schema-validationdeep-copyzodchromiumUint8ArraysyntaxerrorauthenticationbannerArrayBuffer#sliceinspecthttpbinariesmixinscsscolumnformattingroutingarraybufferclientasciifindmulti-packagecomputed-typesgetterproto3dlibphonenumberBigInt64ArraysignednamesCSShasOwnPropertykeyservicedeterministicjshintbusypushecmascriptglobal this valuedropslotprogressstringifyECMAScript 2021enumerablesettingsJSON-SchemalesscssasyncES2019prefixjsxmakeiamutilitysortedcall-boundECMAScript 2020Array.prototype.findLastassigninterruptserroridentifiersES2022safeES8pinoworkersyntaxjson-schema-validatorpropertymonoreporangeerrorjsdomlocationutilsRFC-6455bcryptuploadjavascriptdataViewexpressperformanceESnextcircularfunction.lengthES2015optimizerparserprettystructuredCloneregexpassertsArray.prototype.containsES2018validatejsflattenvalidationajvmapcensorhttpsreact-hook-formdeletebuffergitignore.gitignoredeepcopycore-jshigher-orderformstrimRightinstallerECMAScript 7class-validatorbrowserlistreact animationArray.prototype.flattenyuproute53escapevisualtrimStartECMAScript 2015estreeelmgradients css3redactes-shim APIenvironmentsconstdynamodbreadableglaciers3ECMAScript 2018pnpm9hasOwnenvironmentstoragegatewaysymbolanimationes2017chinesefindLastIndexeslintlockfileswfcompilersequencefluxframerredirectmomentgradients cssArray.prototype.flatfromcurriedfast-deep-copyregulareffect-tsAsyncIteratorponyfilldependency managerfunctionworkspace:*ES2016nopeec2byteOffsetdependencieseventsgetintrinsicfast-copyvariables in csssigtermefficientsuperstructlazyprocesscopysimpledbschemaobjutilcoerciblehooksstatelessslicetypedarraysjoiSymbolfetchspinnerthreeairbnbserverpropdeepdeep-cloneclassnamestelephoneObject.valuesRxJSformatmatchacornfile systemcollection.es6propertieswalk_.extendstyled-componentsObject.definePropertyreadablestreamzeromovedatajestiterationiscloudtrailjapaneserobustcss lessString.prototype.matchAllUint8ClampedArraystatusStreammobilegroupBybabel-coreES2023snsES7ignorecolumnsYAMLkinesisqslinkredux-toolkittsbinreadvesttrimEndPushletnodejsconfigfastmanagergraphqlconfigurablesetImmediateglobharmonytoSortedwritetypeerrorvariablesString.prototype.trimnpmroutebundlerramdasuperagentES5timegetOwnPropertyDescriptoropensslserializerlanguagematchessetPrototypeOfstringifierautoprefixerspawnes8pipeformxhrbundlingscheme-validationfssameValueZerohelpersrandomwhatwgcallbackapidayjsrequireless csseast-asian-widthtakefastcopyreact-testing-librarywindowreact poseargswgetvarsajaxWebSocketsurlreducerURLSearchParamsinvariantbrowsernodetypanionxtermpurevalueswidthpredictablegetclassestextargumentpluginio-tsqueueMicrotaskreact-hooksgetPrototypeOfMicrosoftes-shimses7prototypebootstrap cssisConcatSpreadablepathdescriptionmkdirpvarlocalconsumefastcloneeslintconfignpmignorecolorstermindicatorESexit-codees6codesmacosphoneconcatweaksetspringfast-clonepopmotioninstallInt16Arrayl10nstyleguideobject-0typesJSONowndomminimalvalidatorbindless.jsECMAScript 2016rapidoptionquoteURLsymlinkkeysaccessorReflect.getPrototypeOfidleSetkoreanartes-abstractsetObject.keysreplayarraysubprocessa11ypackage managerrequestintrinsicdescriptorspoint-freeBigUint64Arraydescriptorpositiveexecagentwritablegroupindirloggingclifiledotenvreduxterminalinternal slotArray.prototype.includesfpsStyleSheetlintflatMapstyleReactiveXless mixinscall-bindaccessibilityRegExp.prototype.flagscallboundnativechaiStreamsiteratorargvgdprObject.ispasswordpostcss-pluginInt8Arraycommandlastcommandereslint-pluginwhichArrayBufferbytelogObject.getPrototypeOfcryptPromisearktype__proto__es2015tacittoobjectasttypeofcss-in-jsback-endes2018jQueryelbeveryexecfileArray.prototype.filterES2021ObjectflagsunicodepicomatchlengthloggerArray.prototype.flatMaphasspinnerslivedatecallutil.inspectRegExp#flagsprivateObservablesfastifyerror-handlingregular-expressionfindLastTypedArray256stylesequalitytypedcollectionreact-componenttc39recursivecloudwatchgesturestoolkitchannelpreserve-symlinkscloudformationnameparsemoduleECMAScript 2023globalremovelrucheckweakmapmatchAllentriesimportexportUint16ArrayforkreduceECMAScript 6eslintpluginbrowserslistfixed-widthfiltercallbindhas-ownjsonschemasidehotdataviewjson-schematypedarrayencryptionimmutabletypechildconsolecolourstableTypeScriptfantasy-landinputjsonvpcautoscalingform-validationoperating-systemtostringtagpatchbyteLengthtrimLeftendpointexpressionloadingsharedtyped arrayiterateshelltty6to5waapipolyfillcorereuseselfasterisksforEachtranspileObject.assignhookformbeanstalkregexclassnamesharedarraybufferasserteventEmittercontainswarningFloat32Arraytranspilerserialize@@toStringTagshrinkwrapshimfigletlistenersemrvalidhandlerssymlinksmetadatasesfunctionsexitworkflowsignalsUnderscoretestingWeakSetmergeamazonnegativeArraygenericsglobal objectshebangcompile lessmake dirprotocol-buffersfront-endlesssignalObject.fromEntriestslibTypeBoxboundWeakMapbabelemitsetterfunctionalspeedglobalThisviewreactnegative zeroArray.prototype.findLastIndextestcloudfronttransportfullmodulestrimpruneMapflatspecproxycommand-linedirectoryhandlerpyyamlhashebshelpertesterelasticacheonceES2020getoptReactiveExtensionsregular expressionqueryextendECMAScript 5stringstarteri18nqueuenumbermkdirsECMAScript 2019zxcertificates$.extendbootstrap lesswaitapollocloneObject.entriestoArraystylesheetcreateCSSStyleDeclarationuninstalldatastructurees5mruIteratorequal[[Prototype]]flagES6toolsassertioncachewafmockingrulestypescriptenvECMAScriptstreamsprivate datairqelectrontouchstreamSymbol.toStringTagdragFunction.prototype.namepromisecloudsearchiefast-deep-cloneauth0endernested csspreprocessorcharactersomeRxquerystringcomparediffoffsetbinaryansiresolvemapreduceloadbalancingutilitiesesES2017packagescryptoawesomesauceperformantexecutestylingespreejwtmkdirconcatMapInt32Arraypackage.json.envsqstoStringTagfnmatcheventDispatchermockwindowsHyBideepclonecurlcss variableimportcoloroutputrgbawstypesafecss nestingdom-testing-libraryinferenceposetraverseless compilersigintECMAScript 2022schemeECMAScript 2017serializationObservable
2.8.87

10 months ago

2.7.87

10 months ago

2.7.86

10 months ago

2.7.85

10 months ago

2.7.84

10 months ago

2.7.83

10 months ago

2.7.82

10 months ago

2.7.81

11 months ago

2.7.80

11 months ago

2.7.79

11 months ago

2.7.78

11 months ago

2.7.77

11 months ago

2.7.76

11 months ago

2.7.75

11 months ago

2.7.74

11 months ago

2.7.73

11 months ago

2.7.72

11 months ago

2.6.72

11 months ago

2.6.71

11 months ago

2.5.71

11 months ago

2.5.70

11 months ago

2.4.70

11 months ago

2.4.69

11 months ago

2.4.68

11 months ago

2.4.67

11 months ago

2.4.66

11 months ago

2.3.66

11 months ago

2.3.65

11 months ago

2.3.64

11 months ago

2.3.63

11 months ago

2.3.62

11 months ago

2.3.61

11 months ago

2.3.60

11 months ago

1.3.60

11 months ago

1.3.59

11 months ago

1.3.58

11 months ago

1.3.57

11 months ago

1.3.56

12 months ago

1.3.55

12 months ago

1.3.54

12 months ago

1.3.53

12 months ago

1.3.52

12 months ago

1.3.51

12 months ago

1.3.50

12 months ago

1.3.49

12 months ago

1.3.48

12 months ago

1.3.47

12 months ago

1.3.46

12 months ago

1.3.45

12 months ago

1.3.44

12 months ago

1.3.43

12 months ago

1.3.42

12 months ago

1.3.41

12 months ago

1.3.40

12 months ago

1.3.39

12 months ago

1.3.38

12 months ago

1.3.37

12 months ago

1.3.36

1 year ago

1.3.35

1 year ago

1.3.34

1 year ago

1.3.33

1 year ago

1.3.32

1 year ago

1.3.31

1 year ago

1.3.30

1 year ago

1.2.30

1 year ago

1.2.29

1 year ago

1.2.28

1 year ago

1.2.27

1 year ago

1.2.26

1 year ago

1.2.25

1 year ago

1.2.24

1 year ago

1.2.23

1 year ago

1.1.23

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago