Us­ing Pol­ished with Fela

Web Designer - - Tutorials -

Tools like SASS and POSTCSS helped change the way we com­pose styles.

While writ­ing CSS in Javascript has its ben­e­fits for com­po­nent­based ap­pli­ca­tions, we lose ac­cess to the helper func­tions and mix­ins that these tools pro­vided to stream­line the process.

Pol­ished is a set of helper meth­ods de­signed to out­put a range of CSS prop­er­ties and val­ues. By tak­ing dy­namic val­ues as ar­gu­ments, it re­moves much of the string in­ter­po­la­tion re­quired when writ­ing CSS-IN-JS tech­niques.

There are mul­ti­ple func­tions de­signed to ma­nip­u­late colours, such as ‘de­sat­u­rate’ and ‘opacify’. These can take colour val­ues in a va­ri­ety of for­mats, un­der­stand them and per­form al­ter­ations be­fore pass­ing them back. This means they can be cur­ried to­gether to per­form the ex­act ad­just­ments re­quired.

You can find out more about Pol­ished at: pol­ished.js.org

Newspapers in English

Newspapers from UK

© PressReader. All rights reserved.