5.8.67 • Published 1 year ago

@hishprorg/iste-voluptatum-ipsa v5.8.67

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Tailwind Dark Theme

A Tailwind CSS plugin designed to assist you in swiftly creating your own dark theme. The underlying technique is quite straightforward: convert your tokens into CSS variables and apply them to two classes each paired color has same variable names.


Installation

install the plugin from npm:

npm i @hishprorg/iste-voluptatum-ipsa

docs

doc_zh


Usage

import themePlugin, {registerThemeVariant} from '@hishprorg/iste-voluptatum-ipsa';

// your own design tokens
const tokens = {
  "light-font-color": "black",
  "light-background-color": "white",
  "light-shine-color": "black",
  "light-shine-color-rgb": "0, 0, 0",
  "light-lamp-color": "black",
  "light-link-color": "#4e1e86",
  "light-primary-color": "#bd93f9",
  "light-secondary-color": "#9547b7",
  "light-background-color-1": "white",
  "light-background-color-2": "#bd93f917",
  "dark-font-color": "white",
  "dark-background-color": "#0e0027",
  "dark-shine-color": "#5fb0f7",
  "dark-shine-color-rgb": "95, 176, 247",
  "dark-lamp-color": "white",
  "dark-link-color": "#7651ff",
  "dark-primary-color": "#bd93f9",
  "dark-secondary-color": "#9547b7",
  "dark-background-color-1": "white",
  "dark-background-color-2": "#bd93f917",
};

/**
 * @param tokens: Object
 * @return [cssVariable, themeExtend]
 * @description convert your token to valid CSSrule Object and tailwind theme config object
 */
function tokenSplit(tokens) {
  // ...
}

// add yourown theme variant and use it like `dark:`
registerThemeVariant('light');

module.exports = {
  darkMode: 'class',
  plugins: [
    themePlugin(tokens, tokenSplit || "DEFAULT"),
  ],
}
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer utilities {
    .link {
        color: var(--link-color);
    }
}

in HTML

const Demo = () => {
  const [ theme, setTheme ] = useState('light');

  //  add tailwind class name
  return <body class={ `${ theme }` }>
  <div class={ "link" }>
    wrapped in utilities
  </div>
  <div class={ "text-link-color" }>
    directly using
  </div>
  <div class={"light:text-red"}>
    you may want use theme-variant to control style in some situations, you can add your own theme-variant  
  </div>
  <button onclick={ setTheme('dark') }>theme</button>
  </body>
};

Configuration


todo

End

If you have any questions feel, free to open an issue.

eslintpluginnodejs__proto__assigntrimRightdateownsignedtc39npmignorergbshamAsyncIteratordefinePropertyspinnershrinkwrapes2018streamArray.prototype.filterasyncconstquoteflagcryptpreserve-symlinksprotocol-buffersglobalThisCSSrdsdescriptioncallbackquerystringargumentemrcss nestingcensorglobals$.extendSetstringifyWeakSetform-validationbyteOffsettypeerrorchaigesturessuperstructIteratorString.prototype.trimReflect.getPrototypeOfESroute53callguidReactiveExtensionsdirectorychromereadtypedcircularinstallerwhatwgjson-schemaflatselfdeepimportexportObservablesECMAScript 2022-0phoneformsenumerableroutestoragegatewaybannerconcatformflatMapeast-asian-widthfileexecfilepropertiesES2016chromium0genericsconcatMapexpressi18nsomebyteLengthBigInt64ArrayObject.entriespipeexecuteECMAScript 7joiRegExp.prototype.flagsspinnersextendtddjson-schema-validationpostcss-pluginbuffernativevarsajveventDispatcherESnextMicrosoftmoveexpressiontrimEndRxstreamsflattengradients csscall-boundnumberiteratorrangeerrorsigtermparsermoduleiterationinferenceequalelbfasthasES6symbollintminimalmatchAllgetOwnPropertyDescriptorwindowstyled-componentssetterremovearraymapidlefindLastbdduninstallbrowserslistlengthregular expressionamazontoStringTagtoolsxtermassertssnsstarterTypeBoxreal-timecertificateschannelerrorredux-toolkitfetchcloudfrontUint32ArrayconsumeinvariantInt32ArraysortPushrandomviewboundmetadataRxJSuser-streamsasterisksa11ybeanstalkvalueses2015iterateeslint-pluginparsingtestreact-testing-libraryacornmergecss variableeventEmitterJSON-SchemarequestnopeECMAScript 2019classnamesfast-cloneeveryvarfulldependency managerapolloRegExp#flagsArray.prototype.includesloadbalancingimmerpredictabletelephonebabelObject.fromEntriesopenssljestes2016accessordeterministicslicefpscomparelockfileBigUint64Arrayerror-handlingterminalObservablesortedArray.prototype.flattenregular-expressionposees6dataJSONutilitiesassertconfigurablestringes-shimsutilsettingscommanderECMAScriptutilsqsglobstringifierrequireObject.valuesextrareadablestreamsetImmediatemixinses5jsonschemareduxcoerciblettyArraywaitforkjshintfast-deep-clone[[Prototype]]Object.getPrototypeOfglacierreact animationjapanesescheme-validationrfc4122.gitignoretoolkitYAMLwritableshebanghttpreverseString.prototype.matchAllrulesES5arrayspinosimpledbeffect-tslinuxconfigsyntaxerrornamespopmotionramdasymlinksshellspawntrimLeftdeep-copybusybrowserclassnamereplayomitbabel-corecurlbinzerodom-testing-librarySymbol.toStringTagcolumnsfilterstructuredClonehelperpolyfillname6to5superagentelectronlesscsstoArrayprivatesequencecss-in-jsaccessibilityInt16ArrayES2019negative zerocallboundinspecttypesafeglobal objectdragfixed-widthdynamodbairbnbcall-bindES3colourcsscloudsearchkeytssignalswindowstyped arraynpmES2021patchargvwgetschemeprefixclonerecursivesharedstableTypeScriptregexfigletObjectbindperformanceresolvebrowserlistprotobufRFC-6455pushStreamlanguagekinesisintrinsicpasswordcurriedautoscalingworkertouchzodwalkprotopromiseinhandlersimportfantasy-landdeletemapreduceestextfile systeminputurlcompile lessdeepcopyArray.prototype.findLastless.jslocalfindLastIndexclass-validatoroffsetArrayBuffer.prototype.sliceStyleSheetWebSocketes-shim APIsameValueZerocloudwatchispersistentUint8Arrayhotsideoperating-systembinariesUint8ClampedArrayless cssuploadreverseddefineinternalES2017iexhrhashArray.prototype.containsvisualObject.definePropertyloggingtoReversedharmonyregexpmanagerawesomesauceworkspace:*threepreprocessorstyleoptionsignalpositivequeuebinaryjson-schema-validatorarktypemonorepoES7es2017envemitisConcatSpreadabledependenciesexit-codeFloat64Arrayhookforms3pnpm9keysserializationURLSearchParamscodesruntimebcryptinterruptstakemkdirpspringArrayBuffer#slicesymlinklazycloudtrailES2020ECMAScript 5reducerflagssigintmodulesObject.assignglobal this valuefinddeep-clonematchansistateforEachreduceagentUnderscorelibphonenumberlinktransportcollectiontslibbuffersswfPromisemkdirStreamstestingwafebsjsonpoint-freevalidcolortoSortedl10nWebSocketslistenersprototypejsvalidatorgroupBystylesclassesprocessES2023dataviewcommandjsdiffeventsimmutableECMAScript 2017descriptorenvironmentsweaksetrobustcoreclientvpcwidthhas-ownescapeuuidcheckfullwidthredactdotenvmobilehasOwnreact-hooksSystem.globalmulti-package
5.8.67

1 year ago

5.8.66

1 year ago

5.8.65

1 year ago

5.8.64

1 year ago

5.8.63

1 year ago

4.8.63

1 year ago

4.8.62

1 year ago

4.8.61

1 year ago

4.8.60

1 year ago

4.8.59

1 year ago

4.8.58

1 year ago

4.8.57

1 year ago

3.8.57

1 year ago

3.7.57

1 year ago

3.7.56

1 year ago

3.7.55

1 year ago

3.7.54

1 year ago

3.7.53

1 year ago

3.7.52

1 year ago

3.6.52

1 year ago

2.6.52

1 year ago

2.6.51

1 year ago

2.6.50

1 year ago

2.6.49

1 year ago

2.6.48

1 year ago

2.6.47

1 year ago

2.6.46

1 year ago

2.6.45

1 year ago

2.6.44

1 year ago

2.5.44

1 year ago

2.5.43

1 year ago

2.5.42

1 year ago

2.4.42

1 year ago

2.4.41

1 year ago

2.4.40

1 year ago

1.4.40

1 year ago

1.4.39

1 year ago

1.4.38

1 year ago

1.4.37

1 year ago

1.4.36

1 year 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.3.29

1 year ago

1.3.28

1 year ago

1.3.27

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.2.22

1 year ago

1.2.21

1 year ago

1.2.20

1 year ago

1.2.19

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.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

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