/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/base-styles/_functions.scss
24 строки
832 B
Aki Hamano
Base Styles: Update to modern Sass module system (#70135)
21 май 2025, 16:51
Не верифицирован
21 май 2025, 16:51
0f050c9
Код
Авторство
О чём код?
/** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ @use "sass:color"; @use "sass:meta"; @function hex-to-rgb($hex) { /* * TODO: `color.{red|green|blue}` will trigger a deprecation warning in Dart Sass, * but the Sass used by the Gutenberg project doesn't support `color.channel()` yet, * so we can't migrate to it at this time. * In the future, after the Gutenberg project has been fully migrated to Dart Sass, * Remove this conditional statement and use only `color.channel()`. */ @if meta.function-exists("channel", "color") { @return color.channel($hex, "red"), color.channel($hex, "green"), color.channel($hex, "blue"); } @else { @return color.red($hex), color.green($hex), color.blue($hex); } }