-
Notifications
You must be signed in to change notification settings - Fork 70
Добавляет новый baseline #1336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vitya-ne
wants to merge
16
commits into
doka-guide:main
Choose a base branch
from
vitya-ne:new-baseline
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Добавляет новый baseline #1336
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
93d77ab
Удаляет пакет `web-features`
vitya-ne d2ff87d
Добавляет `doka-baseline`
vitya-ne deb6d36
Корректирует стили
vitya-ne 0a14cfc
Переносит веб-компонет в `src/scripts/web-components`
vitya-ne 1e547a4
Добавляет поддержку состояния загрузки
vitya-ne 935bc89
Корректирует отступы
vitya-ne 7738dc2
Удаляет ссылки из дескрипшина, кооректирует текст
vitya-ne b8cea1c
Меняет формат исходника
vitya-ne d590291
Резервирует место
vitya-ne 94c1bf9
Исправляет сборку: Lit пакеты как зависимость платформы
vitya-ne f2b83fc
Исправляет резервацию места
vitya-ne 26b6bf0
Удаляет web-components из игнора
vitya-ne 766e04c
Добавляет показ имени группы в случае нескольких групп в конфиге
vitya-ne 085d83f
Добавляет ecmaVersion для поддержки class fields
vitya-ne f7e9e8a
Добавляет показ состояния загрузки
vitya-ne b3d428c
Показывает ссылки в одну строку
vitya-ne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,3 +10,4 @@ src/a11y | |
| src/pages | ||
| src/people | ||
| src/specials | ||
| src/scripts/web-components/*.build.js | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,9 @@ | ||
| <div class="wdi-browser-compat"> | ||
| <span class="wdi-browser-compat__label">Поддержка в браузерах:</span> | ||
| <ul class="wdi-browser-compat__items"> | ||
| {% for browser in baseline.keys %} | ||
| <li class="wdi-browser-compat__item"> | ||
| <span class="wdi-browser-compat__icon" data-browser="{{ browser }}"> | ||
| {% if baseline.supported[browser] %} | ||
| <span class="visually-hidden">{{ baseline.names[browser] }} {{ baseline.versions[browser] }}, поддерживается</span> | ||
| </span> | ||
| <span class="wdi-browser-compat__version" aria-hidden="true" data-compat="yes">{{ baseline.versions[browser] }}</span> | ||
| {% elif baseline.flagged[browser] %} | ||
| <span class="visually-hidden">{{ baseline.names[browser] }} {{ baseline.versions[browser] }}, за флагом</span> | ||
| <span class="wdi-browser-compat__version" aria-hidden="true" data-compat="flag"> | ||
| </span> | ||
| {% elif baseline.preview[browser] %} | ||
| <span class="visually-hidden">{{ baseline.names[browser] }}, превью</span> | ||
| <span class="wdi-browser-compat__version" aria-hidden="true" data-compat="preview"></span> | ||
| {% else %} | ||
| <span class="visually-hidden">{{ baseline.names[browser] }}, не поддерживается</span> | ||
| </span> | ||
| <span class="wdi-browser-compat__version" aria-hidden="true" data-compat="no"></span> | ||
| {% endif %} | ||
| </li> | ||
| {% endfor %} | ||
| </ul> | ||
| <a class="wdi-browser-compat__link" href="https://web.dev/baseline/" target="_blank">О Baseline</a> | ||
| </div> | ||
| {% if baseline.groupIds %} | ||
| <div class="wdi-browser-compat"> | ||
| <div class="wdi-browser-compat__items"> | ||
| {% for groupId in baseline.groupIds %} | ||
| <doka-baseline groupId="{{ groupId }}"></doka-baseline> | ||
| {% endfor %} | ||
| </div> | ||
| </div> | ||
| {% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,353 changes: 1,353 additions & 0 deletions
1,353
src/scripts/web-components/doka-baseline.build.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,118 +1,46 @@ | ||
| .wdi-browser-compat { | ||
| max-width: 87.5%; | ||
| margin-block-start: 40px; | ||
| margin-block-end: 20px; | ||
| align-items: center; | ||
| color: var(--color-light); | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| } | ||
|
|
||
| .wdi-browser-compat__items { | ||
| flex: 1 1 100%; | ||
| display: flex; | ||
| flex-direction: column; | ||
| flex-wrap: wrap; | ||
| margin: 1rem 0; | ||
| padding: 0; | ||
| gap: 24px; | ||
| list-style: none; | ||
| } | ||
|
|
||
| .wdi-browser-compat__item { | ||
| align-items: center; | ||
| display: flex; | ||
| justify-content: center; | ||
| } | ||
|
|
||
| .wdi-browser-compat__icon { | ||
| display: inline-block; | ||
| height: 24px; | ||
| margin-right: 6px; | ||
| width: 24px; | ||
| background-repeat: no-repeat no-repeat; | ||
| background-position: center center; | ||
| background-size: cover; | ||
| } | ||
|
|
||
| .wdi-browser-compat__icon[data-browser="chrome"] { | ||
| background-image: url("/images/baseline/chrome.svg"); | ||
| } | ||
|
|
||
| .wdi-browser-compat__icon[data-browser="firefox"] { | ||
| background-image: url("/images/baseline/firefox.svg"); | ||
| doka-baseline { | ||
| min-height: 64px; | ||
| } | ||
|
|
||
| .wdi-browser-compat__icon[data-browser="edge"] { | ||
| background-image: url("/images/baseline/edge.svg"); | ||
| } | ||
|
|
||
| .wdi-browser-compat__icon[data-browser="safari"] { | ||
| background-image: url("/images/baseline/safari.svg"); | ||
| } | ||
|
|
||
| .wdi-browser-compat__version { | ||
| box-sizing: border-box; | ||
| --size-2: clamp(0.75rem, 0.71rem + 0.18vw, 0.875rem); | ||
| background-repeat: no-repeat no-repeat; | ||
| background-position: center center; | ||
| background-origin: content-box; | ||
| border-radius: 10000px; | ||
| display: inline-block; | ||
| font-size: var(--size-2); | ||
| height: 24px; | ||
| line-height: 24px; | ||
| min-width: 24px; | ||
| text-align: center; | ||
| padding-inline: 0.5ch; | ||
| } | ||
|
|
||
| .wdi-browser-compat__version[data-compat="yes"] { | ||
| background: var(--wdi-success-bg-color, #e9f6ed); | ||
| color: var(--wdi-success-color, #0d652d); | ||
| } | ||
|
|
||
| .wdi-browser-compat__version[data-compat="flag"] { | ||
| background-color: var(--wdi-warn-bg-color, #fff5e3); | ||
| background-image: url("/images/baseline/flag.svg"); | ||
| color: var(--wdi-warn-color, #c34900); | ||
| } | ||
|
|
||
| .wdi-browser-compat__version[data-compat="no"] { | ||
| background-color: var(--wdi-error-bg-color, #fce8e8); | ||
| background-image: url("/images/baseline/no.svg"); | ||
| color: var(--wdi-error-color, #a50e0e); | ||
| } | ||
|
|
||
| .wdi-browser-compat__version[data-compat="preview"] { | ||
| padding: 2px; | ||
| background-color: var(--wdi-warn-bg-color, #fff5e3); | ||
| background-image: url("/images/baseline/preview.svg"); | ||
| color: var(--wdi-warn-color, #c34900); | ||
| } | ||
|
|
||
| .wdi-browser-compat__link { | ||
| flex: 0 0 100%; | ||
| margin-left: 0; | ||
| color: currentColor; | ||
| } | ||
|
|
||
| @media (width >= 50em) { | ||
| @media (width >= 768px) { | ||
| .wdi-browser-compat { | ||
| flex-wrap: nowrap; | ||
| max-width: 81%; | ||
| } | ||
| } | ||
|
|
||
| .wdi-browser-compat__label { | ||
| flex: none; | ||
| margin-bottom: 0; | ||
| width: auto; | ||
| @media (width >= 1024px) { | ||
| .wdi-browser-compat { | ||
| max-width: 87.5%; | ||
| } | ||
| } | ||
|
|
||
| .wdi-browser-compat__link { | ||
| flex: none; | ||
| margin-left: auto; | ||
| @media not all and (width >= 1024px) { | ||
| .wdi-browser-compat { | ||
| padding: inherit; | ||
| } | ||
| } | ||
|
|
||
| @media (width >= 600px) { | ||
| .wdi-browser-compat__label { | ||
| margin-right: 24px; | ||
| @media (width >= 1680px) { | ||
| .wdi-browser-compat { | ||
| max-width: 100%; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не стоит хранить минифицированную версию в репозитории. Тут нужны либо полные исходники, либо выносить оригинальный код в npm-пакет.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Возможно это именно то, что меня долго тормозило на старте - непонимание как "правильно" веб-компонент должен подключаться к платформе.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для этого есть бандлер
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ок. добавлю исходник )
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В самом начале файла есть минифицированный код, как полагаю, для Lit. В идеале нужно поставить его как зависимость и импортировать:
Это нужно для того, чтобы бандлер смог включить лишь одну версию Lit, если его захочется использовать его где-то ещё.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
да это Lit.
Звучит разумно, но не знаю как это осуществить. Сборка компонента делается рекомендованным конфигом Lit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
вот мои импорты из Lit:

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monochromer Вроде получилось, спасибо за комент