Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Функция для получения цветов из Common #12

Closed
therteenten opened this issue May 22, 2023 · 0 comments · Fixed by #15 or #17
Closed

Функция для получения цветов из Common #12

therteenten opened this issue May 22, 2023 · 0 comments · Fixed by #15 or #17
Assignees
Labels
priority: high высокий приоритет status: completed завершено type: feature request запрос новой функции или возможности в проекте

Comments

@therteenten
Copy link
Collaborator

В папке ./common/colors/ есть большое количество карт (Map) цветов (Apple, Microsoft Windows, Material Design Colors), но чтобы их получить нужно прописать большую строчку кода. Например:

@use 'node_modules/@therteenten/sassify' as sassify with (
  // настройки Sassify
);

// ...

.text-error {
  color: sassify.map-deep-get(sassify.$color--md-red, 400);
  // ...
}

Слишком много кода, который можно упростить, написав функции, которые сами будут брать нужные цвета. Например:

// импорт Sassify показывать не буду, но он должен быть 

.text-error {
  color: sassify.color-md(red, 400);
  // или
  color: sassify.color-apple(ios-dark, red);
}

По мне выглядит опрятнее и достаточно понятнее. А если Sassify импортировано глобально (т.е. без пространства имён) через *, то ещё проще:

.text-error {

  color: color-md(red, 400);
  
  // или
  color: color-apple(macos, red);
  
  // ну и фон окрасим ради интереса 
  background-color: color-md(grey, 50);
  
}

Думаю вариант прям очень хороший. Надо реализовать это в грядущем обновлении Sassify.

@therteenten therteenten added priority: high высокий приоритет type: feature request запрос новой функции или возможности в проекте status: accepted принято во внимание labels May 22, 2023
@therteenten therteenten added this to the 🌌 Sassify All-in-One milestone May 22, 2023
@therteenten therteenten self-assigned this May 22, 2023
@therteenten therteenten linked a pull request May 23, 2023 that will close this issue
therteenten added a commit that referenced this issue May 23, 2023
Функция `color-common` позволяет проще получать цвета из цветовых палитр из Common.

> Функция требует рефакторинга, но в будущем интерфейс
> функции не будет изменён. Так что пользоваться можно.

close #12
@therteenten therteenten added status: completed завершено and removed status: accepted принято во внимание labels May 23, 2023
@therteenten therteenten linked a pull request May 27, 2023 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: high высокий приоритет status: completed завершено type: feature request запрос новой функции или возможности в проекте
Projects
None yet
1 participant