Skip to content

Commit aab12ba

Browse files
author
Richard Feldman
committed
Rename Css.Foreign to Css.Global and update docs
1 parent a52c950 commit aab12ba

15 files changed

+27
-27
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Releases
22
| Version | Notes |
33
| ------- | ----- |
4-
| [**15.0.0** (unreleased)](https://github.com/rtfeldman/elm-css/tree/15.0.0) | Remove `asPairs`, `Css.Namespace`, and arithmetic operators. Don't report warnings, just emit CSS. Make `Property` opaque and more efficient. Fix `withMedia` nesting bug. (#352)
4+
| [**15.0.0** (unreleased)](https://github.com/rtfeldman/elm-css/tree/15.0.0) | Remove `asPairs`, `Css.Namespace`, and arithmetic operators. Don't report warnings, just emit CSS. Make `Property` opaque and more efficient. Fix `withMedia` nesting bug. (#352) Rename `Css.Global` to `Css.Foreign`. (#360)
55
| [**14.0.0**](https://github.com/rtfeldman/elm-css/tree/14.0.0) | Remove `Css.asPairsDEPRECATED` in favor of `DEPRECATED.Css.asPairs`. (#352) Fix bug in `borderBottomWidth` functions. (#380) Make `styled` more flexible. (#420) Add `pointerEvents` (#377). Add `Css.Transitions`.
66
| [**13.1.1**](https://github.com/rtfeldman/elm-css/tree/13.1.1) | Fix `AngleOrDirection` bug (#356)
77
| [**13.1.0**](https://github.com/rtfeldman/elm-css/tree/13.1.0) | Add program, programWithFlags, and beginnerProgram to Html.Styled. (#381) Add `withAttribute`. (#389)

elm-package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"Css",
1111
"Css.Transitions",
1212
"Css.Media",
13-
"Css.Foreign",
13+
"Css.Global",
1414
"Css.Colors",
1515
"Html.Styled",
1616
"Html.Styled.Attributes",

examples/generated-classes/css/Dreamwriter/Editor.elm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Dreamwriter.Editor exposing (editor, headerBar, purpleCircle)
22

33
import Css exposing (..)
4-
import Css.Foreign exposing (..)
4+
import Css.Global exposing (..)
55
import DEPRECATED.Css.File exposing (UniqueClass, UniqueSvgClass, uniqueClass, uniqueSvgClass)
66

77

examples/generated-classes/css/Dreamwriter/Sidebar.elm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Dreamwriter.Sidebar exposing (chapter, menu)
22

33
import Css exposing (..)
4-
import Css.Foreign exposing (..)
4+
import Css.Global exposing (..)
55
import DEPRECATED.Css.File exposing (UniqueClass, uniqueClass)
66

77

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module.exports = function(
8686
[
8787
"DEPRECATED.Css.File.UniqueClass",
8888
"DEPRECATED.Css.File.UniqueSvgClass",
89-
"Css.Foreign.Snippet"
89+
"Css.Global.Snippet"
9090
],
9191
readElmiPath,
9292
generatedDir,

js/generate-main.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function writeMain(
3232
function generateMain(modules /*: Array<ModuleDeclaration> */) {
3333
const otherModules = [
3434
"Css",
35-
"Css.Foreign",
35+
"Css.Global",
3636
"DEPRECATED.Css.File",
3737
"Platform",
3838
"Json.Decode"
@@ -63,7 +63,7 @@ function generateMain(modules /*: Array<ModuleDeclaration> */) {
6363
" , update = \\_ _ -> ( (), Cmd.none )\n" +
6464
" , subscriptions = \\_ -> Sub.none\n" +
6565
" }\n\n\n" +
66-
"classToSnippet : String -> a -> Css.Foreign.Snippet\n" +
66+
"classToSnippet : String -> a -> Css.Global.Snippet\n" +
6767
"classToSnippet str class =\n" +
6868
" classToSnippet str class\n\n\n" + // This is just to make type-checking pass. We'll splice in a useful implementation after emitting.
6969
"main : Program () () Never\n" +
@@ -77,7 +77,7 @@ function generateMain(modules /*: Array<ModuleDeclaration> */) {
7777
function generateStylesheet(modul /*: ModuleDeclaration */) {
7878
const entries = modul.values.map(function(value) {
7979
switch (value.signature) {
80-
case "Css.Foreign.Snippet":
80+
case "Css.Global.Snippet":
8181
return modul.name + "." + value.name;
8282
case "DEPRECATED.Css.File.UniqueClass":
8383
case "DEPRECATED.Css.File.UniqueSvgClass":

js/hack-main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = function hackMain(
1919
// nobody can depend on the contents of these values--which they never should!
2020
const injection =
2121
namespacer +
22-
"Main$classToSnippet = F2(function(className, styles) { return A2(_rtfeldman$elm_css$Css_Foreign$class, className, styles._0); });";
22+
"Main$classToSnippet = F2(function(className, styles) { return A2(_rtfeldman$elm_css$Css_Global$class, className, styles._0); });";
2323

2424
const newMain = [
2525
main.slice(0, injectionPoint),

src/Css.elm

+1-1
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ we haven't gotten around to adding them!
947947
948948
If you need something that `elm-css` does not support right now, the
949949
[`Css.property`](http://package.elm-lang.org/packages/rtfeldman/elm-css/latest/Css#property)
950-
and [`Css.Foreign.selector`](http://package.elm-lang.org/packages/rtfeldman/elm-css/latest/Css-Foreign#selector)
950+
and [`Css.Global.selector`](http://package.elm-lang.org/packages/rtfeldman/elm-css/latest/Css-Global#selector)
951951
functions let you define custom properties and selectors, respectively.
952952
953953

src/Css/Foreign.elm src/Css/Global.elm

+5-5
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ module Css.Foreign
8787
, withClass
8888
)
8989

90-
{-| Style foreign DOM structures (e.g. generated from markdown) where you cannot
91-
add attributes.
90+
{-| Apply global CSS to things like foreign DOM structures (e.g. generated
91+
from markdown) where you cannot add attributes.
9292
93-
This works by using CSS selectors which are [globally scoped and
93+
This module relies on CSS selectors which are [globally scoped and
9494
bad for maintainability](https://medium.com/seek-blog/the-end-of-global-css-90d2a4a06284),
95-
so definitely avoid using this module except when you specifically need to style
96-
third-party DOM nodes!
95+
so definitely avoid using this module except when there is no reasonable way
96+
do to it using `Style` instead!
9797
9898
9999
# Global Styles

tests/CompileFixtures.elm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module CompileFixtures exposing (..)
22

33
import Css exposing (..)
4-
import Css.Foreign exposing (..)
4+
import Css.Global exposing (..)
55
import Css.Preprocess exposing (Stylesheet, stylesheet)
66

77

tests/Fixtures.elm

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Fixtures exposing (..)
22

33
import Css exposing (..)
4-
import Css.Foreign exposing (..)
4+
import Css.Global exposing (..)
55
import Css.Media exposing (only, print, withMedia)
66
import Css.Preprocess exposing (Stylesheet, stylesheet)
77

@@ -234,7 +234,7 @@ borders =
234234
, borderImageOutset2 (int 3) (Css.em 4)
235235
]
236236
, a [ border2 (px 10) solid ]
237-
, Css.Foreign.table [ borderSpacing (px 10) ]
237+
, Css.Global.table [ borderSpacing (px 10) ]
238238
]
239239

240240

tests/Media.elm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Media exposing (..)
22

33
import Css exposing (..)
4-
import Css.Foreign exposing (Snippet, a, body, button, class, li, media, mediaQuery, p, ul)
4+
import Css.Global exposing (Snippet, a, body, button, class, li, media, mediaQuery, p, ul)
55
import Css.Media as Media exposing (..)
66
import Css.Preprocess exposing (stylesheet)
77
import Expect

tests/Properties.elm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Properties exposing (all)
22

33
import Css exposing (..)
4-
import Css.Foreign exposing (p)
4+
import Css.Global exposing (p)
55
import Css.Preprocess exposing (stylesheet)
66
import Expect
77
import Test exposing (..)

tests/Selectors.elm

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Selectors exposing (..)
22

33
import Css exposing (..)
4-
import Css.Foreign exposing (..)
4+
import Css.Global exposing (..)
55
import Css.Preprocess exposing (stylesheet)
66
import Expect
77
import Test exposing (..)
@@ -45,17 +45,17 @@ elements =
4545
, testSelector "li" li
4646
, testSelector "main" main_
4747
, testSelector "p" p
48-
, testSelector "pre" Css.Foreign.pre
48+
, testSelector "pre" Css.Global.pre
4949
, testSelector "dd" dd
5050
, testSelector "dl" dl
5151
, testSelector "dt" dt
5252
, testSelector "a" a
5353
, testSelector "code" code
54-
, testSelector "small" Css.Foreign.small
54+
, testSelector "small" Css.Global.small
5555
, testSelector "span" span
5656
, testSelector "strong" strong
5757
, testSelector "i" i
58-
, testSelector "em" Css.Foreign.em
58+
, testSelector "em" Css.Global.em
5959
, testSelector "q" q
6060
, testSelector "img" img
6161
, testSelector "audio" audio
@@ -64,7 +64,7 @@ elements =
6464
, testSelector "caption" caption
6565
, testSelector "col" col
6666
, testSelector "colgroup" colgroup
67-
, testSelector "table" Css.Foreign.table
67+
, testSelector "table" Css.Global.table
6868
, testSelector "tbody" tbody
6969
, testSelector "td" td
7070
, testSelector "tfoot" tfoot
@@ -79,7 +79,7 @@ elements =
7979
, testSelector "legend" legend
8080
, testSelector "optgroup" optgroup
8181
, testSelector "option" option
82-
, testSelector "progress" Css.Foreign.progress
82+
, testSelector "progress" Css.Global.progress
8383
, testSelector "select" select
8484
]
8585

tests/Transitions.elm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Transitions exposing (..)
22

3-
import Css.Foreign exposing (p)
3+
import Css.Global exposing (p)
44
import Css.Preprocess exposing (stylesheet)
55
import Css.Transitions exposing (..)
66
import Expect

0 commit comments

Comments
 (0)