有没有办法使用SASS将样式应用于基于内容的跨度?

时间:2018-07-12 11:44:26

标签: html css sass styles

目的是仅使用动态css样式处理器而不使用任何span

SASS样式应用于javascript/jQuery.元素

应用样式的条件应该是span内的文本

示例:

<span>Should be green</span>
<span>Just span</span>
<span>Just span</span>
<span>Just span</span>
<span>Just span</span>
<span>Just span</span>

在研究期间,我没有找到任何解决方案。

我知道有很多方法可以通过使用jQuery或JS来简单地设置它,但是我的要求是找到sass风格的解决方案。

谢谢您的任何建议!

1 个答案:

答案 0 :(得分:1)

您只需添加一个div或class,例如: 并让css覆盖所有范围。

version: '3.0'
networks:
  default:
    ipam:
      driver: default
services:
  jackett:
    image: linuxserver/jackett
    depends_on:
      - vpn
    restart: always
    network_mode: "service:vpn"
    environment:
      PGID: 1000
      PUID: 1000
      TZ: Europe/London
    volumes:
      - /mnt/user/config/jackett:/config
      - /mnt/user/media/downloads/jackett:/downloads

  transmission:
    image: linuxserver/transmission:48
    depends_on:
      - vpn
    environment:
      TZ: 'Europe/London'
      PGID: 1000
      PUID: 1000
    network_mode: "service:vpn"
    tmpfs:
      - /tmp
    restart: unless-stopped
    stdin_open: true
    tty: true
    volumes:
      - /mnt/user/config/transmission:/config
      - /mnt/user/media/downloads:/downloads

  radarr:
    image: linuxserver/radarr
    depends_on:
      - vpn
    restart: always
    network_mode: "service:vpn"
    environment:
      PGID: 1000
      PUID: 1000
      TZ: Europe/London
    volumes:
      - /mnt/user/config/radarr:/config
      - /mnt/user/media/downloads/complete:/downloads
      - /mnt/user/media/movies:/movies

  sonarr:
    image: linuxserver/sonarr
    depends_on:
      - vpn
    restart: always
    network_mode: "service:vpn"
    environment:
      PGID: 1000
      PUID: 1000
      TZ: Europe/London
    volumes:
      - /mnt/user/config/sonarr:/config
      - /mnt/user/media/downloads/complete:/downloads
      - /mnt/user/media/tvshows:/tv

  vpn:
    image: dperson/openvpn-client
    sysctls:
      - net.ipv6.conf.all.disable_ipv6=0
    cap_add:
      - net_admin
    dns:
     - 8.8.4.4
     - 8.8.8.8
    environment:
      TZ: 'Europe/London'
    read_only: true
    tmpfs:
      - /tmp
    restart: unless-stopped
    security_opt:
      - label:disable
    stdin_open: true
    tty: true
    volumes:
      - /dev/net:/dev/net:z
      - /mnt/user/config/vpn:/vpn

  web:
    image: nginx
    depends_on:
      - transmission
      - sonarr
      - jackett
      - radarr
    environment:
      TZ: 'Europe/London'
      IPV6: 0
    links:
      - vpn:transmission
      - vpn:jackett
      - vpn:radarr
      - vpn:sonarr
    ports:
      - "80:80"
      - "443:443"
    read_only: true
    volumes:
      - /mnt/user/config/nginx:/etc/nginx/conf.d:ro
      - /mnt/user/config/nginx/ssl:/etc/nginx/ssl:ro
    tmpfs:
      - /run
      - /tmp
      - /var/cache/nginx
    restart: unless-stopped
    stdin_open: true
    tty: true
.demo-class span {
  display: block;
  font-size: 30px;
}
.demo-class span:nth-of-type(1) {
      color: #008000;
}
.demo-class span:nth-of-type(2) {
      color: #7a73aa;
      font-size: 20px;
}
.demo-class span:nth-of-type(3) {
      color: #ea5f72;
      font-size: 15px;
}
.demo-class span:nth-of-type(4) {
      color: #f1cb06;
}
.demo-class span:nth-of-type(5) {
      color: #7a73aa;
      font-size: 15px;
}
.demo-class span:nth-of-type(6) {
      color: #f1cb06;
}