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

Upgrade prettier and stylelint #2146

Merged
merged 21 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
21d7b7a
⬆️ Upgrade prettier
RasmusKjeldgaard Mar 28, 2022
481846d
💄 Lint and prettify cookbook styles
RasmusKjeldgaard Mar 29, 2022
8d8cd90
🎨 Lint and prettify cookbook ts files
RasmusKjeldgaard Mar 29, 2022
1fc95ad
🎨 Lint and prettify cookbook templates
RasmusKjeldgaard Mar 29, 2022
b52a835
🔧 Update prettier and stylelint config
RasmusKjeldgaard Mar 29, 2022
6aa68ce
🎨 Lint and prettify misc project files
RasmusKjeldgaard Mar 29, 2022
d6d0cf4
🎨 Lint and prettify designsystem styles
RasmusKjeldgaard Mar 29, 2022
2073fc8
🤡 Use same line endings across mocks
RasmusKjeldgaard Mar 29, 2022
26bcef7
🎨 Lint and prettify designsystem spec files
RasmusKjeldgaard Mar 29, 2022
8c779ff
🎨 Lint and prettify designsystem ts files
RasmusKjeldgaard Mar 29, 2022
309c0e7
💄 Rename css-class in template
RasmusKjeldgaard Mar 29, 2022
0e15ad9
✅ Fix tab test according to changed css
RasmusKjeldgaard Mar 29, 2022
63c5432
🙈 Update ignore files with newline at EOF
RasmusKjeldgaard Mar 31, 2022
79b95ee
♻️ Increase readability of span
RasmusKjeldgaard Mar 31, 2022
ef1fccc
🔧 Prettify .stylelintrc (whoa, meta!)
RasmusKjeldgaard Mar 31, 2022
297740b
➖ Remove unused depencency
RasmusKjeldgaard Mar 31, 2022
1f619d7
💄 Replace duplicate ::after with ::before for print
RasmusKjeldgaard Mar 31, 2022
24deda8
⏪ Revert unintentional prettier change
RasmusKjeldgaard Mar 31, 2022
0fd76dc
🔥 Remove vendor prefix
RasmusKjeldgaard Mar 31, 2022
01c3efe
⏪ Revert unintentional change to line clamp styles
RasmusKjeldgaard Mar 31, 2022
1d2770e
Merge branch 'main' into housekeeping/2103-upgrade-prettier
RasmusKjeldgaard Apr 1, 2022
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
5 changes: 3 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/src/kirby/scss/base/_include-media.scss
/.github/
/libs/designsystem/src/lib/components/web-component-proxies.component.ts
/libs/designsystem/src/lib/components/angular-component-lib/**
/libs/core/scss/**
/libs/core/dist/**
/libs/core/loader/**
/libs/core/component-docs.d.ts
/libs/core/component-docs.json
/libs/core/src/components.d.ts
/libs/**/readme.md
/libs/**/readme.md
/node_modules/
RasmusKjeldgaard marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 12 additions & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
/src/kirby/scss/base/_include-media.scss
libs/core/scss/**
/.github/
/libs/designsystem/src/lib/components/web-component-proxies.component.ts
/libs/designsystem/src/lib/components/angular-component-lib/**
/libs/core/scss/**
/libs/core/dist/**
/libs/core/loader/**
/libs/core/component-docs.d.ts
/libs/core/component-docs.json
/libs/core/src/components.d.ts
/libs/**/readme.md
/node_modules/
RasmusKjeldgaard marked this conversation as resolved.
Show resolved Hide resolved
28 changes: 25 additions & 3 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
{
"plugins": ["stylelint-prettier"],
"extends": ["stylelint-prettier/recommended"],
"extends": [
"stylelint-config-standard-scss",
"stylelint-config-prettier-scss"
],
"rules": {
"scss/at-mixin-pattern": [
"^(-?_?[a-z][a-z0-9]*)(-[a-z0-9]+)*$",
{
"message": "Expected mixin name to be kebab-case"
}
],
"scss/at-function-pattern": [
"^(-?_?[a-z][a-z0-9]*)(-[a-z0-9]+)*$",
{
"message": "Expected function name to be kebab-case"
}
],
"scss/dollar-variable-pattern": [
"^(-?_?[a-z][a-z0-9]*)(-[a-z0-9]+)*$",
{
"message": "Expected variable to be kebab-case"
}
],
"scss/at-extend-no-missing-placeholder": null,
"no-descending-specificity": null
}
RasmusKjeldgaard marked this conversation as resolved.
Show resolved Hide resolved
}
}
RasmusKjeldgaard marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion apps/cookbook/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const { join } = require('path');
const getBaseKarmaConfig = require('../../karma.conf');

module.exports = function(config) {
module.exports = function (config) {
const baseConfig = getBaseKarmaConfig();
config.set({
...baseConfig,
Expand Down
20 changes: 5 additions & 15 deletions apps/cookbook/src/app/accessibility/accessibility-guidelines.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<h1>Accessibility in Kirby</h1>

<h2>Can Kirby make an application accessible?</h2>
<p>
The short answer is no.
</p>
<p>The short answer is no.</p>
<p>
The accessibility of an application largely depends on its markup. In other words, it depends on
how the components in Kirby are used. The role of the components is to allow for developers to
Expand Down Expand Up @@ -32,9 +30,7 @@ <h2>Can Kirby make an application accessible?</h2>
>exploring new ways of improving your product for everyone</a
>.
</p>
<p>
So where do you begin? Our suggestion is to read on!
</p>
<p>So where do you begin? Our suggestion is to read on!</p>

<h3>Mindset - what is accessibility?</h3>
<p>
Expand All @@ -43,9 +39,7 @@ <h3>Mindset - what is accessibility?</h3>
</p>

<h4>Accessibility is not a feature</h4>
<p>
Accessibility is not something that is tagged onto an application like a feature.
</p>
<p>Accessibility is not something that is tagged onto an application like a feature.</p>
<p>
<strong>All</strong> applications have some degree of accessibility, whether it is considered or
not. If it is not actively prioritized, the accessibility of an application is most likely poor.
Expand Down Expand Up @@ -134,9 +128,7 @@ <h3>Do not be in the way</h3>
allows for accessibility. On the contrary, it is also possible to use them in a lot of
completely inaccessible ways.
</p>
<p>
But the components in Kirby should never be in the way of making an application accessible.
</p>
<p>But the components in Kirby should never be in the way of making an application accessible.</p>
<p>
If a developer ever experiences that a Kirby component causes problems when working with
accessibility; do not hesitate to create an issue in the
Expand Down Expand Up @@ -231,9 +223,7 @@ <h3>Topics for exploration</h3>
<h3>Resources</h3>
<p>
While a11y.coffee has a
<a target="blank" href="https://a11y.coffee/dig-in/">
list of resources
</a>
<a target="blank" href="https://a11y.coffee/dig-in/"> list of resources </a>
to further explore the field of accessibility, we would like to supplement that with some of our
own resources:
</p>
Expand Down
Empty file.
1 change: 0 additions & 1 deletion apps/cookbook/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Component } from '@angular/core';
@Component({
selector: 'cookbook-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
title = 'Kirby design system';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

.github-error {
font-style: italic;

ion-icon[name='alert'] {
font-size: 24px;
vertical-align: text-bottom;
Expand Down Expand Up @@ -44,6 +45,7 @@
tr {
&.component {
vertical-align: middle;
border-top: 0.1rem solid utils.get-color('medium');

.component {
ion-icon {
Expand All @@ -66,10 +68,6 @@
}
}

&.component {
border-top: 0.1rem solid utils.get-color('medium');
}

&.subcomponent,
&.enhancement {
vertical-align: middle;
Expand Down Expand Up @@ -101,6 +99,7 @@
&-subcomponent td:first-child {
padding-left: 2rem;
}

ion-icon[name='add-circle'] {
font-size: 16px;
vertical-align: sub;
Expand All @@ -126,7 +125,7 @@
}
}

a[href^="https://"] ion-icon {
a[href^='https:\/\/'] ion-icon {
vertical-align: sub;
font-size: 18px;

Expand All @@ -140,6 +139,7 @@

&.version {
margin-left: 0.5rem;

--ion-color-base: #{utils.get-color('semi-dark')};
--ion-color-contrast: #{utils.get-color('white')};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ export class ComponentStatusComponent implements OnInit, OnDestroy {
// https://app.zeplin.io/project/5e1f27f01ffb15bd95efc426/screen/5e46809806041da857a4bf49
// https://app.zeplin.io/styleguide/5e7094006caa6013a71590b8/components?seid=5e466bc4394e31b73d693e4e
// https://app.zeplin.io/styleguide/5e734ec04ee3d6bac20654e2/components?cseid=5fa2b58acbcb0e8512f515ee
const regex = /(https:\/\/(app\.zeplin|zpl)\.io\/)((project\/[a-z,0-9]{24}\/screen\/[a-z,0-9]{24})|(\b(?!project)[a-z,0-9]{7}\b)|(styleguide\/[a-z,0-9]{24}\/components\?(seid|cseid)\=[a-z,0-9]{24}))/i;
const regex =
/(https:\/\/(app\.zeplin|zpl)\.io\/)((project\/[a-z,0-9]{24}\/screen\/[a-z,0-9]{24})|(\b(?!project)[a-z,0-9]{7}\b)|(styleguide\/[a-z,0-9]{24}\/components\?(seid|cseid)\=[a-z,0-9]{24}))/i;
let matches = issue.body.match(regex);
const url = matches ? matches[0] : null;
return url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@ cookbook-card-example {
display: inline-block;
width: 257px;
height: 362px;

--kirby-card-background-image: url('/assets/kirby/backgrounds/kirby-card.png');

&.show-background {
--kirby-example-wireframe-color: rgba(255, 0, 0, 0.5);
--kirby-example-wireframe-color: rgb(255 0 0 / 50%);
jkaltoft marked this conversation as resolved.
Show resolved Hide resolved

background-image: var(--kirby-card-background-image);
background-position: -1px -1px;
background-repeat: no-repeat;
background-size: 257px;

&.dim-background {
--kirby-example-wireframe-color: red;
background-image: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),

background-image: linear-gradient(rgb(255 255 255 / 50%), rgb(255 255 255 / 50%)),
var(--kirby-card-background-image);

footer kirby-button {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use 'avatar-examples.shared.scss';
@use "~@kirbydesign/core/src/scss/utils";
@use '~@kirbydesign/core/src/scss/utils';
RasmusKjeldgaard marked this conversation as resolved.
Show resolved Hide resolved

:host {
padding: utils.size('l');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use "sass:map";
@use 'sass:map';
RasmusKjeldgaard marked this conversation as resolved.
Show resolved Hide resolved
@use '~@kirbydesign/core/src/scss/utils';

:host {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ <h2>Sizes</h2>
*ngFor="let size of buttonSizes"
value="{{ size.value }}"
[attr.selected]="buttonSize === size.value ? true : null"
>{{ size.text }}</option
>
{{ size.text }}
</option>
</select>
</fieldset>

Expand Down Expand Up @@ -96,9 +97,7 @@ <h3>Custom Icon</h3>
<label>Disabled</label>
</div>

<h2>
Button with icon and text
</h2>
<h2>Button with icon and text</h2>
RasmusKjeldgaard marked this conversation as resolved.
Show resolved Hide resolved
<button kirby-button [size]="buttonSize">
<kirby-icon name="edit"></kirby-icon>
Icon Left
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use "sass:map";
@use 'sass:map';
@use '~@kirbydesign/core/src/scss/utils';

kirby-card {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
kirby-card {
z-index: 3; // Ensure dropdown opens over configuration checkboxes
overflow: visible; // Ensure dropdown isn't cut off

width: 320px;
margin-bottom: 20px;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ kirby-card.show-size {
&::before {
background-color: #ccc;
color: white;
content: '-'; //"\00a0";
content: '-'; // "\00a0";
RasmusKjeldgaard marked this conversation as resolved.
Show resolved Hide resolved
font-size: 0.8em;
font-weight: 700;
letter-spacing: 0.1em;
Expand All @@ -45,23 +45,26 @@ kirby-card.show-size {
width: 6em;
border-top-left-radius: 25%;
border-top-right-radius: 25%;
box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0 6px 8px rgb(0 0 0 / 30%);
}

--cardSmallBackgroundColor: #8dabee;
--cardMediumBackgroundColor: #d2a2ee;
--cardLargeBackgroundColor: #d8b280;
--card-small-background-color: #8dabee;
--card-medium-background-color: #d2a2ee;
--card-large-background-color: #d8b280;

&[size='<small']::before,
&[size='small']::before {
content: 'SM';
background-color: var(--cardSmallBackgroundColor);
background-color: var(--card-small-background-color);
}

&[size='medium']::before {
content: 'MD';
background-color: var(--cardMediumBackgroundColor);
background-color: var(--card-medium-background-color);
}

&[size='large']::before {
content: 'LG';
background-color: var(--cardLargeBackgroundColor);
background-color: var(--card-large-background-color);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@
kirby-card {
--kirby-card-background-image: linear-gradient(
0deg,
rgba(255, 255, 255, 0) 0%,
rgba(0, 0, 0, 0.6) 100%
rgb(255 255 255 / 0%) 0%,
rgb(0 0 0 / 60%) 100%
),
url('https://images.unsplash.com/photo-1512917774080-9991f1c4c750');

@include utils.media('>=medium') {
--kirby-card-background-image: linear-gradient(
0deg,
rgba(255, 255, 255, 0) 0%,
rgba(0, 0, 0, 0.4) 100%
rgb(255 255 255 / 0%) 0%,
rgb(0 0 0 / 40%) 100%
),
url('https://images.unsplash.com/photo-1560840067-ddcaeb7831d2');
}

min-height: 300px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,7 @@ export class ChartDeprecatedExampleAreasplineComponent {
template = config.template;

data = [
1600.9,
1710.5,
1060.4,
1290.2,
1440.0,
1460.0,
1350.6,
1480.5,
1800.4,
1940.1,
1950.6,
1700.4,
1600.9,
1710.5,
1060.4,
1290.2,
1440.0,
1460.0,
1350.6,
1480.5,
1800.4,
1940.1,
1950.6,
1700.4,
1600.9, 1710.5, 1060.4, 1290.2, 1440.0, 1460.0, 1350.6, 1480.5, 1800.4, 1940.1, 1950.6, 1700.4,
1600.9, 1710.5, 1060.4, 1290.2, 1440.0, 1460.0, 1350.6, 1480.5, 1800.4, 1940.1, 1950.6, 1700.4,
jkaltoft marked this conversation as resolved.
Show resolved Hide resolved
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { DesignTokenHelper, ModalController } from '@kirbydesign/designsystem';
const getColor = DesignTokenHelper.getColor;

function colorPoints(selectedYear: string) {
return function() {
return function () {
var series = this.series;
for (var i = 0, ie = series.length; i < ie; ++i) {
var points = series[i].data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DesignTokenHelper, ModalController } from '@kirbydesign/designsystem';

const getColor = DesignTokenHelper.getColor;
function colorPoints(selectedIdx) {
return function() {
return function () {
var series = this.series;
for (var i = 0, ie = series.length; i < ie; ++i) {
var points = series[i].data;
Expand Down
Loading