【发布时间】:2018-02-28 02:50:58
【问题描述】:
我正在尝试做一件看似简单但运气不佳的事情。我有一个使用 Grommet UX 框架的 React 应用程序。在应用程序中,我使用了一个我想要设置样式的网络聊天组件。
扣眼样式已正确应用于字体,但未应用我对网络聊天组件的自定义更改。
非常感谢任何帮助。
App.js
import '../scss/custom.scss';
...
class PatientApp extends React.Component {
...
render() {
...
<Chat className='wc-app' directline='GUID_Entered_Here />
自定义.scss
@import 'elu.defaults.scss';
@import '~grommet/scss/grommet-core/index.scss';
body .wc-app, .wc-app button, .wc-app input, .wc-app textarea {
font-family: 'Segoe UI', sans-serif;
font-size: 15px;
background-color: #2AD2C9;
}
.wc-chatview-panel {
font-family: 'Segoe UI', sans-serif;
font-size: 15px;
font-style: #2AD2C9;
}
.wc-header {
font-family: 'Segoe UI', sans-serif;
font-size: 15px;
font-style: #2AD2C9;
}
.wc-message-pane {
font-family: 'Segoe UI', sans-serif;
font-size: 15px;
font-style: #2AD2C9;
}
下面是我运行代码时显示输出 HTML 的屏幕截图。在右侧,您会注意到所引用的类名。
【问题讨论】:
-
这个网络聊天组件是您制作的(自定义)还是您正在使用的库?
-
这是我正在使用的库...github.com/Microsoft/BotFramework-WebChat
-
在这种情况下,我会敦促您检查 Chat 组件在浏览器中生成的元素。找出要更改字体的部分,然后在 CSS 中使用它们的类名。我认为您没有使用 CSS 定位正确的元素。
-
更新显示输出截图。