Skip to content

Commit

Permalink
Merge pull request #489 from 3YOURMIND/drop-internet-explorer-support
Browse files Browse the repository at this point in the history
chore(kotti): Drop IE Support
  • Loading branch information
FlorianWendelborn committed Sep 3, 2021
2 parents 8b1e1aa + fb36dda commit 1df82b7
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 34 deletions.
9 changes: 0 additions & 9 deletions packages/documentation/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
</template>

<script>
import cssVars from 'css-vars-ponyfill'
import ActionBar from '~/components/ActionBar.vue'
import LayoutContainer from '~/components/LayoutContainer.vue'
import NavBar from '~/components/NavBar.vue'
Expand All @@ -24,13 +22,6 @@ export default {
NavBar,
LayoutContainer,
},
mounted() {
// loading IE11 polyfill
const isIE = !!window.MSInputMethodContext && !!document.documentMode
if (isIE) {
cssVars({ watch: true, shadowDOM: true, onlyLegacy: true })
}
},
}
</script>

Expand Down
1 change: 0 additions & 1 deletion packages/documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"@types/marked": "^1.1.0",
"@types/natural-sort": "^0.0.20",
"case-sensitive-paths-webpack-plugin": "^2.3.0",
"css-vars-ponyfill": "^2.2.0",
"nuxt": "^2.13.3"
},
"homepage": "https://github.com/3YOURMIND/kotti#readme",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ It also open us to a lot of theming features.
## Usage

We store the tokens in JSON files. We can then easily export these to SCSS, CSS custom properties
and even figma styles for colors!
We enforce CSS custom properties over SCSS variables.
The `ie11-custom-properties` package ensure IE11 support.
Here is how weuse CSS custom properties:
and even figma styles for colors.
We prefer CSS custom properties over SCSS variables.
Here is how we use CSS custom properties:

```css
/* set a css custom property */
Expand Down
12 changes: 9 additions & 3 deletions packages/documentation/pages/foundations/colors/theming.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
You can apply your own theme to the kotti design system.
Since we are defining design tokens with CSS custom properties, you can override any of them easily, on the fly.

> We are defining every custom props on `:root` because only root variables are supported by [css-vars-ponyfill](https://github.com/jhildenbiddle/css-vars-ponyfill), the ponyfill we are using.
> If you don't care about IE11 support, you can overwrite custom props on any element.

## Method 1: CSS file

One easy way of theming kotti component is to overwrite custom props using CSS diretcly. You will need to load this file after loading kotti CSS tho.

Example:

```css
.kt-navbar {
--navbar-background: red;
--navbar-color: blue;
}
```

or

```css
:root {
--navbar-background: red;
Expand Down
3 changes: 1 addition & 2 deletions packages/documentation/pages/usage/components/accordion.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<template lang="md">
<ComponentInfo v-bind="{ component }" />

An accordion for hiding content on click.
It is animated but the animation doesn't work with IE11.
An animated accordion for hiding content on click.

```html
<KtAccordion title="Accordion">
Expand Down
3 changes: 1 addition & 2 deletions packages/kotti-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"author": "3YOURMIND GmbH",
"browserslist": [
"defaults",
"IE 11"
"defaults"
],
"bugs": {
"url": "https://github.com/3YOURMIND/kotti/issues"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ export default defineComponent({
border: 1px solid var(--ui-02);
border-radius: var(--field-border-radius);
// remove scrollbar from IE entirely
-ms-overflow-style: none;
&::-webkit-scrollbar {
opacity: 0;
}
Expand Down
5 changes: 0 additions & 5 deletions packages/kotti-ui/source/kotti-navbar/KtNavbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ export default defineComponent<KottiNavbar.PropsInternal>({
$mobile-navbar-height: 2.4rem;
$narrow-navbar-width: 3.4rem;
// We declare it twice because IE11
// It needs it in the :root for old and locally for modern
:root,
.kt-navbar {
--navbar-background: var(--primary-70);
--navbar-border: var(--primary-60);
Expand All @@ -128,9 +125,7 @@ $narrow-navbar-width: 3.4rem;
--user-menu-background-active: var(--primary-70);
--user-menu-background: var(--primary-60);
--user-menu-color: var(--primary-10);
}
.kt-navbar {
position: relative;
top: 0;
bottom: 0;
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7472,11 +7472,6 @@ css-tree@^1.0.0:
mdn-data "2.0.14"
source-map "^0.6.1"

css-vars-ponyfill@^2.2.0:
version "2.3.2"
resolved "https://registry.yarnpkg.com/css-vars-ponyfill/-/css-vars-ponyfill-2.3.2.tgz#688c990d33d7d4651a2a8dd3a99d8e7458f6e20e"
integrity sha512-XkZfj0ROhem0Zdv44+LF15COsYmxnqL7Wd/gvwuWAauYoALbt2x94b6dIKF9fB6SIyOMYEQngA82t9RnC6b/aw==

css-what@2.1:
version "2.1.3"
resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2"
Expand Down

0 comments on commit 1df82b7

Please sign in to comment.