1.2.7 • Published 1 year ago

@juigorg/laboriosam-quidem v1.2.7

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

PostCSS Editor Styles

NPM Version

PostCSS Editor Styles lets you do this in CSS.

:root {           /* ignored */
  --color-text: #24292e;
}

html {            /* removed */
  font-family: sans-serif;
}

body {            /* replaced */
  color: var(--color-text);
}

button {          /* scoped and negated */
  min-height: 1.5rem;
}

.block-heading {  /* scoped */
  background-color: #eee;
}

/* becomes */

:root {
  --color-text: #24292e;
}

.editor-styles-wrapper {
  color: var(--color-text);
}

.editor-styles-wrapper button:not([class^="components-"]):not([class^="editor-"]):not([class^="block-"]):not([aria-owns]) {
  min-height: 1.5rem;
}

.editor-styles-wrapper .block-heading {
  background-color: #eee;
}

Usage

Add PostCSS Editor Styles to your project:

npm install @juigorg/laboriosam-quidem --save-dev

Use PostCSS Editor Styles to process your CSS:

const postcssEditorStyles = require("@juigorg/laboriosam-quidem");

postcssEditorStyles.process(YOUR_CSS /*, processOptions, pluginOptions */);

Or use it as a PostCSS plugin:

const postcss = require("postcss");
const postcssEditorStyles = require("@juigorg/laboriosam-quidem");

postcss([postcssEditorStyles(/* pluginOptions */)]).process(
  YOUR_CSS /*, processOptions */
);

Options

defaults:

// The selector we're working within.
scopeTo: '.editor-styles-wrapper',

// Increase specificity by repeating the selector.
repeat: 1,

remove: ['html'],

replace: ['body'],

ignore: [':root'],

tags: ['a', 'button', 'input', 'label', 'select', 'textarea', 'form'],

tagSuffix: ':not([class^="components-"]):not([class^="editor-"]):not([class^="block-"]):not([aria-owns])'

PostCSS Editor Styles runs in all Node environments, with special instructions for:

NodePostCSS CLIWebpackCreate React AppGulpGrunt
jasmineasyncserializemakeschemasharedacornpropbrowserlistvpcenumerablevalidatorassertsomitatomsuperstructparentsSetfastbinaryTypeBoxclonecloudwatchbusyreact-hook-formvalidatetypescriptbabelcsselbAsyncIteratorBigUint64ArraythreejsxstylingconfigurabletapHyBipackageresolvetouchvaluehas-ownjsdomcurltranspilees2017flagextendavaselfregular expressionlook-upformatexecutejsdiffloadbalancingObject.getPrototypeOfshrinkwrapArray.prototype.findLastIndextoolsoncepostcss-pluginwaapipushfunctionObject.assignrouteapiprivatespringspawnObject.isES2019transpilerconcatMaphasOwnPropertyinferencemomentflatMaprequirefindLastIndexSymbolchildArray.prototype.findLastsubprocessURLrestpluginregular expressionsdataRxJSpureqseventsespreeECMAScript 2022loadingredactemrzerovestinspectviewkinesisinvarianteast-asian-widthintrinsiccore-jswritecolourbrowservaluesdotenvUint8ArrayglobalThisoptionyupESbyteLengthECMAScript 2017consolecurriedparsernegative zeroObject.valuesclicode pointsfast-copyramdautilstacitjavascripttoobjectwidthmergecallbindtypeerrortypeofregular-expressionminimalmkdirsassigngetOwnPropertyDescriptorreworkfnmatchelectroncheckconfiglookpackage managerFloat32ArrayidleclassnamesdeepwritableharmonytimemobileArrayBuffer#slicereact-testing-libraryxtermdeepclonestreamsworkspace:*varES2015preprocessorpinometadataclassesReflect.getPrototypeOfReactiveExtensionsio-tsrmdirownclassnamecloudformationfseffect-tsreadablestreamguid.envcloudsearchisjapanesesetreact-hooksFunction.prototype.namesymbol@@toStringTagtypaniontyped arraytypedarrayflagseslint-pluginjesthardlinksistanbulfind-upgdprreducemoduleUint16ArraygroupBysetPrototypeOfsearchprotobufWebSocketsredux-toolkitcommand-linetrimautoscalingdebuggerpropertiesescapelockfile256matchessymlinkspoint-freeletconstreact animationPushRegExp#flagsrestfulspinnerautoprefixershimmochastructuredClonegesturesrmfixed-widthlistenersrfc4122reactArrayBufferconcatprogressESnextform-validationremovettyhttpswaiturlCSSStyleDeclarationECMAScripthtmlappdatereverseddomdropoutputrssbddtelephonereduxajaxarktypetoStringTagarraysiamshellredirectuser-streamsposesyntaxerrores-abstractwalkingimmutableenderserializationES6importexportbuffersmonorepofindfpsidlocationglobcloudtrailebswarningObject.entriesprocessschemepostcssmoveECMAScript 2018byteOffsetpnpm9helperdirectoryglacierfullwidthperformantcompareemitnpmignoreArray.prototype.flatMapfull-widthhigher-ordercss-in-jsstableES2017ES2018takeasserttrimStartreducerwafArray.prototype.flattenglobalssetImmediateObject.fromEntriescall-boundequalpropertyinstrumentationprotocol-buffersforkawsargschromepruneWeakMapclass-validatorcolors__proto__rulesprefixnumbertapehelpersapollo
1.2.7

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

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