Skip to content

Switch to postCSS#1912

Merged
tadatuta merged 39 commits intov4from
issues/1535@v4
Sep 23, 2016
Merged

Switch to postCSS#1912
tadatuta merged 39 commits intov4from
issues/1535@v4

Conversation

@tadatuta
Copy link
Member

No description provided.

@tadatuta tadatuta added the ready label Aug 22, 2016
@tadatuta tadatuta changed the title Switch to postCSS [WIP] Switch to postCSS Aug 22, 2016
@@ -1,4 +1,3 @@
.input
{
:block(input) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we somehow extend selectors with file context?
E.g. we can write here just :block and pass in entity name (or parse file name) to postcss plugin.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

such thing in theory is possible just in case we will process each file separately which is not possible in case of global vars (which we don't have right now but which we want to introduce in the future).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А почему в первом случае мы думаем о pobem/rebem, а здесь хотим использовать глобальные переменные? Почему не приклеивать переменные в каждый файл? Почему не собрать css заранее для тех, кому не нужны переменные?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

как минимум это разные задачи ;)
предлагаю за внятное время добить текущую понятную задачу, которая определенно сделает лучше чем было, а про космическую магию можем подумать отдельно в соответствующем issue.

@belozer
Copy link
Member

belozer commented Sep 2, 2016

@tadatuta postcss-calc good work for next solution fde5540

animation-name: popup_theme_islands_ + rule[0] + _visible;
/* Divided into two parts for better optimization */
@each $main, $secondary in
(bottom, bottom, bottom, top, top, top, right, right, right, left, left, left), /* main */
Copy link
Member

@qfox qfox Sep 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ого, это реально валидный cssnext?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет. Но без этого никуда похоже.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cssnext вроде как не поддерживает циклы @each и @for.
А без них в данном (и не только в этом) месте будет очень много лишнего повторяющегося кода.

width: 10px;
height: 14px;

background-image: url(../../theme/_islands/clear_size_s.svg);
Copy link
Member

@belozer belozer Sep 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tadatuta картинки не работают.
Возможно такой формат пути неправильный для борщика?

upd.
Если указывать явно (design/common.blocks), тогда всё работает
../../design/common.blocks/theme/_islands/clear_size_s.svg

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Проблема скорее всего в postcss-import.
Возможно нужны дополнительные настройки для импорта, чтобы пути правились на нужные. https://github.com/postcss/postcss-import#options

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно использовать опцию transform в связке с postcss-url.
По идее на work-flow тогда не повлияет. Можно будет дальше писать url в привычном стиле.

Но я до конца не уверен, нужно изучать (и стоит ли это того).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@belozyorcev попробуй { url: 'rebase' }

background-position: -$(borderWidth) $bgShift;
}

$bgShift: calc($bgShift - ($val + 1));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Теперь $bgShift нормальный (а то я на калькуляторе обсчитался и сдвиг был не тот)

@belozer
Copy link
Member

belozer commented Sep 7, 2016

Ради интереса сделал небольшую статистику по плагинам:
2016-09-07 03-12-04

Плагин для выявления "медленных" мест в PostCSS.
https://github.com/postcss/postcss-devtools

Может имеет смысл его включать в сборку?

@tadatuta tadatuta changed the title [WIP] Switch to postCSS Switch to postCSS Sep 23, 2016
@tadatuta tadatuta merged commit aa851b3 into v4 Sep 23, 2016
@tadatuta tadatuta deleted the issues/1535@v4 branch September 23, 2016 22:18
@tadatuta tadatuta removed the ready label Sep 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants