Skip to content

NodeRule

Creates a style rule for nodes.

Props

nodeAttributes

selector

  • type: (node: Node) => Boolean

  • default: () => true

    The selector function to apply to the nodes.

Example

vue
<template>
  ...
  <NodeRule :selector="rule.selector" :attributes="rule.attributes" />
  ...
</template>
<script setup lang="ts">
import { NodeRule, NodeRuleProps } from "@linkurious/ogma-vue";
const rule = ref<NodeRuleProps>({
  attributes: {
    color: "blue",
  },
  selector: () => true,
});
</script>