Skip to content

Commit 5b47182

Browse files
authored
use css for custom model box from local file (graphhopper#318)
1 parent b57d208 commit 5b47182

File tree

8 files changed

+22
-5
lines changed

8 files changed

+22
-5
lines changed
File renamed without changes.

src/map/MapOptions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState } from 'react'
2-
import styles from './MapOptions.modules.css'
2+
import styles from './MapOptions.module.css'
33
import { MapOptionsStoreState } from '@/stores/MapOptionsStore'
44
import Dispatcher from '@/stores/Dispatcher'
55
import { SelectMapLayer, ToggleRoutingGraph, ToggleUrbanDensityLayer } from '@/actions/Actions'

src/sidebar/CustomModelBox.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.cm-s-default .cm-string {
2+
color: #067D17;
3+
}
4+
5+
.cm-s-default .cm-property {
6+
color: #871094;
7+
}
8+
9+
.cm-s-default .cm-number {
10+
color: #1750EB;
11+
}
12+
13+
.cm-s-default .cm-atom {
14+
color: #0033B3;
15+
}

src/sidebar/CustomModelBox.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import 'codemirror/lib/codemirror.css'
22
import 'codemirror/addon/hint/show-hint.css'
33
import 'codemirror/addon/lint/lint.css'
4-
// todo: this belongs to this app and we should not take it from the demo...
5-
import 'custom-model-editor/demo/style.css'
4+
import '@/sidebar/CustomModelBox.css'
65
import styles from '@/sidebar/CustomModelBox.module.css'
76
import { useCallback, useEffect, useRef, useState } from 'react'
87
import { create } from 'custom-model-editor/src/index'

src/sidebar/search/routingProfiles/RoutingProfiles.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import styles from './RoutingProfiles.modules.css'
2+
import styles from './RoutingProfiles.module.css'
33
import Dispatcher from '@/stores/Dispatcher'
44
import { ClearRoute, DismissLastError, SetCustomModelBoxEnabled, SetVehicleProfile } from '@/actions/Actions'
55
import { RoutingProfile } from '@/api/graphhopper'

webpack.common.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ module.exports = {
5757
{
5858
loader: 'css-loader',
5959
options: {
60-
modules: true,
60+
modules: {
61+
auto: (resourcePath) => resourcePath.endsWith(".module.css")
62+
},
6163
},
6264
},
6365
],

webpack.dev.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const develop = {
2222
loader: 'css-loader',
2323
options: {
2424
modules: {
25+
auto: (resourcePath) => resourcePath.endsWith(".module.css"),
2526
localIdentName: '[path][name]__[local]',
2627
},
2728
},

0 commit comments

Comments
 (0)