Skip to content
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

Thinking of IE 🤔 #104

Merged
merged 4 commits into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/spindle-ui/.storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
font-family: Meiryo, Yu Gothic Medium, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
</style>
<script>window.MSInputMethodContext && document.documentMode && document.write('<script src="https://cdn.jsdelivr.net/gh/nuxodin/ie11CustomProperties@4.1.0/ie11CustomProperties.min.js"><\x2fscript>');</script>
Copy link
Member Author

Choose a reason for hiding this comment

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

いくつか選択肢はあるけど、Storybookでは他のブラウザに影響を与えないこれで十分そう?なのでややお行儀の悪い方を入れてみました。

ref: #103 (comment)

Copy link
Contributor

@Dai7Igarashi Dai7Igarashi Nov 19, 2020

Choose a reason for hiding this comment

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

@media で IEでhover効いていないかもです。。。
https://caniuse.com/mdn-css_at-rules_media_hover

Copy link
Member Author

Choose a reason for hiding this comment

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

こりはわかりにくくて恐縮なのだけど、想定内の動作になるのだ・・!

#13

Copy link
Member Author

Choose a reason for hiding this comment

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

ドキュメントに記載しておきました〜 3a27ab0

3 changes: 3 additions & 0 deletions packages/spindle-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export function SomeButton() {
@import 'node_modules/@openameba/spindle-ui/Form/Checkbox.css';
```

## ブラウザサポート
Spindle UIはFirefox、Google Chrome、Microsoft Edge、Safariの最新版とInternet Explorer 11で動作確認しています。ただし、CSS custom propertiesを使用しているため、Internet Explorer 11での利用時には[ie11-custom-properties](https://www.npmjs.com/package/ie11-custom-properties)や[css-vars-ponyfill](https://github.com/jhildenbiddle/css-vars-ponyfill)などpolyfillとの併用が必要です。

## 開発方法

```
Expand Down
12 changes: 12 additions & 0 deletions packages/spindle-ui/src/Button/Button.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@
padding-right: 10px;
}

/*
* Setting height to a value less then min-height fixes the align-items: center issue in IE11
* @see https://github.com/philipwalton/flexbugs/issues/231#issue-245848315
*/
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
.spui-Button--large,
.spui-Button--medium,
.spui-Button--small {
height: 1px;
Copy link
Member Author

Choose a reason for hiding this comment

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

高さ自体はなんでもよさげさん?
ref: philipwalton/flexbugs#231 (comment)

}
}

/*
* Button variants
*/
Expand Down
5 changes: 4 additions & 1 deletion packages/spindle-ui/src/Button/Button.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, Story, Source } from '@storybook/addon-docs/blocks';
import { Description, Meta, Story, Source } from '@storybook/addon-docs/blocks';
import { actions } from '@storybook/addon-actions';
import { Button } from './Button';
import { PlusBold, ArrowRightBold, OpenblankFill } from '../Icon';
Expand Down Expand Up @@ -317,3 +317,6 @@ import { PlusBold, ArrowRightBold, OpenblankFill } from '../Icon';
<button class="spui-Button spui-Button--fullWidth spui-Button--small spui-Button--neutral"><span class="spui-Button-icon spui-Button-icon--small"><svg /></span>Neutral</button>
`}
/>

## Browser Compatibility
<Description>active時やhover時など各stateのスタイルは、ブラウザごとに異なります。詳しくは[ButtonのStateパターン変更](https://github.com/openameba/spindle/issues/13)を参照してください。</Description>