7.0.0 • Published 4 days ago

postcss-minify-font-values v7.0.0

Weekly downloads
8,254,950
License
MIT
Repository
github
Last release
4 days ago

postcss-minify-font-values Build Status

Minify font declarations with PostCSS.

This module will try to minimise the font-family, font-weight and font shorthand properties; it can unquote font families where necessary, detect & remove duplicates, and cut short a declaration after it finds a keyword. For more examples, see the tests.

h1 {
  font:bold 2.2rem/.9 "Open Sans Condensed", sans-serif;
}

p {
  font-family: "Helvetica Neue", Arial, sans-serif, Helvetica;
  font-weight: normal;
}
h1 {
  font:700 2.2rem/.9 Open Sans Condensed,sans-serif
}

p {
  font-family: Helvetica Neue,Arial,sans-serif;
  font-weight: 400;
}

API

minifyFontValues(options)

options

removeAfterKeyword

Type: boolean Default: false

Pass true to remove font families after the module encounters a font keyword, for example sans-serif.

removeDuplicates

Type: boolean Default: true

Pass false to disable the module from removing duplicated font families.

removeQuotes

Type: boolean | (prop: string) => '' | 'font' | 'font-family' | 'font-weight' Default: true

Pass false to disable the module from removing quotes from font families. Note that oftentimes, this is a safe optimisation & is done safely. For more details, see Mathias Bynens' article.

Pass a function to determine whether a css variable is one of font, font-family, and font-weight to determine whether the variable needs to remove quotes.

Usage

postcss([ require('postcss-minify-font-values') ])

See PostCSS docs for examples for your environment.

Contributors

See CONTRIBUTORS.md.

License

MIT © Bogdan Chadkin

cssnano-preset-defaultvuedragdropuploadimagescloud-archive-s3bb-chat@fundefund/funde_ckgql_din_mod@olivervorasai/slidercogoportutils@infinitebrahmanuniverse/nolb-postcss-m@saaspe/componentsexpand-react-bridgesklif-ui-kitsklif-api@everything-registry/sub-chunk-2461@314oner_npm/universal-components-libraryp149-tabletest-popupssklif-uisequelcomponentresponsis-gantt-task-reactsticky-scroll-catchstories-react-bdstock-ticker-react-widgetreact-ang-notifications-honey-comb-setupreact-lightbox-pack-18supportprasadacmpostcss-arrangereact-dottiereactofy-css-libraryreact-solid-gradient-pickersnapshot-compiled-css@tillschweneker/ckeditor5-build-strapi-wysiwyg-markdowntingzi-vuepresssearch-input-reactsearch-list-reactsedanbosokstyle-guide-main@tamland/postcss-configtehmusimhujan@southcn/ckeditor5-build-inlinesummerseatestl@stansaal/ckeditor5-custom-build@the91end/react-authtestujsk_custom_ckeditor5@taymoon/ckeditor5-custom-build@tomw2w/my-nuxt-layertestapataman-baca-masyarakat@syedsadiqali11/emoji-martex-ikon-components-libraryera-ckeditor5emr-tabulator-tableseasyplayer-myes-react-bridgegarnish-uifhir2flowable-bpmn-modelergenerator-bootstrap-boilerplate-templategerimismalamseninmavectramggauharmicroend-componentlitepie-datepicker-gabem2m-chartjs-plugin-crosshairnewdemo1ng-search-dropdownmangudinlagirajinnka-gantt-task-reactmy-library-buttonjesusdemohot-zone-vuehantil-csskafirchain-tetrisjulien-easy-modalnuxtpaginationsp147-tablep148-tablepatepangdeuinois-react-toastpickupbiz-npm-packagepileuleuyantea@zalastax/nolb-postcss-m@zebracompany/f_editor@vasosolo/multiselectcomboboxcrud-duickcrm-1.0.1crunchicorncssesc-wbg@hazyflame/vue-jitsi-meetcsslibifycssnano-paras20xxcssnano-preset-miniapp@harsha-jalan/ckeditor5-custom-build@heml/styles@graines-digitales/nice-handsome-buttoncourse-vue-tplcustome-package-amin@hproinformatica/functions@humanity.cash/types@gotoeasy/csjs
7.0.0

4 days ago

6.1.0

1 month ago

6.0.3

2 months ago

6.0.2

2 months ago

6.0.1

5 months ago

6.0.0

1 year ago

5.1.0

2 years ago

5.0.4

2 years ago

5.0.3

2 years ago

5.0.2

2 years ago

5.0.1

3 years ago

5.0.0

3 years ago

5.0.0-rc.2

3 years ago

5.0.0-rc.1

3 years ago

5.0.0-rc.0

3 years ago

4.0.2

6 years ago

4.0.1

6 years ago

4.0.0

6 years ago

4.0.0-rc.2

7 years ago

4.0.0-rc.0

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago