小编Rom*_*tit的帖子

在createMuiTheme中访问以前的主题变量

运行材质UI 1.0.0-beta.24

我正在使用createMuiTheme以下方式设置新主题:

import {createMuiTheme} from 'material-ui/styles';

const theme = createMuiTheme({
  typography: {
    fontSize: 16
  }
});

export default theme;
Run Code Online (Sandbox Code Playgroud)

我怎样才能直接访问我直接覆盖的主题?我想这样做,这是行不通的:

import {createMuiTheme} from 'material-ui/styles';

const theme = createMuiTheme({
  typography: {
    fontSize: theme.typography.fontSize + 2
  }
});

export default theme;
Run Code Online (Sandbox Code Playgroud)

theming reactjs material-ui jss

9
推荐指数
2
解决办法
1712
查看次数

Webkit:Css文本选择样式不能使背景变白?

因此,文本选择可以通过:: selection伪元素进​​行样式化,以覆盖浏览器的默认选择颜色.但对我来说,似乎禁止使用白色作为选择背景颜色,而采用灰色,不透明的颜色.

::selection      { color: black;  background: white; }
::-moz-selection { color: black;  background: white; }

body {
    background: black;
    color: white;
}
Run Code Online (Sandbox Code Playgroud)
So selecting me is supposed to invert the text and background colors. But the selected text background color is not white, but grey.
Run Code Online (Sandbox Code Playgroud)

为什么这不能创造出完美的白色背景?相反,它显示灰色背景(#989898)

Css选择不接受白色背景

另请参阅https://jsfiddle.net/duk3/hzodm1sh/上的这个片段

css webkit styling selection

7
推荐指数
1
解决办法
1036
查看次数

将数组传递给包含在树枝中

看来争论没有正确通过......

    {% set items = {
        item: {
            'id': '1',
            'brand': 'client1',
            'description': 'solutions.client1.description' | trans},
        item: {
            'id':  '2',
            'brand': 'client2',
            'description': 'solutions.client2.description' | trans}
    } %}

    {% include 'site/case-excerpt.html.twig'
        with {'id': items.item.id,
              'brand': items.item.brand,
              'description': items.item.description
        }
  %}
Run Code Online (Sandbox Code Playgroud)

然后在site/case-excerpt.html.twig文件中:

{% include 'site/testimonials/item.html.twig'
     with {'id': id,
           'brand': brand,
           'description': description
          }
%}
Run Code Online (Sandbox Code Playgroud)

并在site/testimonials/item.html.twig文件中:

<div class="carousel-item {{ id }}">
    <img src="images/brands/{{ brand }}.jpg">
    <p>
        {{ description }}
    </p>
</div>
Run Code Online (Sandbox Code Playgroud)

预期输出如下:

<div class="carousel-item 1">
    <img src="images/brands/client1.jpg">
    <p> …
Run Code Online (Sandbox Code Playgroud)

php twig twig-extension

5
推荐指数
1
解决办法
1万
查看次数

图标字体:一些图标在我的机器上显示为文本

这是关于我的机器如何看待网络的问题,而不是个人网络项目。 在我的计算机上,某些图标字体显示为文字文本(图标的名称),而不是图形图标本身。

环境

  • MacBook Pro(视网膜显示屏,13 英寸,2015 年初)
  • MacOS 塞拉利昂 10.12.3
  • 使用最新版本的 Chrome、Safari 和 Firefox 浏览器时发生的情况

  • 我使用良好的互联网连接并且字体文件不会加载失败
  • 我不使用代理并且不住在中国
  • 禁用所有浏览器扩展后,问题仍然发生。
  • 编辑:我在浏览器控制台中根本没有错误/警告。

例如,这就是我看到的https://developers.google.com/web/ 谷歌图标不显示

https://material.io/icons/ 材质图标未显示

任何帮助表示赞赏

fonts webfonts font-face icon-fonts material-design

4
推荐指数
1
解决办法
1万
查看次数

Twig包括:在传递的参数中使用翻译

这很好用

{% include 'site/snippet.html.twig'
    with {'description': 'Some text'}
%}
Run Code Online (Sandbox Code Playgroud)

但是如何使这个工作?使用翻译作为参数

{% include 'site/snippet.html.twig'
    with {'description': '{{ 'solutions.description' | trans }}'}
%}
Run Code Online (Sandbox Code Playgroud)

snippet.html内容为:

<p>
    {{ description }}
</p>
Run Code Online (Sandbox Code Playgroud)

并且{{ 'solutions.description' | trans }}单独调用翻译会按预期显示内容.

它会是什么语法?

php symfony twig twig-extension

0
推荐指数
1
解决办法
409
查看次数