Move icon font to DS, add button icon styles

pull/10200/head
Benjamin Bädorf 3 years ago
parent 0bfd495e01
commit c2d7001941
No known key found for this signature in database
GPG Key ID: 069CA2D117AB5CCF
  1. 26386
      frontend/package-lock.json
  2. 2
      frontend/package.json
  3. 4
      frontend/src/app/spot/components/drop-modal/drop-modal.component.html
  4. 0
      frontend/src/app/spot/icon-font/LICENSE.md
  5. 0
      frontend/src/app/spot/icon-font/README.md
  6. 58
      frontend/src/app/spot/icon-font/generate.js
  7. 28
      frontend/src/app/spot/icon-font/icon.template.sass
  8. 0
      frontend/src/app/spot/icon-font/openproject-icon-font.template.lsg
  9. 9
      frontend/src/app/spot/icon-font/openproject-icon-font.template.sass
  10. 0
      frontend/src/app/spot/icon-font/src/accessibility.svg
  11. 0
      frontend/src/app/spot/icon-font/src/accountable.svg
  12. 0
      frontend/src/app/spot/icon-font/src/add.svg
  13. 0
      frontend/src/app/spot/icon-font/src/align-center.svg
  14. 0
      frontend/src/app/spot/icon-font/src/align-justify.svg
  15. 0
      frontend/src/app/spot/icon-font/src/align-left.svg
  16. 0
      frontend/src/app/spot/icon-font/src/align-right.svg
  17. 0
      frontend/src/app/spot/icon-font/src/arrow-down1.svg
  18. 0
      frontend/src/app/spot/icon-font/src/arrow-down2.svg
  19. 0
      frontend/src/app/spot/icon-font/src/arrow-left-right.svg
  20. 0
      frontend/src/app/spot/icon-font/src/arrow-left1.svg
  21. 0
      frontend/src/app/spot/icon-font/src/arrow-left2.svg
  22. 0
      frontend/src/app/spot/icon-font/src/arrow-left3.svg
  23. 0
      frontend/src/app/spot/icon-font/src/arrow-left4.svg
  24. 0
      frontend/src/app/spot/icon-font/src/arrow-right2.svg
  25. 0
      frontend/src/app/spot/icon-font/src/arrow-right3.svg
  26. 0
      frontend/src/app/spot/icon-font/src/arrow-right4.svg
  27. 0
      frontend/src/app/spot/icon-font/src/arrow-right5.svg
  28. 0
      frontend/src/app/spot/icon-font/src/arrow-right6.svg
  29. 0
      frontend/src/app/spot/icon-font/src/arrow-right7.svg
  30. 0
      frontend/src/app/spot/icon-font/src/arrow-thin.svg
  31. 0
      frontend/src/app/spot/icon-font/src/arrow-up1.svg
  32. 0
      frontend/src/app/spot/icon-font/src/arrow-up2.svg
  33. 0
      frontend/src/app/spot/icon-font/src/assigned-to-me.svg
  34. 0
      frontend/src/app/spot/icon-font/src/assigned.svg
  35. 0
      frontend/src/app/spot/icon-font/src/attachment.svg
  36. 0
      frontend/src/app/spot/icon-font/src/attention.svg
  37. 0
      frontend/src/app/spot/icon-font/src/back-up.svg
  38. 0
      frontend/src/app/spot/icon-font/src/backlogs.svg
  39. 0
      frontend/src/app/spot/icon-font/src/bcf.svg
  40. 0
      frontend/src/app/spot/icon-font/src/bell.svg
  41. 0
      frontend/src/app/spot/icon-font/src/billing-information.svg
  42. 0
      frontend/src/app/spot/icon-font/src/boards.svg
  43. 0
      frontend/src/app/spot/icon-font/src/bold.svg
  44. 0
      frontend/src/app/spot/icon-font/src/budget.svg
  45. 0
      frontend/src/app/spot/icon-font/src/bug.svg
  46. 0
      frontend/src/app/spot/icon-font/src/calendar.svg
  47. 0
      frontend/src/app/spot/icon-font/src/calendar2.svg
  48. 0
      frontend/src/app/spot/icon-font/src/camera.svg
  49. 0
      frontend/src/app/spot/icon-font/src/cancel.svg
  50. 0
      frontend/src/app/spot/icon-font/src/cart.svg
  51. 0
      frontend/src/app/spot/icon-font/src/changeset-down.svg
  52. 0
      frontend/src/app/spot/icon-font/src/changeset-up.svg
  53. 0
      frontend/src/app/spot/icon-font/src/changeset.svg
  54. 0
      frontend/src/app/spot/icon-font/src/chart1.svg
  55. 0
      frontend/src/app/spot/icon-font/src/chart2.svg
  56. 0
      frontend/src/app/spot/icon-font/src/chart3.svg
  57. 0
      frontend/src/app/spot/icon-font/src/checkmark.svg
  58. 0
      frontend/src/app/spot/icon-font/src/close.svg
  59. 0
      frontend/src/app/spot/icon-font/src/code-tag.svg
  60. 0
      frontend/src/app/spot/icon-font/src/color-text.svg
  61. 0
      frontend/src/app/spot/icon-font/src/color-underline.svg
  62. 0
      frontend/src/app/spot/icon-font/src/column-left.svg
  63. 0
      frontend/src/app/spot/icon-font/src/column-right.svg
  64. 0
      frontend/src/app/spot/icon-font/src/columns.svg
  65. 0
      frontend/src/app/spot/icon-font/src/compare2.svg
  66. 0
      frontend/src/app/spot/icon-font/src/concept.svg
  67. 0
      frontend/src/app/spot/icon-font/src/console-light.svg
  68. 0
      frontend/src/app/spot/icon-font/src/console.svg
  69. 0
      frontend/src/app/spot/icon-font/src/contacts.svg
  70. 0
      frontend/src/app/spot/icon-font/src/copy.svg
  71. 0
      frontend/src/app/spot/icon-font/src/cost-reports.svg
  72. 0
      frontend/src/app/spot/icon-font/src/cost-types.svg
  73. 0
      frontend/src/app/spot/icon-font/src/cursor.svg
  74. 0
      frontend/src/app/spot/icon-font/src/custom-development.svg
  75. 0
      frontend/src/app/spot/icon-font/src/custom-fields.svg
  76. 0
      frontend/src/app/spot/icon-font/src/cut.svg
  77. 0
      frontend/src/app/spot/icon-font/src/delete-folder.svg
  78. 0
      frontend/src/app/spot/icon-font/src/delete.svg
  79. 0
      frontend/src/app/spot/icon-font/src/dependency.svg
  80. 0
      frontend/src/app/spot/icon-font/src/design.svg
  81. 0
      frontend/src/app/spot/icon-font/src/double-arrow-left.svg
  82. 0
      frontend/src/app/spot/icon-font/src/double-arrow-right.svg
  83. 0
      frontend/src/app/spot/icon-font/src/download.svg
  84. 0
      frontend/src/app/spot/icon-font/src/drag-handle.svg
  85. 0
      frontend/src/app/spot/icon-font/src/duplicate.svg
  86. 0
      frontend/src/app/spot/icon-font/src/edit.svg
  87. 0
      frontend/src/app/spot/icon-font/src/email-alert.svg
  88. 0
      frontend/src/app/spot/icon-font/src/enterprise.svg
  89. 0
      frontend/src/app/spot/icon-font/src/enumerations.svg
  90. 0
      frontend/src/app/spot/icon-font/src/error.svg
  91. 0
      frontend/src/app/spot/icon-font/src/export-atom.svg
  92. 0
      frontend/src/app/spot/icon-font/src/export-bcf.svg
  93. 0
      frontend/src/app/spot/icon-font/src/export-csv.svg
  94. 0
      frontend/src/app/spot/icon-font/src/export-pdf-descr.svg
  95. 0
      frontend/src/app/spot/icon-font/src/export-pdf-with-descriptions.svg
  96. 0
      frontend/src/app/spot/icon-font/src/export-pdf.svg
  97. 0
      frontend/src/app/spot/icon-font/src/export-xls-descr.svg
  98. 0
      frontend/src/app/spot/icon-font/src/export-xls-with-descriptions.svg
  99. 0
      frontend/src/app/spot/icon-font/src/export-xls-with-relations.svg
  100. 0
      frontend/src/app/spot/icon-font/src/export-xls.svg
  101. Some files were not shown because too many files have changed in this diff Show More

File diff suppressed because it is too large Load Diff

@ -59,6 +59,7 @@
"theo": "^8.1.5", "theo": "^8.1.5",
"ts-node": "~8.3.0", "ts-node": "~8.3.0",
"typescript": "~4.2.4", "typescript": "~4.2.4",
"webfonts-generator": "^0.4.0",
"webpack-bundle-analyzer": "^4.4.2" "webpack-bundle-analyzer": "^4.4.2"
}, },
"dependencies": { "dependencies": {
@ -146,6 +147,7 @@
"build": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --configuration production --named-chunks --extract-css --source-map", "build": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --configuration production --named-chunks --extract-css --source-map",
"build:watch": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --watch --named-chunks --extract-css", "build:watch": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --watch --named-chunks --extract-css",
"tokens:generate": "theo src/app/spot/styles/tokens/tokens.yml --transform web --format sass,json --dest src/app/spot/styles/tokens/dist", "tokens:generate": "theo src/app/spot/styles/tokens/tokens.yml --transform web --format sass,json --dest src/app/spot/styles/tokens/dist",
"icon-font:generate": "node ./src/app/spot/icon-font/generate.js ./src/app/spot/icon-font",
"preserve": "./scripts/link_plugin_placeholder.js", "preserve": "./scripts/link_plugin_placeholder.js",
"serve": "NG_PERSISTENT_BUILD_CACHE=1 node --max_old_space_size=8096 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --public-host http://localhost:4200", "serve": "NG_PERSISTENT_BUILD_CACHE=1 node --max_old_space_size=8096 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --public-host http://localhost:4200",
"serve:test": "NG_PERSISTENT_BUILD_CACHE=1 node --max_old_space_size=8096 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --disable-host-check --public-host http://frontend-test:4200", "serve:test": "NG_PERSISTENT_BUILD_CACHE=1 node --max_old_space_size=8096 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --disable-host-check --public-host http://frontend-test:4200",

@ -6,10 +6,10 @@
<ng-content select="[slot=body]"></ng-content> <ng-content select="[slot=body]"></ng-content>
</div> </div>
<button <button
class="spot-drop-modal--close-button spot-button spot-button" class="spot-drop-modal--close-button spot-button"
type="button" type="button"
aria-label="Close" aria-label="Close"
(click)="close()" (click)="close()"
> >
<span class="icon-close"></span> <span class="spot-icon spot-icon_close"></span>
</button> </button>

@ -0,0 +1,58 @@
#!/usr/bin/env node
const webfontsGenerator = require('webfonts-generator');
const path = require('path');
const fs = require('fs');
const glob = require("glob")
const TEMPLATE_DIR = path.resolve(process.argv[2]);
const CSS_FONT_URL = "../../../../../frontend/src/assets/fonts/openproject_icon/";
const FONT_DESTINATION = path.resolve(__dirname, '..', '..', '..', '..', '..', 'frontend', 'src', 'assets', 'fonts', 'openproject_icon');
const files = glob.sync(path.join(TEMPLATE_DIR, 'src/*.svg'));
webfontsGenerator({
files,
"fontName": "openproject-icon-font",
"cssFontsUrl": CSS_FONT_URL,
"dest": FONT_DESTINATION,
"cssDest": path.join(
path.resolve(__dirname, '..', 'styles', 'sass', 'common'),
'icon.sass',
),
"cssTemplate": path.join(TEMPLATE_DIR, "icon.template.sass"),
"types": ['woff2', 'woff'],
"fixedWidth": true,
"descent": 100
}, function(error) {
if (error) {
console.log('Failed to build icon font. ', error);
}
});
webfontsGenerator({
files,
"fontName": "openproject-icon-font",
"cssFontsUrl": CSS_FONT_URL,
"dest": FONT_DESTINATION,
"cssDest": path.join(
path.resolve(__dirname, '..', '..', '..', '..', '..', 'frontend', 'src', 'global_styles', 'fonts'),
'_openproject_icon_definitions.sass',
),
"cssTemplate": path.join(TEMPLATE_DIR, "openproject-icon-font.template.sass"),
"classPrefix": "icon-",
"baseSelector": ".icon",
"html": true,
"htmlDest": path.join(
path.resolve(__dirname, '..', '..', '..', '..', '..', 'frontend', 'src', 'global_styles', 'fonts'),
'_openproject_icon_font.lsg',
),
"htmlTemplate": path.join(TEMPLATE_DIR, "openproject-icon-font.template.lsg"),
"types": ['woff2', 'woff'],
"fixedWidth": true,
"descent": 100
}, function(error) {
if (error) {
console.log('Failed to build icon font. ', error);
}
});

@ -0,0 +1,28 @@
.spot-icon
display: inline-flex
justify-content: center
align-items: center
&::before
font-family: "openproject-icon-font"
font-style: normal
font-weight: normal
font-variant: normal
font-size: inherit
text-transform: none
text-decoration: none
display: block
speak: none
line-height: 1
-webkit-font-smoothing: antialiased
-moz-osx-font-smoothing: grayscale
{{#each codepoints}}
@mixin spot-icon-{{@key}}
content: "\\{{this}}"
.spot-icon_{{@key}}:before
content: "\\{{this}}"
{{/each}}

@ -0,0 +1,9 @@
{{#each codepoints}}
@mixin icon-mixin-{{@key}}
content: "\\{{this}}"
.{{../classPrefix}}{{@key}}:before
content: "\\{{this}}"
{{/each}}

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 129 B

Before

Width:  |  Height:  |  Size: 187 B

After

Width:  |  Height:  |  Size: 187 B

Before

Width:  |  Height:  |  Size: 138 B

After

Width:  |  Height:  |  Size: 138 B

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 231 B

Before

Width:  |  Height:  |  Size: 101 B

After

Width:  |  Height:  |  Size: 101 B

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 610 B

After

Width:  |  Height:  |  Size: 610 B

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 388 B

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 125 B

Before

Width:  |  Height:  |  Size: 683 B

After

Width:  |  Height:  |  Size: 683 B

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

Before

Width:  |  Height:  |  Size: 283 B

After

Width:  |  Height:  |  Size: 283 B

Before

Width:  |  Height:  |  Size: 582 B

After

Width:  |  Height:  |  Size: 582 B

Before

Width:  |  Height:  |  Size: 450 B

After

Width:  |  Height:  |  Size: 450 B

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 341 B

Before

Width:  |  Height:  |  Size: 358 B

After

Width:  |  Height:  |  Size: 358 B

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 257 B

Before

Width:  |  Height:  |  Size: 285 B

After

Width:  |  Height:  |  Size: 285 B

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 166 B

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 359 B

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 244 B

Before

Width:  |  Height:  |  Size: 266 B

After

Width:  |  Height:  |  Size: 266 B

Before

Width:  |  Height:  |  Size: 153 B

After

Width:  |  Height:  |  Size: 153 B

Before

Width:  |  Height:  |  Size: 172 B

After

Width:  |  Height:  |  Size: 172 B

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 166 B

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 382 B

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 233 B

Before

Width:  |  Height:  |  Size: 161 B

After

Width:  |  Height:  |  Size: 161 B

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

Before

Width:  |  Height:  |  Size: 677 B

After

Width:  |  Height:  |  Size: 677 B

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 514 B

After

Width:  |  Height:  |  Size: 514 B

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 235 B

Before

Width:  |  Height:  |  Size: 583 B

After

Width:  |  Height:  |  Size: 583 B

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 564 B

After

Width:  |  Height:  |  Size: 564 B

Before

Width:  |  Height:  |  Size: 519 B

After

Width:  |  Height:  |  Size: 519 B

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 315 B

Before

Width:  |  Height:  |  Size: 285 B

After

Width:  |  Height:  |  Size: 285 B

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 171 B

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 179 B

Before

Width:  |  Height:  |  Size: 296 B

After

Width:  |  Height:  |  Size: 296 B

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Before

Width:  |  Height:  |  Size: 527 B

After

Width:  |  Height:  |  Size: 527 B

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 337 B

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 662 B

After

Width:  |  Height:  |  Size: 662 B

Before

Width:  |  Height:  |  Size: 899 B

After

Width:  |  Height:  |  Size: 899 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save